------------------------------------------ -- McKenyu Weppos Manager START ------------------------------------------ -- Utility function for parameter setting function SetWepPosParam(rowID, offset, value, dataType) local Target_Param = PARAM_WepAbsorpPosParam act(SetParamValue, Target_Param, rowID, offset, dataType, value) end -- 1h Hand function RightHand(rowID, slot, value) local offsets = { [1] = 0x8, [2] = 0x12, [3] = 0x1c, [4] = 0x26 } SetWepPosParam(rowID, offsets[slot], value, SIGNED_INT) end -- 2h Hand function BothHand(rowID, slot, value) local offsets = { [1] = 0xc, [2] = 0x16, [3] = 0x20, [4] = 0x2a } SetWepPosParam(rowID, offsets[slot], value, SIGNED_INT) end -- Right Sheath function RightSheath(rowID, slot, value) local offsets = { [1] = 0x10, [2] = 0x1a, [3] = 0x24, [4] = 0x2c } SetWepPosParam(rowID, offsets[slot], value, SIGNED_INT) end ------------------------------- -- Main ------------------------------- local spEffectPairs = { -- ICE GREATAXE { rowIDs = {729}, activate = 7000130, revert = 7000131, handler = function(rid, val) BothHand(rid, 3, val) end, activateValue = 24, revertValue = -1 }, { rowIDs = {729}, activate = 7000130, revert = 7000131, handler = function(rid, val) BothHand(rid, 1, val) end, activateValue = 24, revertValue = -1 }, { rowIDs = {729}, activate = 7000130, revert = 7000131, handler = function(rid, val) RightHand(rid, 3, val) end, activateValue = 24, revertValue = -1 }, { rowIDs = {729}, activate = 7000132, revert = 7000133, handler = function(rid, val) BothHand(rid, 1, val) end, activateValue = -1, revertValue = 20 }, { rowIDs = {729}, activate = 7000132, revert = 7000133, handler = function(rid, val) BothHand(rid, 2, val) end, activateValue = -1, revertValue = 21 }, { rowIDs = {729}, activate = 7000134, revert = 7000135, handler = function(rid, val) BothHand(rid, 4, val) end, activateValue = 20, revertValue = -1 }, { rowIDs = {729}, activate = 7000134, revert = 7000135, handler = function(rid, val) RightHand(rid, 4, val) end, activateValue = 20, revertValue = -1 }, -- WUKONG { rowIDs = {631}, activate = 7000140, revert = 7000141, handler = function(rid, val) BothHand(rid, 1, val) end, activateValue = 21, revertValue = 20 }, { rowIDs = {631}, activate = 7000140, revert = 7000141, handler = function(rid, val) BothHand(rid, 2, val) end, activateValue = 21, revertValue = 20 }, { rowIDs = {631}, activate = 7000142, revert = 7000143, handler = function(rid, val) BothHand(rid, 2, val) end, activateValue = -1, revertValue = 20 }, -- KATANA, Hand Sheathe TEMP { rowIDs = {635}, activate = 7500001, revert = 7500002, handler = function(rid, val) RightHand(rid, 1, val) end, activateValue = 20, revertValue = 994 }, -- From Hand Sheath to R Hand { rowIDs = {635}, activate = 7500001, revert = 7500002, handler = function(rid, val) BothHand(rid, 1, val) end, activateValue = 20, revertValue = 994 }, -- From Hand Sheath to R Hand { rowIDs = {635}, activate = 7500003, revert = 7500004, handler = function(rid, val) RightHand(rid, 2, val) end, activateValue = 994, revertValue = 994 }, -- Hand Sheath { rowIDs = {635}, activate = 7500003, revert = 7500004, handler = function(rid, val) BothHand(rid, 2, val) end, activateValue = 994, revertValue = 994 }, -- Hand Sheath { rowIDs = {635}, activate = 7500005, revert = 7500006, handler = function(rid, val) RightHand(rid, 2, val) end, activateValue = 2069, revertValue = 994 }, -- From Hip Sheath to Hand Sheath { rowIDs = {635}, activate = 7500005, revert = 7500006, handler = function(rid, val) BothHand(rid, 2, val) end, activateValue = 2069, revertValue = 994 }, -- From Hip Sheath to Hand Sheath { rowIDs = {635}, activate = 7500009, revert = 7500010, handler = function(rid, val) RightHand(rid, 2, val) end, activateValue = 987, revertValue = 994 }, { rowIDs = {635}, activate = 7500009, revert = 7500010, handler = function(rid, val) BothHand(rid, 2, val) end, activateValue = 987, revertValue = 994 }, { rowIDs = {635}, activate = 7500007, revert = 7500008, handler = function(rid, val) RightHand(rid, 1, val) end, activateValue = 994, revertValue = 994 }, -- Hand Sheath { rowIDs = {635}, activate = 7500007, revert = 7500008, handler = function(rid, val) RightHand(rid, 2, val) end, activateValue = 994, revertValue = 994 }, -- Hand Sheath { rowIDs = {635}, activate = 7500007, revert = 7500008, handler = function(rid, val) BothHand(rid, 1, val) end, activateValue = 994, revertValue = 994 }, -- Hand Sheath { rowIDs = {635}, activate = 7500007, revert = 7500008, handler = function(rid, val) BothHand(rid, 2, val) end, activateValue = 994, revertValue = 994 }, -- Hand Sheath -- KATANA, Hip Sheathe TEMP { rowIDs = {635}, activate = 7500011, revert = 7500012, handler = function(rid, val) RightHand(rid, 1, val) end, activateValue = 20, revertValue = 2069 }, -- From Hip Sheath to R Hand { rowIDs = {635}, activate = 7500011, revert = 7500012, handler = function(rid, val) BothHand(rid, 1, val) end, activateValue = 20, revertValue = 2069 }, -- From Hip Sheath to R Hand { rowIDs = {635}, activate = 7500013, revert = 7500014, handler = function(rid, val) RightHand(rid, 2, val) end, activateValue = 2069, revertValue = 2069 }, -- Hip Sheath { rowIDs = {635}, activate = 7500013, revert = 7500014, handler = function(rid, val) BothHand(rid, 2, val) end, activateValue = 2069, revertValue = 2069 }, -- Hip Sheath { rowIDs = {635}, activate = 7500015, revert = 7500016, handler = function(rid, val) RightHand(rid, 2, val) end, activateValue = 994, revertValue = 2069 }, -- From Hand Sheath to Hip Sheath { rowIDs = {635}, activate = 7500015, revert = 7500016, handler = function(rid, val) BothHand(rid, 2, val) end, activateValue = 994, revertValue = 2069 }, -- From Hand Sheath to Hip Sheath { rowIDs = {635}, activate = 7500019, revert = 7500020, handler = function(rid, val) RightHand(rid, 2, val) end, activateValue = 987, revertValue = 2069 }, { rowIDs = {635}, activate = 7500019, revert = 7500020, handler = function(rid, val) BothHand(rid, 2, val) end, activateValue = 987, revertValue = 2069 }, { rowIDs = {635}, activate = 7500017, revert = 7500018, handler = function(rid, val) RightHand(rid, 1, val) end, activateValue = 2069, revertValue = 2069 }, -- Hip Sheath { rowIDs = {635}, activate = 7500017, revert = 7500018, handler = function(rid, val) RightHand(rid, 2, val) end, activateValue = 2069, revertValue = 2069 }, -- Hip Sheath { rowIDs = {635}, activate = 7500017, revert = 7500018, handler = function(rid, val) BothHand(rid, 1, val) end, activateValue = 2069, revertValue = 2069 }, -- Hip Sheath { rowIDs = {635}, activate = 7500017, revert = 7500018, handler = function(rid, val) BothHand(rid, 2, val) end, activateValue = 2069, revertValue = 2069 }, -- Hip Sheath -- KATANA, Hip Sheathe and Blade Hand PERMA { rowIDs = {635}, activate = 7500021, revert = 7500022, handler = function(rid, val) RightHand(rid, 1, val) end, activateValue = 20, revertValue = 20 }, -- Hip Sheath { rowIDs = {635}, activate = 7500021, revert = 7500022, handler = function(rid, val) RightHand(rid, 2, val) end, activateValue = 2069, revertValue = 2069 }, -- Hip Sheath { rowIDs = {635}, activate = 7500021, revert = 7500022, handler = function(rid, val) BothHand(rid, 1, val) end, activateValue = 20, revertValue = 20 }, -- Hip Sheath { rowIDs = {635}, activate = 7500021, revert = 7500022, handler = function(rid, val) BothHand(rid, 2, val) end, activateValue = 2069, revertValue = 2069 }, -- Hip Sheath -- KATANA, Regular Unsheathe Stance { rowIDs = {635}, activate = 7500031, revert = 7500032, handler = function(rid, val) BothHand(rid, 1, val) end, activateValue = 20, revertValue = 20 }, -- From Hand Sheath to R Hand { rowIDs = {635}, activate = 7500033, revert = 7500034, handler = function(rid, val) BothHand(rid, 2, val) end, activateValue = 994, revertValue = 2069 }, -- Hand Sheath { rowIDs = {635}, activate = 7500035, revert = 7500036, handler = function(rid, val) BothHand(rid, 1, val) end, activateValue = 994, revertValue = 20 }, -- Hand Sheath { rowIDs = {635}, activate = 7500035, revert = 7500036, handler = function(rid, val) BothHand(rid, 2, val) end, activateValue = 994, revertValue = 2069 }, -- Hand Sheath } -- Instead of taking an external list of rowIDs, we iterate over the rowIDs defined in each spEffect pair. function originalMcKenyuWepPos() for _, spEffect in ipairs(spEffectPairs) 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 end end end ------------------------------------------ -- McKenyu Weppos Manager END ------------------------------------------