Repository navigation
Expand file tree
/
Copy pathSpinBot.h
More file actions
84 lines (62 loc) · 2.09 KB
/
Copy pathSpinBot.h
File metadata and controls
84 lines (62 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#pragma once
/// @file
/// The SpinBot feature: continuously rotates the local first-person body and
/// weapon meshes about yaw while enabled, resetting them to zero on disable.
#include "Feature.h"
#include "../ue/Engine.h"
/// Spins the local player's first-person meshes by advancing a yaw angle each
/// frame (10 degrees/tick, wrapping at 360).
class SpinBot : public Feature
{
private:
APortalWarsCharacter* Player = 0; ///< cached local character; refreshed each Check()
float CurrentSpinYaw = 0.f; ///< accumulated spin angle in degrees; 0 means "at rest"
FHitResult resultPlayer; ///< out-param sink for the body mesh SetRelativeRotation sweep
FHitResult resultWeapon; ///< out-param sink for the weapon mesh SetRelativeRotation sweep
public:
SpinBot()
{
Name = "SpinBot";
UpdateEnabled();
Log("Created");
};
void UpdateEnabled()
{
Enabled = Settings.EXPLOITS.SpinBot;
};
bool Check()
{
if (!Initialized) return false;
if (!Engine::PlayerController) return false;
if (!Engine::IsInGame) return false;
Player = reinterpret_cast<APortalWarsCharacter*>(Engine::PlayerController->Character);
if (!Player) return false;
if (!Player->Mesh1P) return false;
if (!Player->CurrentWeapon) return false;
if (!Player->CurrentWeapon->Mesh1P) return false;
return true;
};
void Init()
{
Initialized = true;
Log("Initialized");
};
void Destroy()
{
if (CurrentSpinYaw == 0.f) return;
auto PlayerMesh = Player->Mesh1P;
auto WeaponMesh = Player->CurrentWeapon->Mesh1P;
PlayerMesh->K2_SetRelativeRotation(FRotator(0.f, 0.f, 0.f), true, resultPlayer, false);
WeaponMesh->K2_SetRelativeRotation(FRotator(0.f, 0.f, 0.f), true, resultWeapon, false);
CurrentSpinYaw = 0.f;
};
void Run()
{
if (CurrentSpinYaw > 360.f) CurrentSpinYaw = 0.f;
auto PlayerMesh = Player->Mesh1P;
auto WeaponMesh = Player->CurrentWeapon->Mesh1P;
PlayerMesh->K2_SetRelativeRotation(FRotator(0.f, CurrentSpinYaw, 0.f), true, resultPlayer, false);
WeaponMesh->K2_SetRelativeRotation(FRotator(0.f, CurrentSpinYaw, 0.f), true, resultWeapon, false);
CurrentSpinYaw += 10.f;
};
};