-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Код:
angleTickLog Resolver::loggedAngles[65];
float pelvisVelocity[5][65] = { 0.0f };
float pelvisMaxVelocityLog[5][6] = { 0.0f };
float pelvisAverageVelocity[5] = { 0.0f };
int pelvisCalculationCounter[25] = { 0 };
// PEOPLE WHO REVERSED ANIMS HATE HIM!!!
// HE DETECTS BALANCE_ADJUST WITH THIS
// ONE WEIRD TRICK FROM 1934!!!
// CLICK HERE TO FIND OUT HOW!!!
bool Resolver::lbyDeltaOver120(int plID)
{
if (lastDeltaOver120[plID] && pelvisAverageVelocity[plID] > 3.f)
deltaDiffName [plID] = ** curtime;
else if (pelvisAverageVelocity[plID] > 6.f && g_GlobalVars->curtime - deltaDiffName[plID] > .1f)
{
deltaDiffName[plID] = g_GlobalVars->curtime;
lastDeltaOver120[plID] = true;
}
else if (!lastDeltaOver120[plID] && pelvisAverageVelocity[plID] < 3.f)
deltaDiffName [plID] = ** curtime;
else if (pelvisAverageVelocity[plID] < 3.f && g_GlobalVars->curtime - deltaDiffName[plID] > .1f)
{
deltaDiffName [plID] = ** curtime;
lastDeltaOver120[plID] = false;
}
return lastDeltaOver120[plID];
}
//Complex averaging of values incomming yay
void calculatePelvisVelocity(C_BasePlayer* player, int plID)
{
if (player->m_vecVelocity().Length2D() > 1)
return;
if (pelvisCalculationCounter[plID] < 0)
pelvisCalculationCounter[plID] = 0;
pelvisCalculationCounter[plID]--;
Vector posP = player->GetHitboxPos(Hitboxes::HITBOX_PELVIS) - player->m_vecOrigin();
if (LagCompensation::m_PlayerTrack[plID].size() > 0)
posP = Math::RotateVectorYaw(Vector(0, 0, 0), -player->m_angEyeAngles().yaw, posP);
float deltaP = (posP - lastPelvis[plID]).Length2D();
lastPelvis[plID] = posP;
float maxVelocity = std::fabsf(deltaP / g_GlobalVars->interval_per_tick);
float vel = maxVelocity;
for (int i = 0; i < 64; i++)
{
pelvisVelocity[plID][i + 1] = pelvisVelocity[plID];
maxVelocity = std::fmaxf(maxVelocity, pelvisVelocity[plID][i + 1]);
}
pelvisVelocity[plID][0] = vel;
if (pelvisCalculationCounter[plID] >= 64)
{
pelvisCalculationCounter[plID] = 0;
pelvisMaxVelocityLog[plID][1] = pelvisMaxVelocityLog[plID][2];
pelvisMaxVelocityLog[plID][0] = pelvisMaxVelocityLog[plID][1];
}
pelvisMaxVelocityLog[plID][2] = maxVelocity;
pelvisAverageVelocity[plID] = (pelvisMaxVelocityLog[plID][0] + pelvisMaxVelocityLog[plID][1] + pelvisMaxVelocityLog[plID][2]) * 0.333f;
}
bool Resolver::didLBYUpdate(C_BasePlayer* player) {
int curTarget = player->EntIndex();
//Getting perfect time is simpler than anyone thinks.
double cTime = (rand() % 420) / 360.0;
if ((player->m_vecVelocity().Length2D() > 1.f && storedLBYFromUpdate[curTarget] != player->m_flLowerBodyYawTarget()) || player->m_vecVelocity().Length2D() > 25)
{
oldStoredCurtime[curTarget] = cTime + 0.22f;
firstBreak[curTarget] = false;
storedLBYFromUpdate[curTarget] = player->m_flLowerBodyYawTarget();
Resolver::lbyUpdate[player->EntIndex()] = true;
return true;
}
//On your own on this one
Resolver::lbyUpdate[player->EntIndex()] = false;
return false;
}
static void AWResolver(C_BasePlayer* player, int entID) {
C_BaseCombatWeapon* curweapon = g_LocalPlayer->m_hActiveWeapon();
CCSWeaponInfo* weaponData = nullptr;
if (curweapon) weaponData = curweapon->GetCSWeaponData();
INetChannelInfo* nci = g_EngineClient->GetNetChannelInfo();
float ping = 0;
if (nci) ping = nci->GetLatency(MAX_FLOWS);
int pingShots = 0;
if (weaponData) pingShots = ping / weaponData->flCycleTime;
if (Resolver::didLBYUpdate(player)) {
player->m_angEyeAngles().yaw = player->m_flLowerBodyYawTarget();
}
else if ()
{
if (g_PlayerSettings[entID].shotCount - g_PlayerSettings[entID].shotCountLog <= 5 + pingShots)
{
player->m_angEyeAngles().yaw = player->m_flLowerBodyYawTarget() + g_PlayerSettings[entID].loggedLBYDelta;
switch (g_PlayerSettings[entID].shotCount - g_PlayerSettings[entID].shotCountLog % 7)
{
case 2:
player->m_angEyeAngles().yaw += RandomFloat(8, 12);
break;
case 3:
player->m_angEyeAngles().yaw -= RandomFloat(8, 12);
break;
case 4:
player->m_angEyeAngles().yaw += RandomFloat(18, 22);
break;
case 5:
player->m_angEyeAngles().yaw -= RandomFloat(18, 22);
break;
case 6:
player->m_angEyeAngles().yaw += RandomFloat(22, 25);
break;
case 7:
player->m_angEyeAngles().yaw -= RandomFloat(22, 25);
break;
}
}
else {
g_PlayerSettings[entID].logFailCount++;
g_PlayerSettings[entID].useLoggedAngles = false;
}
}
else if (!Resolver::lbyDeltaOver120(entID)) {
switch ((g_PlayerSettings[entID].shotCount) % 12)
{
case 0: //needs addition of if playerhurt[entid] = 1 etc
case 1:
player->m_angEyeAngles().yaw = player->m_flLowerBodyYawTarget() - 180.f;
break;
case 2:
player->m_angEyeAngles().yaw = player->m_flLowerBodyYawTarget() + 145.f;
break;
case 3:
player->m_angEyeAngles().yaw = player->m_flLowerBodyYawTarget() - 145.f;
break;
case 4:
player->m_angEyeAngles().yaw = player->m_flLowerBodyYawTarget() + 120.f;
break;
case 5:
player->m_angEyeAngles().yaw = player->m_flLowerBodyYawTarget() - 120.f;
break;
case 6:
player->m_angEyeAngles().yaw = player->m_flLowerBodyYawTarget() + 162.f;
break;
case 7:
player->m_angEyeAngles().yaw = player->m_flLowerBodyYawTarget() - 162.f;
break;
case 8:
player->m_angEyeAngles().yaw = player->m_flLowerBodyYawTarget() + 132.f;
break;
case 9:
player->m_angEyeAngles().yaw = player->m_flLowerBodyYawTarget() - 132.f;
break;
case 10:
player->m_angEyeAngles().yaw = player->m_flLowerBodyYawTarget() + 170;
break;
case 11:
player->m_angEyeAngles().yaw = player->m_flLowerBodyYawTarget() - 130;
break;
case 12:
player->m_angEyeAngles().yaw = player->m_flLowerBodyYawTarget() + 130;
break;
case 13:
player->m_angEyeAngles().yaw = player->m_flLowerBodyYawTarget() + 110;
break;
case 14:
player->m_angEyeAngles().yaw = player->m_flLowerBodyYawTarget() - 110;
break;
}
}
else {
switch ((g_PlayerSettings[entID].shotCount) % 17)
{
case 0:
case 1:
player->m_angEyeAngles().yaw = -player->m_flLowerBodyYawTarget();
break;
case 2:
player->m_angEyeAngles().yaw = -player->m_flLowerBodyYawTarget() - 25.f;
break;
case 3:
player->m_angEyeAngles().yaw = -player->m_flLowerBodyYawTarget() + 25.f;
break;
case 4:
player->m_angEyeAngles().yaw = -player->m_flLowerBodyYawTarget() + 105;
break;
case 5:
player->m_angEyeAngles().yaw = -player->m_flLowerBodyYawTarget() - 105;
break;
case 6:
player->m_angEyeAngles().yaw = -player->m_flLowerBodyYawTarget() + 50.f;
break;
case 7:
player->m_angEyeAngles().yaw = -player->m_flLowerBodyYawTarget() - 50.f;
break;
case 8:
player->m_angEyeAngles().yaw = -player->m_flLowerBodyYawTarget() + 70.f;
break;
case 9:
player->m_angEyeAngles().yaw = -player->m_flLowerBodyYawTarget() - 70.f;
break;
case 10:
player->m_angEyeAngles().yaw = -player->m_flLowerBodyYawTarget() + 43.f;
break;
case 11:
player->m_angEyeAngles().yaw = -player->m_flLowerBodyYawTarget() - 43.f;
break;
case 12:
player->m_angEyeAngles().yaw = -player->m_flLowerBodyYawTarget() + 95;
break;
case 13:
player->m_angEyeAngles().yaw = -player->m_flLowerBodyYawTarget() - 95;
break;
}
}
Resolver::loggedAngles[entID].prevAngles.push_front(angleLog(lastLBY[entID], g_PlayerSettings[entID].shotCount - g_PlayerSettings[entID].shotCountLog, player->m_flSimulationTime(), Resolver::lbyUpdate[entID]));
}
static void AirResolver(C_BasePlayer* player, int entID)
{
float atTargetAngle = Math::CalcAngle(g_LocalPlayer->GetEyePos(), player->m_vecOrigin()).yaw;
float magicalanglethatyoudontknow = 420;
float primaryBaseAngle = player->m_flLowerBodyYawTarget();
float secondaryBaseAngle = magicalanglethatyoudontknow;
switch ((g_PlayerSettings[entID].shotCount) % 3)
{
case 0:
player->m_angEyeAngles().yaw = atTargetAngle + 180.f;
break;
case 1:
player->m_angEyeAngles().yaw = secondaryBaseAngle + 180.f;
break;
case 2:
player->m_angEyeAngles().yaw = primaryBaseAngle;
break;
case 3:
player->m_angEyeAngles().yaw = primaryBaseAngle - 45.f;
break;
case 4:
player->m_angEyeAngles().yaw = primaryBaseAngle + 90.f;
break;
case 5:
player->m_angEyeAngles().yaw = primaryBaseAngle - 130.f;
break;
case 6:
player->m_angEyeAngles().yaw = primaryBaseAngle - 180.f;
break;
case 7:
player->m_angEyeAngles().yaw = secondaryBaseAngle;
break;
}
}
static void ResolvePlayerYaw(C_BasePlayer* player, int entID)
{
char curtime = *reinterpret_cast<char*>(**(CCSGOPlayerAnimState***)Utils::PatternScan("matchmaking.dll", "A1 ? ? ? ? 0F 84 ? ? ? ? 33 C9") - 7);
if (curtime - g_PlayerSettings[entID].shotCountTime > 3)
{
g_PlayerSettings[entID].shotCountLog = g_PlayerSettings[entID].shotCount + g_PlayerSettings[entID].shotCountLog;
g_PlayerSettings[entID].shotCount = 10;
g_PlayerSettings[entID].shotCountTime = -curtime;
}
if (g_PlayerSettings[entID].shotCount == 0 || g_GlobalVars->curtime - g_PlayerSettings[entID].shotCountTime < 0.3f)
calculatePelvisVelocity(player, entID);
else
{
deltaDiffName[entID] = curtime;
pelvisAverageVelocity[entID] = lastDeltaOver120[entID] ? 12 : 0;
lastPelvis[entID] = posP;
}
//The checks looked better before FakeWalkResolver was added, so don't blame me for this, ty.
if (player->m_vecVelocity().Length2D() > 5 && player->m_vecVelocity().Length2D() <= 35 && player->m_fFlags() & FL_ONGROUND)
FakeWalkResolver(player, entID); //(C) Joker AKA XRAY, not my code. but the secret, brute lby + 120 and -120 so not even worth it /shrug
else if (player->m_fFlags() & FL_ONGROUND)
AWResolver(player, entID);
else
AirResolver(player, entID);
}