-
Автор темы
- #1
нужен порт скрипта из фатала до нла
source:
local function vtable_thunk(_type, index)
local ffitype = ffi.typeof(_type)
return function (class, ...)
local this = ffi.cast("void***", class)
return ffi.cast(ffitype, this[0][index])(this, ...)
end
end
ffi.cdef[[
struct pose_parameters_t
{
char pad[8];
float m_flStart;
float m_flEnd;
float m_flState;
};
]]
-- Example
local VClientEntityList = utils.find_interface("client.dll", "VClientEntityList003")
local GetClientEntityFN = vtable_thunk("void*(__thiscall*)(void*, int)", 3)
local animation_breakers = {}
animation_breakers.collected_cache = {}
local studio_hdr_offset = 0x2950
local allanimstate_offset = 0x9960
local landing_offset = 0x109
local pose_parameter_pattern = "55 8B EC 8B 45 08 57 8B F9 8B 4F 04 85 C9 75 15"
get_pose_parameters = ffi.cast("struct pose_parameters_t*(__thiscall* )(void*, int)", utils.find_pattern("client.dll", pose_parameter_pattern))
local leg_movement = gui.get_config_item("Rage>Anti-Aim>Desync>Leg Slide")
local fd = gui.get_config_item("misc>movement>fake duck")
local two = false
local land = false
local once = false
local time = 10
local time2 = 2
function SetPose(self_pointer, layer, start_value, end_value)
local new_player_pointer = ffi.cast("unsigned int", self_pointer)
local NULL = 0x0
if new_player_pointer == NULL then
return false
end
local studio_hdr = ffi.cast("void**", new_player_pointer + studio_hdr_offset)[0]
if not studio_hdr or studio_hdr == NULL then
return false
end
local pose_parameters = get_pose_parameters(studio_hdr, layer)
if not pose_parameters or pose_parameters == NULL then
return false
end
if animation_breakers.collected_cache[layer] == nil then
animation_breakers.collected_cache[layer] = {}
animation_breakers.collected_cache[layer].m_flStart = pose_parameters.m_flStart
animation_breakers.collected_cache[layer].m_flEnd = pose_parameters.m_flEnd
animation_breakers.collected_cache[layer].m_flState = pose_parameters.m_flState
animation_breakers.collected_cache[layer].is_applied = false
return true
end
if start_value ~= nil and not animation_breakers.collected_cache[layer].is_applied then
pose_parameters.m_flStart = start_value
pose_parameters.m_flEnd = end_value
pose_parameters.m_flState = (pose_parameters.m_flStart + pose_parameters.m_flEnd) / 2
animation_breakers.collected_cache[layer].is_applied = true
return true
end
if animation_breakers.collected_cache[layer].is_applied then
pose_parameters.m_flStart = animation_breakers.collected_cache[layer].m_flStart
pose_parameters.m_flEnd = animation_breakers.collected_cache[layer].m_flEnd
pose_parameters.m_flState = animation_breakers.collected_cache[layer].m_flState
animation_breakers.collected_cache[layer].is_applied = false
return true
end
return false
end
local v,v1,v2,v3,v4,v5 = gui.add_multi_combo("modern breaker", "lua>tab a", {"air static","air break", "legs jitter", "legs static", "lower body yaw", "fake duck breaker"})
function on_create_move(cmd)
local self_index = engine.get_local_player()
local local_player = GetClientEntityFN(VClientEntityList, self_index)
local NULL = 0x0
if not local_player or local_player == NULL then
return
end
local local_player_address = ffi.cast("unsigned int", local_player)
if not local_player_address or local_player_address == NULL then
return
end
local animstate_offset = allanimstate_offset
local animstate = ffi.cast("void**", local_player_address + animstate_offset)[0]
if not animstate or animstate == NULL then
return
end
animstate = ffi.cast("unsigned int", animstate)
if not animstate or animstate == 0x0 then
return
end
local animation_on_landing = ffi.cast("bool*", animstate + landing_offset)[0]
if not landing_offset or landing_offset == NULL then
return
end
local rer = bit.band(entities.get_entity(engine.get_local_player()):get_prop("m_fFlags"),bit.lshift(2, 0)) ~= 0
if v1:get_bool() then
if utils.random_int(0,1) == 0 then
SetPose(local_player, 6, 0, 1)
else
SetPose(local_player, 6, 0.1, 0)
end
elseif v:get_bool() then
SetPose(local_player, 6, 0.7, 1)
else
SetPose(local_player, 6, 0.1, 0)
end
if v2:get_bool() then
leg_movement:set_int(2)
if utils.random_int(0,1) > 0 then
SetPose(local_player, 0, 0, 20)
else
SetPose(local_player, 0, 14, 10)
end
elseif v3:get_bool() then
SetPose(local_player, 0, 0, 20)
end
if v4:get_bool() then
SetPose(local_player, 10, 0, 0)
end
if v5:get_bool() then
if fd:get_bool() then
if utils.random_int(0,5) == 0 then
SetPose(local_player, 16, 0, 0)
else
SetPose(local_player, 16, 10, 0)
end
end
end
end
function on_setup_move(cmd)
local self_index = engine.get_local_player()
local local_player = GetClientEntityFN(VClientEntityList, self_index)
local NULL = 0x0
if not local_player or local_player == NULL then
return
end
local pose_parameters_cache = animation_breakers.collected_cache
for key, cache in pairs(pose_parameters_cache) do
SetPose(local_player, key)
end
end