0% found this document useful (0 votes)
14 views3 pages

Anim Breaker

Uploaded by

gregorydcfake
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views3 pages

Anim Breaker

Uploaded by

gregorydcfake
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

--.

name Animation Breaker


--.author dario / dario#0069

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 class_ptr = ffi.typeof('void***')


local uintptr_t = ffi.typeof('uintptr_t**')

local function this_call(call_function, parameters)


return function(...)
return call_function(parameters, ...)
end
end

local VClientEntityList = ffi.cast(uintptr_t, utils.find_interface('client.dll',


'VClientEntityList003'))
local get_client_entity = this_call(ffi.cast('get_client_entity_t',
VClientEntityList[0][3]), VClientEntityList)

local is_moving = false


local was_in_air = true

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,

-- zero pitch on land


[2] = function(pointer)
if not was_in_air then
local anim_state = ffi.cast('anim_state_t**', ffi.cast('uintptr_t',
pointer) + 0x9960)[0]
if anim_state.m_bInHitGroundAnimation then
ffi.cast('float*', ffi.cast('uintptr_t', pointer) + 10104)[12] =
0.5
end
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 not (player and player:is_alive()) then


return
end

local pointer = get_client_entity(index)

local fFlags = player:get_prop('m_fFlags')


local in_air = fFlags == 256 or fFlags == 262

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy