Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.81 KB | None | 0 0
  1. #include "Resolver.h"
  2. #include "Ragebot.h"
  3. #include "Hooks.h"
  4. #include "LagComp.h"
  5. int IClientEntity::GetSequenceActivity(int sequence)
  6. {
  7. auto hdr = Interfaces::ModelInfo->GetStudiomodel(this->GetModel());
  8.  
  9. if (!hdr)
  10. return -1;
  11.  
  12. static auto getSequenceActivity = (DWORD)(Utilities::Memory::FindPatternV2("client.dll", "55 8B EC 83 7D 08 FF 56 8B F1 74"));
  13. static auto GetSequenceActivity = reinterpret_cast<int(__fastcall*)(void*, studiohdr_t*, int)>(getSequenceActivity);
  14.  
  15. return GetSequenceActivity(this, hdr, sequence);
  16. }
  17. /*Animation List*/
  18. /*
  19. activity == 961 && flweight == 1.f && flcycle <= 0.0f --- Reloading/shooting
  20. activity == 979 && flweight == 1.0f && flcycle == 0.f --- lby update?
  21. */
  22. BackTrack* lbybacktrack;
  23. bool lowerBodyYawUpdated(IClientEntity* pEntity) {
  24. for (int w = 0; w < 13; w++)
  25. {
  26. AnimationLayer currentLayer = pEntity->GetAnimOverlay(w);
  27. const int activity = pEntity->GetSequenceActivity(currentLayer.m_nSequence);
  28. float flcycle = currentLayer.m_flCycle, flprevcycle = currentLayer.m_flPrevCycle, flweight = currentLayer.m_flWeight, flweightdatarate = currentLayer.m_flWeightDeltaRate;
  29. uint32_t norder = currentLayer.m_nOrder;
  30. if (activity == 973 && flweight == 1.f || activity == 979 && flweight == 1.0f && currentLayer.m_flPrevCycle != currentLayer.m_flCycle)// 961 looks like they shot //flweight seems like right as the animation or right after 972 could be moving
  31. return true;
  32. }
  33. return false;
  34. }
  35. //gonna fix resolver for you. with correct animation statements from vids i watched and other resolvers that showed the same results.
  36. bool IsBreakingLBY120(IClientEntity* pEntity)
  37. {
  38. for (int w = 0; w < 13; w++)
  39. {
  40. AnimationLayer prevlayer;
  41. AnimationLayer currentLayer = pEntity->GetAnimOverlay(w);
  42. const int activity = pEntity->GetSequenceActivity(currentLayer.m_nSequence);
  43. float flcycle = currentLayer.m_flCycle, flprevcycle = currentLayer.m_flPrevCycle, flweight = currentLayer.m_flWeight, flweightdatarate = currentLayer.m_flWeightDeltaRate;
  44. uint32_t norder = currentLayer.m_nOrder;
  45. if (activity == ACT_CSGO_IDLE_ADJUST_STOPPEDMOVING || activity == ACT_CSGO_IDLE_TURN_BALANCEADJUST && flweight >= .99 && currentLayer.m_flPrevCycle != currentLayer.m_flCycle)
  46. {
  47. float flanimTime = currentLayer.m_flCycle, flsimtime = pEntity->GetSimulationTime();
  48.  
  49. return true;//force lby-180?
  50. }
  51. prevlayer = currentLayer;
  52. return false;
  53. }
  54. return false;
  55. }
  56. bool IsResolvableByLBY(IClientEntity* pEntity)
  57. {
  58. for (int w = 0; w < 13; w++)
  59. {
  60. AnimationLayer prevlayer;
  61. AnimationLayer currentLayer = pEntity->GetAnimOverlay(w);
  62. const int activity = pEntity->GetSequenceActivity(currentLayer.m_nSequence);
  63. float flcycle = currentLayer.m_flCycle, flprevcycle = currentLayer.m_flPrevCycle, flweight = currentLayer.m_flWeight, flweightdatarate = currentLayer.m_flWeightDeltaRate;
  64. uint32_t norder = currentLayer.m_nOrder;
  65. if (activity == 979 && currentLayer.m_flWeight == 0.f && currentLayer.m_flPrevCycle != currentLayer.m_flCycle)
  66. {
  67. return true;//bruteeee because breaking lby <120
  68. }
  69. prevlayer = currentLayer;
  70. }
  71. return false;
  72. }
  73. bool playerStoppedMoving(IClientEntity* pEntity)
  74. {
  75. for (int w = 0; w < 13; w++)
  76. {
  77. AnimationLayer currentLayer = pEntity->GetAnimOverlay(w);
  78. const int activity = pEntity->GetSequenceActivity(currentLayer.m_nSequence);
  79. float flcycle = currentLayer.m_flCycle, flprevcycle = currentLayer.m_flPrevCycle, flweight = currentLayer.m_flWeight, flweightdatarate = currentLayer.m_flWeightDeltaRate;
  80. uint32_t norder = currentLayer.m_nOrder;
  81. if (activity == ACT_CSGO_IDLE_ADJUST_STOPPEDMOVING)
  82. return true;
  83. }
  84. return false;
  85. }
  86.  
  87. bool lowerBodyPrediction(IClientEntity* pEntity)
  88. {
  89. static float prediction = 0.f;
  90. static bool secondrun = false;
  91. float flServerTime = (float)pEntity->GetTickBase() * Interfaces::Globals->interval_per_tick;
  92. if (playerStoppedMoving(pEntity) && !secondrun)
  93. {
  94. prediction = flServerTime + 0.22;
  95. secondrun = true;
  96. }
  97. else if (pEntity->GetVelocity().Length2D() < 0.1f && secondrun && prediction <= pEntity->GetSimulationTime())
  98. {
  99. prediction = pEntity->GetTickBase() + 1.1f;
  100. }
  101. else//theyre moving
  102. {
  103. secondrun = false;
  104. return false;
  105. }
  106. if (prediction <= pEntity->GetSimulationTime())
  107. {
  108. return true;
  109. }
  110. return false;
  111. }
  112.  
  113. bool isflying(IClientEntity* pEntity)
  114. {
  115. if (!pEntity->GetFlags() & FL_ONGROUND)
  116. {
  117. return true;
  118. }
  119. return false;
  120. }
  121. void ResolverSetup::Pitches(IClientEntity* pEntity)
  122. {
  123.  
  124. }
  125.  
  126.  
  127.  
  128. void ResolverSetup::LowerBody(IClientEntity* pEntity)
  129. {
  130. static float playerYaw[64];
  131. static float playerMovingLby[64];
  132. static float updatedYaw[64];
  133. auto index = pEntity->GetIndex();
  134. auto velocity = pEntity->GetVelocity().Length2D();
  135. playerYaw[index] = pEntity->GetEyeAnglesXY()->y;
  136.  
  137. if (Menu::Window.RageBotTab.AimbotResolver.GetIndex())
  138. {
  139. if (velocity > 0.1f && !isflying(pEntity))//fakewalk check meme
  140. {
  141. playerYaw[index] = *pEntity->GetLowerBodyYawTarget();
  142. playerMovingLby[index] = *pEntity->GetLowerBodyYawTarget();
  143. }
  144.  
  145. else if (IsResolvableByLBY(pEntity) && Globals::missedshots < 2 && !isflying(pEntity) && !IsBreakingLBY120(pEntity) && !lowerBodyPrediction(pEntity))//breaking lby <120 or
  146. {
  147. playerYaw[index] = *pEntity->GetLowerBodyYawTarget();
  148. }
  149. else if (IsBreakingLBY120(pEntity) && Globals::missedshots < 2 && !lowerBodyPrediction(pEntity) && !isflying(pEntity))//balance adjust was triggered causing 979
  150. {
  151. /*150 is avg*/
  152.  
  153. playerYaw[index] = updatedYaw[index] + 150;//this also means we could force lby upon that single tick...
  154. }
  155. else if (lowerBodyPrediction(pEntity))//tbh we prob want to flick it 180 here
  156. {
  157. playerYaw[index] = *pEntity->GetLowerBodyYawTarget();
  158. updatedYaw[index] = *pEntity->GetLowerBodyYawTarget();
  159.  
  160. lbyupdated = true;
  161. }
  162. if (Globals::missedshots > 2 || isflying(pEntity))
  163. {
  164. playerYaw[index] = *pEntity->GetLowerBodyYawTarget() + 60 * Globals::missedshots;
  165. }
  166.  
  167. else
  168. {
  169. playerYaw[index] = playerMovingLby[index];
  170. }
  171. }
  172. pEntity->GetEyeAnglesXY()->y = playerYaw[index];
  173. }
  174.  
  175.  
  176. void ResolverSetup::CM(IClientEntity* pEntity)
  177. {
  178. for (int x = 1; x < Interfaces::Engine->GetMaxClients(); x++)
  179. {
  180. pEntity = (IClientEntity*)Interfaces::EntList->GetClientEntity(x);
  181.  
  182. if (!pEntity
  183. || pEntity == hackManager.pLocal()
  184. || pEntity->IsDormant()
  185. || !pEntity->IsAlive())
  186. continue;
  187.  
  188. //ResolverSetup::StoreThings(pEntity);
  189. }
  190. }
  191.  
  192. void ResolverSetup::FSN(IClientEntity* pEntity, ClientFrameStage_t stage)
  193. {
  194. for (int i = 1; i < Interfaces::Engine->GetMaxClients(); i++)
  195. {
  196. pEntity = (IClientEntity*)Interfaces::EntList->GetClientEntity(i);
  197. if (!pEntity || pEntity == hackManager.pLocal() || pEntity->IsDormant() || !pEntity->IsAlive())
  198. continue;
  199. ResolverSetup::LowerBody(pEntity);
  200. //ResolverSetup::Pitches(pEntity);
  201.  
  202. }
  203. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement