-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Код:
std::vector <scan_point> aim::get_points(adjust_data* record, int hitbox, bool from_aim, Vector start)
{
studiohdr_t* pStudioHdr = (studiohdr_t*)(m_modelinfo()->GetStudioModel(record->player->GetModel()));
if (!pStudioHdr)
return { };
mstudiohitboxset_t* pHitset = pStudioHdr->pHitboxSet(record->player->m_nHitboxSet());
if (!pHitset)
return { };
mstudiobbox_t* pHitbox = pHitset->pHitbox(hitbox);
if (!pHitbox)
return { };
float_t flModifier = fmaxf(pHitbox->radius, 0.f);
Vector vecMax;
Vector vecMin;
math::vector_transform(Vector(pHitbox->bbmax.x + flModifier, pHitbox->bbmax.y + flModifier, pHitbox->bbmax.z + flModifier), record->matrixes_data.main[pHitbox->bone], vecMax);
math::vector_transform(Vector(pHitbox->bbmin.x - flModifier, pHitbox->bbmin.y - flModifier, pHitbox->bbmin.z - flModifier), record->matrixes_data.main[pHitbox->bone], vecMin);
Vector vecCenter = (vecMin + vecMax) * 0.5f;
Vector angAngle = math::calculate_angle(start, vecCenter);
Vector vecForward;
math::angle_vectors(angAngle, vecForward);
Vector vecRight = vecForward.Cross(Vector(0, 0, 2.33f));
Vector vecLeft = Vector(-vecRight.x, -vecRight.y, vecRight.z);
Vector vecTop = Vector(0, 0, 3.25f);
Vector vecBottom = Vector(0, 0, -3.25f);
int32_t iAngleToPlayer = (int32_t)(fabsf(math::normalize_yaw(record->angles.y - math::calculate_angle(start, record->player->GetAbsOrigin()).y + 180.0f)));
int32_t iDistanceToPlayer = (int32_t)(globals.local()->GetAbsOrigin().DistTo(record->player->m_vecOrigin()));
std::vector <scan_point> aMultipoints = { };
if (hitbox == HITBOX_HEAD)
{
if (!g_cfg.ragebot.weapon[globals.g.current_weapon].multipoints.at(0))
{
aMultipoints.emplace_back(vecCenter);
return aMultipoints;
}
float_t flScale = g_cfg.ragebot.weapon[globals.g.current_weapon].head_scale;
aMultipoints.emplace_back(vecCenter);
aMultipoints.emplace_back(vecCenter + ((vecTop + vecRight) * (flScale / 75.0f)));
aMultipoints.emplace_back(vecCenter + ((vecTop + vecLeft) * (flScale / 75.0f)));
}
else if (hitbox == HITBOX_CHEST)
{
if (!g_cfg.ragebot.weapon[globals.g.current_weapon].multipoints.at(1))
{
aMultipoints.emplace_back(vecCenter);
return aMultipoints;
}
float_t flModifier = 3.05f * (g_cfg.ragebot.weapon[globals.g.current_weapon].body_scale / 80.0f);
if (iAngleToPlayer < 140 && iAngleToPlayer > 30)
flModifier = 2.0f * (g_cfg.ragebot.weapon[globals.g.current_weapon].body_scale / 80.0f);
aMultipoints.emplace_back(vecCenter + Vector(0, 0, 3));
aMultipoints.emplace_back(vecCenter + vecRight * flModifier + Vector(0, 0, 3));
aMultipoints.emplace_back(vecCenter + vecLeft * flModifier + Vector(0, 0, 3));
}
else if (hitbox == HITBOX_STOMACH)
{
float_t flModifier = g_cfg.ragebot.weapon[globals.g.current_weapon].body_scale / 33.0f;
if (iAngleToPlayer < 120 && iAngleToPlayer > 60)
flModifier = (g_cfg.ragebot.weapon[globals.g.current_weapon].body_scale / 33.0f) - 0.10f;
aMultipoints.emplace_back(vecCenter + Vector(0, 0, 3.0f));
aMultipoints.emplace_back(vecCenter + vecRight * flModifier + Vector(0.0f, 0.0f, 3.0f));
aMultipoints.emplace_back(vecCenter + vecLeft * flModifier + Vector(0.0f, 0.0f, 3.0f));
}
else if (hitbox == HITBOX_PELVIS)
{
float_t flModifier = g_cfg.ragebot.weapon[globals.g.current_weapon].body_scale / 33.0f;
if (iAngleToPlayer < 120 && iAngleToPlayer > 60)
flModifier = (g_cfg.ragebot.weapon[globals.g.current_weapon].body_scale / 33.0f) - 0.10f;
aMultipoints.emplace_back(vecCenter - Vector(0.0f, 0.0f, 2.0f));
aMultipoints.emplace_back(vecCenter + vecRight * flModifier - Vector(0.0f, 0.0f, 2.0f));
aMultipoints.emplace_back(vecCenter + vecLeft * flModifier - Vector(0.0f, 0.0f, 2.0f));
}
else if (hitbox == HITBOX_LEFT_FOOT || hitbox == HITBOX_RIGHT_FOOT || hitbox == HITBOX_LEFT_THIGH || hitbox == HITBOX_RIGHT_THIGH)
{
if (!g_cfg.ragebot.weapon[globals.g.current_weapon].multipoints.at(5))
{
aMultipoints.emplace_back(vecCenter);
return aMultipoints;
}
Vector vecAddition = vecLeft;
if (hitbox == HITBOX_LEFT_FOOT || hitbox == HITBOX_LEFT_THIGH)
vecAddition = vecRight;
else if (hitbox == HITBOX_RIGHT_FOOT || hitbox == HITBOX_RIGHT_THIGH)
vecAddition = vecLeft;
if (hitbox == HITBOX_LEFT_THIGH || hitbox == HITBOX_RIGHT_THIGH)
vecCenter -= Vector(0.0f, 0.0f, 2.5f);
aMultipoints.emplace_back(vecCenter - (vecAddition * 0.90f));
}
else if (hitbox == HITBOX_LEFT_FOREARM || hitbox == HITBOX_RIGHT_FOREARM)
aMultipoints.emplace_back(vecCenter - (hitbox == HITBOX_LEFT_FOREARM ? vecLeft : -vecLeft));
return aMultipoints;
}