------------------------------------------ -- Fixed decompiled c8000.hks for ELDEN RING -- HKS file for Torrent -- Refined from decompiles by Vawser -- Curated at: https://github.com/ividyon/EldenRingHKS ------------------------------------------ -- Version 1 for ER version 1.12.1 ------------------------------------------ -- Changelog: -- 2023-02-14 - Vawser: Cleaned up and added. -- 2024-06-28 - Exelot: Recreated on raw decompiler. No functional changes present. ------------------------------------------ -- Convergence Code ------------------------------------------ function MountSpeedIncrease() act(SetMovementScaleMult, 0.95) end ------------------------------------------ -- Vanilla Code ------------------------------------------ function Event20000_onUpdate() if EventCommonFunction(20000) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_PhantomIdle") return end end function Event20001_onUpdate() if EventCommonFunction(20001) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20002_onUpdate() if EventCommonFunction(20002) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20003_onUpdate() if EventCommonFunction(20003) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20004_onUpdate() if EventCommonFunction(20004) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20005_onUpdate() if EventCommonFunction(20005) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20006_onUpdate() if EventCommonFunction(20006) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20007_onUpdate() if EventCommonFunction(20007) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20008_onUpdate() if EventCommonFunction(20008) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20009_onUpdate() if EventCommonFunction(20009) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20010_onUpdate() if EventCommonFunction(20010) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20011_onUpdate() if EventCommonFunction(20011) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20012_onUpdate() if EventCommonFunction(20012) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20013_onUpdate() if EventCommonFunction(20013) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20014_onUpdate() if EventCommonFunction(20014) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20015_onUpdate() if EventCommonFunction(20015) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20016_onUpdate() if EventCommonFunction(20016) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20017_onUpdate() if EventCommonFunction(20017) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20018_onUpdate() if EventCommonFunction(20018) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20019_onUpdate() if EventCommonFunction(20019) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20020_onUpdate() if EventCommonFunction(20020) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20021_onUpdate() if EventCommonFunction(20021) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20022_onUpdate() if EventCommonFunction(20022) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20023_onUpdate() if EventCommonFunction(20023) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20024_onUpdate() if EventCommonFunction(20024) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20025_onUpdate() if EventCommonFunction(20025) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20026_onUpdate() if EventCommonFunction(20026) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20027_onUpdate() if EventCommonFunction(20027) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20028_onUpdate() if EventCommonFunction(20028) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20029_onUpdate() if EventCommonFunction(20029) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20030_onUpdate() if EventCommonFunction(20030) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20031_onUpdate() if EventCommonFunction(20031) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20032_onUpdate() if EventCommonFunction(20032) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20033_onUpdate() if EventCommonFunction(20033) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20034_onUpdate() if EventCommonFunction(20034) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20035_onUpdate() if EventCommonFunction(20035) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20036_onUpdate() if EventCommonFunction(20036) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20037_onUpdate() if EventCommonFunction(20037) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20038_onUpdate() if EventCommonFunction(20038) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20039_onUpdate() if EventCommonFunction(20039) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20040_onUpdate() if EventCommonFunction(20040) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20041_onUpdate() if EventCommonFunction(20041) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20042_onUpdate() if EventCommonFunction(20042) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20043_onUpdate() if EventCommonFunction(20043) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20044_onUpdate() if EventCommonFunction(20044) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20045_onUpdate() if EventCommonFunction(20045) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20046_onUpdate() if EventCommonFunction(20046) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20047_onUpdate() if EventCommonFunction(20047) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20048_onUpdate() if EventCommonFunction(20048) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20049_onUpdate() if EventCommonFunction(20049) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20050_onUpdate() if EventCommonFunction(20050) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20051_onUpdate() if EventCommonFunction(20051) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20052_onUpdate() if EventCommonFunction(20052) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20053_onUpdate() if EventCommonFunction(20053) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20054_onUpdate() if EventCommonFunction(20054) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20055_onUpdate() if EventCommonFunction(20055) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20056_onUpdate() if EventCommonFunction(20056) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20057_onUpdate() if EventCommonFunction(20057) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20058_onUpdate() if EventCommonFunction(20058) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20059_onUpdate() if EventCommonFunction(20059) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event30000_onUpdate() if EventCommonFunction(30000) == TRUE then return end end function Event30001_onUpdate() if EventCommonFunction(30001) == TRUE then return end end function Event30002_onUpdate() if EventCommonFunction(30002) == TRUE then return end end function Event30003_onUpdate() if EventCommonFunction(30003) == TRUE then return end end function Event30004_onUpdate() if EventCommonFunction(30004) == TRUE then return end end function Event30005_onUpdate() if EventCommonFunction(30005) == TRUE then return end end function Event30006_onUpdate() if EventCommonFunction(30006) == TRUE then return end end function Event30007_onUpdate() if EventCommonFunction(30007) == TRUE then return end end function Event30008_onUpdate() if EventCommonFunction(30008) == TRUE then return end end function Event30009_onUpdate() if EventCommonFunction(30009) == TRUE then return end end function Event30010_onUpdate() if EventCommonFunction(30010) == TRUE then return end end function Event30011_onUpdate() if EventCommonFunction(30011) == TRUE then return end end function Event30012_onUpdate() if EventCommonFunction(30012) == TRUE then return end end function Event30013_onUpdate() if EventCommonFunction(30013) == TRUE then return end end function Event30014_onUpdate() if EventCommonFunction(30014) == TRUE then return end end function Event30015_onUpdate() if EventCommonFunction(30015) == TRUE then return end end function Event30016_onUpdate() if EventCommonFunction(30016) == TRUE then return end end function Event30017_onUpdate() if EventCommonFunction(30017) == TRUE then return end end function Event30018_onUpdate() if EventCommonFunction(30018) == TRUE then return end end function Event30019_onUpdate() if EventCommonFunction(30019) == TRUE then return end end function Event30020_onUpdate() if EventCommonFunction(30020) == TRUE then return end end function Event30021_onUpdate() if EventCommonFunction(30021) == TRUE then return end end function Event30022_onUpdate() if EventCommonFunction(30022) == TRUE then return end end function Event30023_onUpdate() if EventCommonFunction(30023) == TRUE then return end end function Event30024_onUpdate() if EventCommonFunction(30024) == TRUE then return end end function Event30025_onUpdate() if EventCommonFunction(30025) == TRUE then return end end function Event30026_onUpdate() if EventCommonFunction(30026) == TRUE then return end end function Event30027_onUpdate() if EventCommonFunction(30027) == TRUE then return end end function Event30028_onUpdate() if EventCommonFunction(30028) == TRUE then return end end function Event30029_onUpdate() if EventCommonFunction(30029) == TRUE then return end end function GetDeltaTime() return env(ObtainedDT) / 1000 end function ConvergeValue(target_val, cur_val, max_inc, max_dec) local ret = target_val if target_val == cur_val then return ret end local dT = GetDeltaTime() local gap = math.abs(target_val - cur_val) local add_val = 0 if cur_val < target_val then add_val = math.abs(max_inc * dT) elseif target_val < cur_val then add_val = -1 * math.abs(max_dec * dT) end if add_val < gap then ret = cur_val + add_val if add_val > 0 then if target_val < ret then ret = target_val end elseif ret < target_val then ret = target_val end end return ret end function Move_onGenerate() local speed = 0 local turnangle = GetVariable("TurnAngle") local internaloffset = GetVariable("InternalOffset") if math.abs(turnangle) <= 1 then speed = 1 elseif math.abs(turnangle) <= 2.6 then speed = 1.3 else speed = 2 end local maxoffset = 0.1 * speed local minoffset = -0.1 * speed local target_val = 0 if math.abs(turnangle) <= 0.2 then target_val = 0 elseif turnangle > 0.2 then target_val = minoffset elseif turnangle < -0.2 then target_val = maxoffset end local offset = ConvergeValue(target_val, internaloffset, 0.3, 0.3) local rootpos_pose_modelspace = hkbGetBoneModelSpace("Root") local rootpos_pose_localspace = hkbGetBoneLocalSpace("Root") local quat = rootpos_pose_localspace:getRotation() / rootpos_pose_modelspace:getRotation() local offset_vec = hkVector4.new(1, 0, 0, 0) offset_vec:setRotatedDir(quat, offset_vec) offset_vec = offset_vec * offset local rootpos_translation_localspace = rootpos_pose_localspace:getTranslation() + offset_vec rootpos_pose_localspace:setTranslation(rootpos_translation_localspace) hkbSetBoneLocalSpace("Root", rootpos_pose_localspace) SetVariable("RollTwistAngle", offset * 60) SetVariable("YawTwistAngle", offset * 340) SetVariable("InternalOffset", offset) SetVariable("YawTwistAngle_Twistroot", offset * 340 / 4) MountSpeedIncrease() end ------------------------------------------ -- Importing Convergence Modules ------------------------------------------ script_dir = debug.getinfo(1, "S").source:sub(2):match("(.*/)"):gsub("/", "\\") .. "modules\\" pcall(loadfile(script_dir .. "vanilla\\ActDictionary.hks")) pcall(loadfile(script_dir .. "vanilla\\EnvDictionary.hks")) ------------------------------------------ -- Must be last for the global variables to be read ------------------------------------------ global = {} function dummy() end global.__index = function (table, element) return dummy end setmetatable(_G, global)