------------------------------------------ -- McKenyu Moveset Manager START ------------------------------------------ function SetParam(rowID, value, Field_OFFSET, Field_Data_type) local Target_Param = PARAM_EquipParamWeapon act(SetParamValue, Target_Param, rowID, Field_OFFSET, Field_Data_type, value) end function ParamAOW(rowID, value) SetParam(rowID, value, 0x198, SIGNED_INT) end function ParamMOVESET(rowID, value) SetParam(rowID, value, 0xee, UNSIGNED_INT) end function ParamIDLE1H(rowID, value) SetParam(rowID, value, 0xf0, SIGNED_BYTE) end function ParamIDLE2H(rowID, value) SetParam(rowID, value, 0xf1, SIGNED_BYTE) end local function Contains(t, v) for _, x in ipairs(t) do if x == v then return true end end return false end local function AnyHandIs(spKinds) local r = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) local l = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) return Contains(spKinds, r) or Contains(spKinds, l) end ------------------------------- -- Main ------------------------------- -- spEffect pairs for McKenyu Buffs local buffEffectPairs = { -- Wukong {rowIDs = {97400000}, activate = 2501, revert = -1, handler = ParamAOW, activateValue = 6632, revertValue = -1}, -- Pillar Stance {rowIDs = {97400000}, activate = 2501, revert = -1, handler = ParamMOVESET, activateValue = 632, revertValue = -1}, {rowIDs = {97400000}, activate = 2501, revert = -1, handler = ParamIDLE1H, activateValue = 74, revertValue = -1}, {rowIDs = {97400000}, activate = 2501, revert = -1, handler = ParamIDLE2H, activateValue = 74, revertValue = -1}, {rowIDs = {97400000}, activate = 2511, revert = -1, handler = ParamAOW, activateValue = 6633, revertValue = -1}, -- Thrust Stance {rowIDs = {97400000}, activate = 2511, revert = -1, handler = ParamMOVESET, activateValue = 633, revertValue = -1}, {rowIDs = {97400000}, activate = 2511, revert = -1, handler = ParamIDLE1H, activateValue = 74, revertValue = -1}, {rowIDs = {97400000}, activate = 2511, revert = -1, handler = ParamIDLE2H, activateValue = 74, revertValue = -1}, {rowIDs = {97400000}, activate = 2521, revert = -1, handler = ParamAOW, activateValue = 6631, revertValue = -1}, -- Smash Stance {rowIDs = {97400000}, activate = 2521, revert = -1, handler = ParamMOVESET, activateValue = 631, revertValue = -1}, {rowIDs = {97400000}, activate = 2521, revert = -1, handler = ParamIDLE1H, activateValue = 74, revertValue = -1}, {rowIDs = {97400000}, activate = 2521, revert = -1, handler = ParamIDLE2H, activateValue = 74, revertValue = -1}, -- TEST {rowIDs = {97400000}, activate = 2601, revert = 2611, handler = ParamAOW, activateValue = 6631, revertValue = 6631}, {rowIDs = {97400000}, activate = 2601, revert = 2611, handler = ParamMOVESET, activateValue = 55, revertValue = 627}, {rowIDs = {97400000}, activate = 2601, revert = 2611, handler = ParamIDLE1H, activateValue = 74, revertValue = 74}, {rowIDs = {97400000}, activate = 2601, revert = 2611, handler = ParamIDLE2H, activateValue = 74, revertValue = 74}, -- Dreadscale {rowIDs = {97300000}, activate = 2301, revert = 2304, handler = ParamAOW, activateValue = 6997, revertValue = 6996}, {rowIDs = {97300000}, activate = 2301, revert = 2304, handler = ParamMOVESET, activateValue = 727, revertValue = 726}, {rowIDs = {97300000}, activate = 2301, revert = 2304, handler = ParamIDLE1H, activateValue = 2, revertValue = 2}, {rowIDs = {97300000}, activate = 2301, revert = 2304, handler = ParamIDLE2H, activateValue = 12, revertValue = 12}, } -- Main function for applying and reverting buffs function originalMcKenyuBuffs() for _, spEffect in ipairs(buffEffectPairs) do for _, rowID in ipairs(spEffect.rowIDs) do if env(GetSpEffectID, spEffect.activate) == TRUE then spEffect.handler(rowID, spEffect.activateValue) end if env(GetSpEffectID, spEffect.revert) == TRUE then spEffect.handler(rowID, spEffect.revertValue) end ------------------------------------------------------------ -- NEW: "buff sp_kind but activate not active" => force revert -- Dreadscale sp_kind: 726 base / 727 buff (finite buff) -- Kuroshi sp_kind: 637 base / 638 buff (infinite buff) ------------------------------------------------------------ -- Dreadscale: only revert when you're still on BUFF sp_kind (727) -- but 2301 is no longer active (prevents stuck after buff ends / death / swap) if rowID == 97300000 and AnyHandIs({727}) and env(GetSpEffectID, 2301) == FALSE then ParamAOW(rowID, 6996) ParamMOVESET(rowID, 726) ParamIDLE1H(rowID, 2) ParamIDLE2H(rowID, 77) end end end end ------------------------------------------ -- McKenyu Moveset Manager END ------------------------------------------