Anim Breaker
Anim Breaker
local anim_breaker_combo = {
gui.add_multi_combo('animation breaker', 'lua>tab b', {
'static legs in air',
'zero pitch on land',
'movement lean',
'moonwalk',
})
}
ffi.cdef[[
typedef void*(__thiscall* get_client_entity_t)(void*, int);
typedef struct
{
char pad20[24];
uint32_t m_nSequence;
float m_flPrevCycle;
float m_flWeight;
char pad20[8];
float m_flCycle;
void *m_pOwner;
char pad_0038[ 4 ];
} animation_layer_t;
typedef struct
{
char pad[ 3 ];
char m_bForceWeaponUpdate; //0x4
char pad1[ 91 ];
void* m_pBaseEntity; //0x60
void* m_pActiveWeapon; //0x64
void* m_pLastActiveWeapon; //0x68
float m_flLastClientSideAnimationUpdateTime; //0x6C
int m_iLastClientSideAnimationUpdateFramecount; //0x70
float m_flAnimUpdateDelta; //0x74
float m_flEyeYaw; //0x78
float m_flPitch; //0x7C
float m_flGoalFeetYaw; //0x80
float m_flCurrentFeetYaw; //0x84
float m_flCurrentTorsoYaw; //0x88
float m_flUnknownVelocityLean; //0x8C
float m_flLeanAmount; //0x90
char pad2[ 4 ];
float m_flFeetCycle; //0x98
float m_flFeetYawRate; //0x9C
char pad3[ 4 ];
float m_fDuckAmount; //0xA4
float m_fLandingDuckAdditiveSomething; //0xA8
char pad4[ 4 ];
float m_vOriginX; //0xB0
float m_vOriginY; //0xB4
float m_vOriginZ; //0xB8
float m_vLastOriginX; //0xBC
float m_vLastOriginY; //0xC0
float m_vLastOriginZ; //0xC4
float m_vVelocityX; //0xC8
float m_vVelocityY; //0xCC
char pad5[ 4 ];
float m_flUnknownFloat1; //0xD4
char pad6[ 8 ];
float m_flUnknownFloat2; //0xE0
float m_flUnknownFloat3; //0xE4
float m_flUnknown; //0xE8
float m_flSpeed2D; //0xEC
float m_flUpVelocity; //0xF0
float m_flSpeedNormalized; //0xF4
float m_flFeetSpeedForwardsOrSideWays; //0xF8
float m_flFeetSpeedUnknownForwardOrSideways; //0xFC
float m_flTimeSinceStartedMoving; //0x100
float m_flTimeSinceStoppedMoving; //0x104
bool m_bOnGround; //0x108
bool m_bInHitGroundAnimation; //0x109
float m_flTimeSinceInAir; //0x10A
float m_flLastOriginZ; //0x10E
float m_flHeadHeightOrOffsetFromHittingGroundAnimation; //0x112
float m_flStopToFullRunningFraction; //0x116
char pad7[ 4 ]; //0x11A
float m_flMagicFraction; //0x11E
char pad8[ 60 ]; //0x122
float m_flWorldForce; //0x15E
char pad9[ 462 ]; //0x162
float m_flMaxYaw; //0x334
} anim_state_t;
]]
local anim_breakers = {
-- static legs in air
[1] = function(pointer)
if was_in_air then
ffi.cast('float*', ffi.cast('uintptr_t', pointer) + 10104)[6] = 1
end
end,
-- movement lean
[3] = function(pointer)
if is_moving then
ffi.cast('animation_layer_t**', ffi.cast('uintptr_t', pointer) +
0x2990)[0][12].m_flWeight = 1
end
end,
-- moonwalk
[4] = function(pointer)
if is_moving then
ffi.cast('float*', ffi.cast('uintptr_t', pointer) + 10104)[7] = 0
ffi.cast('animation_layer_t**', ffi.cast('uintptr_t', pointer) +
0x2990)[0][7].m_flWeight = 0
end
end,
}
function on_create_move(cmd)
local index = engine.get_local_player()
local player = entities.get_entity(index)
if in_air then
was_in_air = true
end
is_moving = math.abs(player:get_prop('m_vecVelocity[0]') +
player:get_prop('m_vecVelocity[1]')) > 3
for i = 1, #anim_breaker_combo do
if anim_breaker_combo[i]:get_bool() then
anim_breakers[i](pointer)
end
end
was_in_air = in_air
end