Advertisement
Guest User

Untitled

a guest
Sep 18th, 2014
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 55.82 KB | None | 0 0
  1.    
  2.  
  3.     -- *** Credit goes to Flippant for helping me with Gearswap *** --
  4.     -- ** I Use Motenten's Macro Book Function ** --
  5.     -- Last Updated: 05/02/14 8:00 PM *Added RA Sets* --
  6.      
  7.     function get_sets()
  8.             AccIndex = 1
  9.             AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For TP/WS/Hybrid. First Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below. Most of These Sets Are Empty So You Need To Edit Them On Your Own. Remember To Check What The Combined Set Is For Each Sets. Can Delete Lentus If You Don't Need It. --
  10.             WeaponIndex = 1
  11.             WeaponArray = {"Amanomurakumo","Yoichinoyumi","Tsurumaru","Cibitshavore"} -- Default TP Set Is Amanomurakumo. Can Delete Any Weapons/Sets That You Don't Need Or Replace/Add The New Weapons That You Want To Use. --
  12.             IdleIndex = 1
  13.             IdleArray = {"Movement","Regen"} -- Default Idle Set Is Movement --
  14.             Armor = 'None'
  15.             Twilight = 'None'
  16.             warning = false
  17.             Attack = 'OFF' -- Set Default Attack Set ON or OFF Here --
  18.             Seigan = 'ON' -- Set Default Seigan Set ON or OFF Here --
  19.             Third_Eye = 'ON' -- Set Default Third Eye Set ON or OFF Here --
  20.             Samurai_Roll = 'ON' -- Set Default SAM Roll ON or OFF Here --
  21.             ammo_warning_limit = 10 -- Set Ammo Limit Check Here --
  22.             target_distance = 6 -- Set Default Distance Here --
  23.             select_default_macro_book() -- Change Default Macro Book At The End --
  24.      
  25.             sc_map = {SC1="TachiFudo", SC2="TachiRana", SC3="NamasArrow"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
  26.      
  27.             sets.Idle = {}
  28.             -- Idle/Town Sets --
  29.             sets.Idle.Regen = {
  30.                             head="Twilight Helm",
  31.                             neck="Wiglen Gorget",
  32.                             ear1="Sanare Earring",
  33.                             ear2="Colossus's Earring",
  34.                             body="Kirin's Osode",
  35.                             hands="Buremte Gloves",
  36.                             ring1="Sheltered Ring",
  37.                             ring2="Paguroidea Ring",
  38.                             back="Repulse Mantle",
  39.                             waist="Phasmida Belt",
  40.                             legs="Scuff. Cosciales",
  41.                             feet="Danzo Sune-Ate"}
  42.             sets.Idle.Regen.Cibitshavore = set_combine(sets.Idle.Regen,{
  43.                                     main="Tsurumaru",
  44.                             sub="Pole Grip",
  45.                             range="Cibitshavore",
  46.                             ammo="Tulfaire Arrow"})
  47.             sets.Idle.Regen.Tsurumaru = set_combine(sets.Idle.Regen,{
  48.                             main="Tsurumaru",
  49.                             sub="Pole Grip",
  50.                             range="Yoichinoyumi",
  51.                             ammo="Tulfaire Arrow"})
  52.             sets.Idle.Regen.Amanomurakumo = set_combine(sets.Idle.Regen,{
  53.                             main="Amanomurakumo",
  54.                             sub="Pole Grip",
  55.                             range="Cibitshavore",
  56.                             ammo="Tulfaire Arrow"})
  57.             sets.Idle.Regen.Yoichinoyumi = set_combine(sets.Idle.Regen,{
  58.                             main="Amanomurakumo",
  59.                             sub="Pole Grip",
  60.                             range="Yoichinoyumi",
  61.                             ammo="Tulfaire Arrow"})
  62.             sets.Idle.Regen.Lentus = set_combine(sets.Idle.Regen,{})
  63.      
  64.             sets.Idle.Movement = set_combine(sets.Idle.Regen,{
  65.                             head="Gavialis Helm",
  66.                             neck="Twilight Torque",
  67.                             ear1="Sanare Earring",
  68.                             ear2="Colossus's Earring",
  69.                             legs="Scuff. Cosciales",
  70.                                                     hands="Buremte Gloves",
  71.                                                     body="Otro. Harness +1",
  72.                             ring1="Dark Ring",
  73.                             ring2="Patricius Ring"})
  74.             sets.Idle.Movement.Cibitshavore = set_combine(sets.Idle.Movement,{
  75.                                     main="Tsurumaru",
  76.                             sub="Pole Grip",
  77.                             range="Cibitshavore",
  78.                             ammo="Tulfaire Arrow"})
  79.             sets.Idle.Movement.Tsurumaru = set_combine(sets.Idle.Movement,{
  80.                             main="Tsurumaru",
  81.                             sub="Pole Grip",
  82.                             range="Yoichinoyumi",
  83.                             ammo="Tulfaire Arrow"})
  84.             sets.Idle.Movement.Amanomurakumo = set_combine(sets.Idle.Movement,{
  85.                             main="Amanomurakumo",
  86.                             sub="Pole Grip",
  87.                             range="Cibitshavore",
  88.                             ammo="Tulfaire Arrow"})
  89.             sets.Idle.Movement.Yoichinoyumi = set_combine(sets.Idle.Movement,{
  90.                             main="Amanomurakumo",
  91.                             sub="Pole Grip",
  92.                             range="Yoichinoyumi",
  93.                             ammo="Tulfaire Arrow"})
  94.             sets.Idle.Movement.Lentus = set_combine(sets.Idle.Movement,{})
  95.      
  96.             sets.Twilight = {head="Twilight Helm",body="Twilight Mail"}
  97.      
  98.             -- Preshot Set --
  99.             sets.Preshot = {}
  100.      
  101.             -- Midshot Sets --
  102.             sets.Midshot = {}
  103.             sets.Midshot.MidACC = set_combine(sets.Midshot,{})
  104.             sets.Midshot.HighACC = set_combine(sets.Midshot.MidACC,{})
  105.      
  106.             -- TP Base Set --
  107.             sets.TP = {}
  108.      
  109.             -- Tsurumaru TP Sets --
  110.             sets.TP.Tsurumaru = {
  111.                             main="Tsurumaru",
  112.                             sub="Pole Grip",
  113.                             range="Yoichinoyumi",
  114.                             ammo="Tulfaire Arrow",
  115.                             head="Otomi Helm",
  116.                             neck="Ganesha's Mala",
  117.                             ear1="Trux Earring",
  118.                             ear2="Brutal Earring",
  119.                             body="Wakido Domaru +1",
  120.                             hands="Wakido Kote +1",
  121.                             ring1="K'ayres Ring",
  122.                             ring2="Rajas Ring",
  123.                             back="Atheling Mantle",
  124.                             waist="Windbuffet Belt",
  125.                             legs="Otronif Brais +1",
  126.                             feet="Otronif Boots +1"}
  127.             sets.TP.Tsurumaru.MidACC = set_combine(sets.TP.Tsurumaru,{
  128.                             head="Gavialis Helm",
  129.                             ear1="Steelflash Earring",
  130.                             ear2="Bladeborn Earring",
  131.                             back="Takaha Mantle",
  132.                             waist="Phasmida Belt"})
  133.             sets.TP.Tsurumaru.HighACC = set_combine(sets.TP.Tsurumaru.MidACC,{
  134.                             neck="Iqabi Necklace",
  135.                             body="Wakido Domaru +1",
  136.                                                     legs="Miki. Cuisses",
  137.                             ring1="Patricius Ring",
  138.                                                     ring2="Enlivened Ring",
  139.                             feet="Waki. Sune-Ate +1"})
  140.      
  141.             -- Tsurumaru(Ionis) TP Sets --
  142.             sets.TP.Tsurumaru.Ionis = set_combine(sets.TP.Tsurumaru,{
  143.                             ear1="Tripudio Earring",
  144.                             back="Takaha Mantle"})
  145.             sets.TP.Tsurumaru.MidACC.Ionis = set_combine(sets.TP.Tsurumaru.Ionis,{
  146.                             head="Gavialis Helm",
  147.                             ear1="Steelflash Earring",
  148.                             ear2="Bladeborn Earring",
  149.                             back="Takaha Mantle",
  150.                             waist="Phasmida Belt"})
  151.             sets.TP.Tsurumaru.HighACC.Ionis = set_combine(sets.TP.Tsurumaru.MidACC.Ionis,{
  152.                             neck="Iqabi Necklace",
  153.                             body="Wakido Domaru +1",
  154.                                                     legs="Miki. Cuisses",
  155.                             ring1="Patricius Ring",
  156.                                                     ring2="Enlivened Ring",
  157.                             feet="Waki. Sune-Ate +1"})
  158.      
  159.             -- Tsurumaru(SAM Roll) TP Sets --
  160.             sets.TP.Tsurumaru.STP = set_combine(sets.TP.Tsurumaru,{})
  161.             sets.TP.Tsurumaru.MidACC.STP = set_combine(sets.TP.Tsurumaru.MidACC,{})
  162.             sets.TP.Tsurumaru.HighACC.STP = set_combine(sets.TP.Tsurumaru.HighACC,{})
  163.      
  164.             -- Tsurumaru(Ionis + SAM Roll) TP Sets --
  165.             sets.TP.Tsurumaru.Ionis.STP = set_combine(sets.TP.Tsurumaru.Ionis,{
  166.                             ear1="Trux Earring",
  167.                             ear2="Brutal Earring"})
  168.             sets.TP.Tsurumaru.MidACC.Ionis.STP = set_combine(sets.TP.Tsurumaru.Ionis.STP,{
  169.                             head="Gavialis Helm",
  170.                             neck="Iqabi Necklace",
  171.                             ear1="Steelflash Earring",
  172.                             ear2="Bladeborn Earring",
  173.                             ring1="Patricius Ring",
  174.                             back="Takaha Mantle",
  175.                             waist="Phasmida Belt"})
  176.             sets.TP.Tsurumaru.HighACC.Ionis.STP = set_combine(sets.TP.Tsurumaru.MidACC.Ionis.STP,{
  177.                             neck="Iqabi Necklace",
  178.                             body="Wakido Domaru +1",
  179.                                                     legs="Miki. Cuisses",
  180.                             ring1="Patricius Ring",
  181.                                                     ring2="Enlivened Ring",
  182.                             feet="Waki. Sune-Ate +1"})
  183.      
  184.             -- Amanomurakumo(AM Down) TP Sets --
  185.             sets.TP.Amanomurakumo = {
  186.                             main="Amanomurakumo",
  187.                             sub="Pole Grip",
  188.                             range="Cibitshavore",
  189.                             ammo="Tulfaire Arrow",
  190.                             head="Otomi Helm",
  191.                             neck="Ganesha's Mala",
  192.                             ear1="Trux Earring",
  193.                             ear2="Brutal Earring",
  194.                             body="Wakido Domaru +1",
  195.                             hands="Wakido Kote +1",
  196.                             ring1="K'ayres Ring",
  197.                             ring2="Rajas Ring",
  198.                             back="Atheling Mantle",
  199.                             waist="Windbuffet Belt",
  200.                             legs="Otronif Brais +1",
  201.                             feet="Otronif Boots +1"}
  202.             sets.TP.Amanomurakumo.MidACC = set_combine(sets.TP.Amanomurakumo,{
  203.                             head="Gavialis Helm",
  204.                             ear1="Steelflash Earring",
  205.                             ear2="Bladeborn Earring",
  206.                             back="Takaha Mantle",
  207.                             waist="Phasmida Belt"})
  208.             sets.TP.Amanomurakumo.HighACC = set_combine(sets.TP.Amanomurakumo.MidACC,{
  209.                             neck="Iqabi Necklace",
  210.                             body="Wakido Domaru +1",
  211.                                                     legs="Miki. Cuisses",
  212.                             ring1="Patricius Ring",
  213.                                                     ring2="Enlivened Ring",
  214.                             feet="Waki. Sune-Ate +1"})
  215.      
  216.             -- Amanomurakumo(AM Up) TP Sets --
  217.             sets.TP.Amanomurakumo.AM = set_combine(sets.TP.Amanomurakumo,{})
  218.             sets.TP.Amanomurakumo.MidACC.AM = set_combine(sets.TP.Amanomurakumo.AM,{})
  219.             sets.TP.Amanomurakumo.HighACC.AM = set_combine(sets.TP.Amanomurakumo.MidACC.AM,{})
  220.      
  221.             -- Amanomurakumo(AM Down: Ionis) TP Sets --
  222.             sets.TP.Amanomurakumo.Ionis =  set_combine(sets.TP.Amanomurakumo,{
  223.                             head="Otomi Helm",
  224.                             neck="Ganesha's Mala",
  225.                             ear1="Trux Earring",
  226.                             ear2="Brutal Earring",
  227.                             body="Wakido Domaru +1",
  228.                             hands="Wakido Kote +1",
  229.                             ring1="K'ayres Ring",
  230.                             ring2="Rajas Ring",
  231.                             back="Atheling Mantle",
  232.                             waist="Windbuffet Belt",
  233.                             legs="Otronif Brais +1",
  234.                             feet="Otronif Boots +1"})
  235.             sets.TP.Amanomurakumo.MidACC.Ionis = set_combine(sets.TP.Amanomurakumo.Ionis,{
  236.                                     head="Gavialis Helm",
  237.                             ear1="Steelflash Earring",
  238.                             ear2="Bladeborn Earring",
  239.                             back="Takaha Mantle",
  240.                             waist="Phasmida Belt"})
  241.             sets.TP.Amanomurakumo.HighACC.Ionis = set_combine(sets.TP.Amanomurakumo.MidACC.Ionis,{
  242.                                     neck="Iqabi Necklace",
  243.                             body="Wakido Domaru +1",
  244.                                                     legs="Miki. Cuisses",
  245.                             ring1="Patricius Ring",
  246.                                                     ring2="Enlivened Ring",
  247.                             feet="Waki. Sune-Ate +1"})
  248.      
  249.      
  250.             -- Yoichinoyumi TP Sets --
  251.             sets.TP.Yoichinoyumi = {
  252.                             main="Amanomurakumo",
  253.                             sub="Pole Grip",
  254.                             range="Yoichinoyumi",
  255.                             ammo="Tulfaire Arrow",
  256.                             head="Otomi Helm",
  257.                             neck="Ganesha's Mala",
  258.                             ear1="Trux Earring",
  259.                             ear2="Brutal Earring",
  260.                             body="Sakonji Domaru +1",
  261.                             hands="Wakido Kote +1",
  262.                             ring1="K'ayres Ring",
  263.                             ring2="Rajas Ring",
  264.                             back="Misuuchi Kappa",
  265.                             waist="Windbuffet Belt",
  266.                             legs="Otronif Brais +1",
  267.                             feet="Otronif Boots +1"}
  268.             sets.TP.Yoichinoyumi.MidACC = set_combine(sets.TP.Yoichinoyumi,{
  269.                             head="Gavialis Helm",
  270.                             ear1="Steelflash Earring",
  271.                             ear2="Bladeborn Earring",
  272.                             back="Takaha Mantle",
  273.                             waist="Phasmida Belt"})
  274.             sets.TP.Yoichinoyumi.HighACC = set_combine(sets.TP.Yoichinoyumi.MidACC,{
  275.                             neck="Iqabi Necklace",
  276.                             body="Wakido Domaru +1",
  277.                                                     legs="Miki. Cuisses",
  278.                             ring1="Patricius Ring",
  279.                                                     ring2="Enlivened Ring",
  280.                             feet="Waki. Sune-Ate +1"})
  281.      
  282.             -- Yoichinoyumi(Ionis) TP Sets --
  283.             sets.TP.Yoichinoyumi.Ionis = set_combine(sets.TP.Yoichinoyumi,{
  284.                                     head="Otomi Helm",
  285.                             neck="Ganesha's Mala",
  286.                             ear1="Trux Earring",
  287.                             ear2="Brutal Earring",
  288.                             body="Sakonji Domaru +1",
  289.                             hands="Wakido Kote +1",
  290.                             ring1="K'ayres Ring",
  291.                             ring2="Rajas Ring",
  292.                             back="Misuuchi Kappa",
  293.                             waist="Windbuffet Belt",
  294.                             legs="Otronif Brais +1",
  295.                             feet="Otronif Boots +1"})
  296.             sets.TP.Yoichinoyumi.MidACC.Ionis = set_combine(sets.TP.Yoichinoyumi.Ionis,{
  297.                                     head="Gavialis Helm",
  298.                             ear1="Steelflash Earring",
  299.                             ear2="Bladeborn Earring",
  300.                             back="Takaha Mantle",
  301.                             waist="Phasmida Belt"})
  302.             sets.TP.Yoichinoyumi.HighACC.Ionis = set_combine(sets.TP.Yoichinoyumi.MidACC.Ionis,{
  303.                                     neck="Iqabi Necklace",
  304.                             body="Wakido Domaru +1",
  305.                                                     legs="Miki. Cuisses",
  306.                             ring1="Patricius Ring",
  307.                                                     ring2="Enlivened Ring",
  308.                             feet="Waki. Sune-Ate +1"})
  309.                                                    
  310.                     -- Cibitshavore TP Sets --
  311.             sets.TP.Cibitshavore = {
  312.                             main="Tsurumaru",
  313.                             sub="Pole Grip",
  314.                             range="Cibitshavore",
  315.                             ammo="Tulfaire Arrow",
  316.                             head="Otomi Helm",
  317.                             neck="Ganesha's Mala",
  318.                             ear1="Trux Earring",
  319.                             ear2="Brutal Earring",
  320.                             body="Sakonji Domaru +1",
  321.                             hands="Wakido Kote +1",
  322.                             ring1="K'ayres Ring",
  323.                             ring2="Rajas Ring",
  324.                             back="Misuuchi Kappa",
  325.                             waist="Windbuffet Belt",
  326.                             legs="Otronif Brais +1",
  327.                             feet="Otronif Boots +1"}
  328.             sets.TP.Cibitshavore.MidACC = set_combine(sets.TP.Cibitshavore,{
  329.                             head="Gavialis Helm",
  330.                             ear1="Steelflash Earring",
  331.                             ear2="Bladeborn Earring",
  332.                             back="Takaha Mantle",
  333.                             waist="Phasmida Belt"})
  334.             sets.TP.Cibitshavore.HighACC = set_combine(sets.TP.Cibitshavore.MidACC,{
  335.                             neck="Iqabi Necklace",
  336.                             body="Wakido Domaru +1",
  337.                                                     legs="Miki. Cuisses",
  338.                             ring1="Patricius Ring",
  339.                                                     ring2="Enlivened Ring",
  340.                             feet="Waki. Sune-Ate +1"})
  341.      
  342.             -- Cibitshavore(Ionis) TP Sets --
  343.             sets.TP.Cibitshavore.Ionis = set_combine(sets.TP.Cibitshavore,{
  344.                                     head="Otomi Helm",
  345.                             neck="Ganesha's Mala",
  346.                             ear1="Trux Earring",
  347.                             ear2="Brutal Earring",
  348.                             body="Sakonji Domaru +1",
  349.                             hands="Wakido Kote +1",
  350.                             ring1="K'ayres Ring",
  351.                             ring2="Rajas Ring",
  352.                             back="Misuuchi Kappa",
  353.                             waist="Windbuffet Belt",
  354.                             legs="Otronif Brais +1",
  355.                             feet="Otronif Boots +1"})
  356.             sets.TP.Cibitshavore.MidACC.Ionis = set_combine(sets.TP.Cibitshavore.Ionis,{
  357.                                     head="Gavialis Helm",
  358.                             ear1="Steelflash Earring",
  359.                             ear2="Bladeborn Earring",
  360.                             back="Takaha Mantle",
  361.                             waist="Phasmida Belt"})
  362.             sets.TP.Cibitshavore.HighACC.Ionis = set_combine(sets.TP.Cibitshavore.MidACC.Ionis,{
  363.                                     neck="Iqabi Necklace",
  364.                             body="Wakido Domaru +1",
  365.                                                     legs="Miki. Cuisses",
  366.                             ring1="Patricius Ring",
  367.                                                     ring2="Enlivened Ring",
  368.                                                     waist="Anguinus Belt",
  369.                             feet="Waki. Sune-Ate +1"})
  370.      
  371.             -- Seigan TP Set --
  372.             sets.TP.Seigan = {head=""}
  373.      
  374.             -- Third Eye TP Set --
  375.             sets.TP['Third Eye'] = {legs="Sakonji Haidate"}
  376.                    
  377.                     -- Meikyo Shisui TP Set --
  378.             sets.TP['Meikyo Shisui'] = {feet="Sak. Sune-ate +1"}
  379.      
  380.             -- PDT/MDT Sets --
  381.             sets.PDT = {
  382.                             head="Lithelimb Cap",
  383.                             neck="Twilight Torque",
  384.                             ear1="Colossus's Earring",
  385.                             ear2="Sanare Earring",
  386.                             body="Otro. Harness +1",
  387.                             hands="Otronif Gloves +1",
  388.                             ring1="Dark Ring",
  389.                             ring2="Dark Ring",
  390.                             back="Repulse Mantle",
  391.                             waist="Phasmida Belt",
  392.                             legs="Otronif Brais +1",
  393.                             feet="Otronif Boots +1"}
  394.      
  395.             sets.MDT = set_combine(sets.PDT,{
  396.                                     back="Mecisto. Mantle",})
  397.      
  398.             -- Hybrid Sets --
  399.             sets.TP.Hybrid = set_combine(sets.PDT,{
  400.                             ear1="Steelflash Earring",
  401.                             ear2="Bladeborn Earring",
  402.                             hands="Sakonji Kote +1",
  403.                             ring1="Patricius Ring",
  404.                             back="Repulse Mantle"})
  405.             sets.TP.Hybrid.MidACC = set_combine(sets.TP.Hybrid,{
  406.                             head="Yaoyotl Helm",
  407.                             ear1="Steelflash Earring",
  408.                             ear2="Bladeborn Earring",
  409.                             body="Wakido Domaru +1",
  410.                             hands="Wakido Kote +1"})
  411.             sets.TP.Hybrid.HighACC = set_combine(sets.TP.Hybrid.MidACC,{
  412.                             body="Wakido Domaru +1",
  413.                             waist="Phasmida Belt",
  414.                             legs="Miki. Cuisses"})
  415.      
  416.             -- WS Base Set --
  417.             sets.WS = {
  418.                             head="Otomi Helm",
  419.                             neck="Ganesha's Mala",
  420.                             ear1="Steelflash Earring",
  421.                             ear2="Bladeborn Earring",
  422.                             body="Phorcys Korazin",
  423.                             hands="Miki. Gauntlets",
  424.                             ring1="Strigoi Ring",
  425.                             ring2="Candent Ring",
  426.                             back="Buquwik Cape",
  427.                             waist="Metalsinger Belt",
  428.                             legs="Scuff. Cosciales",
  429.                             feet="Sak. Sune-Ate +1"}
  430.                    
  431.             -- Tachi: Fudo Sets --
  432.             sets.WS["Tachi: Fudo"] = {
  433.                             head="Otomi Helm",
  434.                             neck="Snow Gorget",
  435.                             ear1="Moonshade Earring",
  436.                             ear2="Brutal Earring",
  437.                             body="Phorcys Korazin",
  438.                             hands="Miki. Gauntlets",
  439.                             ring1="Strigoi Ring",
  440.                             ring2="Candent Ring",
  441.                             back="Buquwik Cape",
  442.                             waist="Metalsinger Belt",
  443.                             legs="Scuff. Cosciales",
  444.                             feet="Sak. Sune-Ate +1"}
  445.             sets.WS["Tachi: Fudo"].MidACC = set_combine(sets.WS["Tachi: Fudo"],{
  446.                             hands="Buremte Gloves"})
  447.             sets.WS["Tachi: Fudo"].HighACC = set_combine(sets.WS["Tachi: Fudo"].MidACC,{
  448.                             hands="Buremte Gloves"})
  449.      
  450.             -- Tachi: Fudo(4 Hits) Set --
  451.             sets.WS["Tachi: Fudo"].Lentus = set_combine(sets.WS["Tachi: Fudo"],{
  452.                             ring2="Rajas Ring"})
  453.      
  454.             -- Tachi: Fudo(SAM Roll) Sets --
  455.             sets.WS["Tachi: Fudo"].STP = set_combine(sets.WS["Tachi: Fudo"],{})
  456.             sets.WS["Tachi: Fudo"].MidACC.STP = set_combine(sets.WS["Tachi: Fudo"].MidACC,{})
  457.             sets.WS["Tachi: Fudo"].HighACC.STP = set_combine(sets.WS["Tachi: Fudo"].HighACC,{})
  458.      
  459.             -- Tachi: Fudo(Attack) Set --
  460.             sets.WS["Tachi: Fudo"].ATT = set_combine(sets.WS["Tachi: Fudo"],{
  461.                             head="Yaoyotl Helm",
  462.                             hands="Miki. Gauntlets"})
  463.      
  464.             -- Tachi: Shoha Sets --
  465.             sets.WS["Tachi: Shoha"] = {
  466.                             head="Otomi Helm",
  467.                             neck="Ganesha's Mala",
  468.                             ear1="Moonshade Earring",
  469.                             ear2="Brutal Earring",
  470.                             body="Phorcys Korazin",
  471.                             hands="Miki. Gauntlets",
  472.                             ring1="Strigoi Ring",
  473.                             ring2="Candent Ring",
  474.                             back="Buquwik Cape",
  475.                             waist="Windbuffet Belt",
  476.                             legs="Scuff. Cosciales",
  477.                             feet="Ejekamal Boots"}
  478.             sets.WS["Tachi: Shoha"].MidACC = set_combine(sets.WS["Tachi: Shoha"],{
  479.                             hands="Buremte Gloves"})
  480.             sets.WS["Tachi: Shoha"].HighACC = set_combine(sets.WS["Tachi: Shoha"].MidACC,{
  481.                             hands="Buremte Gloves"})
  482.      
  483.             -- Tachi: Shoha(4 Hits) Set --
  484.             sets.WS["Tachi: Shoha"].Lentus = set_combine(sets.WS["Tachi: Shoha"],{})
  485.      
  486.             -- Tachi: Shoha(SAM Roll) Sets --
  487.             sets.WS["Tachi: Shoha"].STP = set_combine(sets.WS["Tachi: Shoha"],{})
  488.             sets.WS["Tachi: Shoha"].MidACC.STP = set_combine(sets.WS["Tachi: Shoha"].MidACC,{})
  489.             sets.WS["Tachi: Shoha"].HighACC.STP = set_combine(sets.WS["Tachi: Shoha"].HighACC,{})
  490.      
  491.             -- Tachi: Kaiten Sets --
  492.             sets.WS["Tachi: Kaiten"] = {
  493.                             head="Otomi Helm",
  494.                             neck="Light Gorget",
  495.                             ear1="Trux Earring",
  496.                             ear2="Brutal Earring",
  497.                             body="Phorcys Korazin",
  498.                             hands="Miki. Gauntlets",
  499.                             ring1="Strigoi Ring",
  500.                             ring2="Candent Ring",
  501.                             back="Buquwik Cape",
  502.                             waist="Metalsinger Belt",
  503.                             legs="Scuff. Cosciales",
  504.                             feet="Sak. Sune-Ate +1"}
  505.             sets.WS["Tachi: Kaiten"].MidACC = set_combine(sets.WS["Tachi: Kaiten"],{
  506.                             hands="Buremte Gloves",
  507.                                                     ear1="Steelflash Earring",
  508.                             ear2="Bladeborn Earring"})
  509.             sets.WS["Tachi: Kaiten"].HighACC = set_combine(sets.WS["Tachi: Kaiten"].MidACC,{
  510.                             hands="Buremte Gloves",
  511.                                                     ear1="Steelflash Earring",
  512.                             ear2="Bladeborn Earring"})
  513.                                                    
  514.             -- Tachi: Kaiten(Lentus) Set --
  515.             sets.WS["Tachi: Kaiten"].Lentus = set_combine(sets.WS["Tachi: Kaiten"],{})
  516.      
  517.             -- Tachi: Kaiten(SAM Roll) Sets --
  518.             sets.WS["Tachi: Kaiten"].STP = set_combine(sets.WS["Tachi: Kaiten"],{})
  519.             sets.WS["Tachi: Kaiten"].MidACC.STP = set_combine(sets.WS["Tachi: Kaiten"].MidACC,{})
  520.             sets.WS["Tachi: Kaiten"].HighACC.STP = set_combine(sets.WS["Tachi: Kaiten"].HighACC,{})
  521.      
  522.             -- Tachi: Kaiten(Attack) Set --
  523.             sets.WS["Tachi: Kaiten"].ATT = set_combine(sets.WS["Tachi: Kaiten"],{
  524.                             head="Otomi Helm",
  525.                             hands="Miki. Gauntlets"})
  526.      
  527.             -- Tachi: Rana Sets --
  528.             sets.WS["Tachi: Rana"] = {
  529.                             head="Otomi Helm",
  530.                             neck="Snow Gorget",
  531.                             ear1="Vulcan's Pearl",
  532.                             ear2="Brutal Earring",
  533.                             body="Mes. Haubergeon",
  534.                             hands="Boor Bracelets",
  535.                             ring1="Pyrosoul Ring",
  536.                             ring2="Pyrosoul Ring",
  537.                             back="Buquwik Cape",
  538.                             waist="Snow Belt",
  539.                             legs="Scuff. Cosciales",
  540.                             feet="Sak. Sune-Ate +1"}
  541.             sets.WS["Tachi: Rana"].MidACC = set_combine(sets.WS["Tachi: Rana"],{
  542.                             head="Yaoyotl Helm",
  543.                             hands="Miki. Gauntlets",
  544.                             legs="Scuff. Cosciales",
  545.                             feet="Waki. Sune-Ate +1"})
  546.             sets.WS["Tachi: Rana"].HighACC = set_combine(sets.WS["Tachi: Rana"].MidACC,{
  547.                             back="Takaha Mantle",
  548.                             legs="Scuff. Cosciales"})
  549.      
  550.             -- Tachi: Rana(4 Hits) Set --
  551.             sets.WS["Tachi: Rana"].Lentus = set_combine(sets.WS["Tachi: Rana"],{})
  552.      
  553.             -- Tachi: Rana(SAM Roll) Sets --
  554.             sets.WS["Tachi: Rana"].STP = set_combine(sets.WS["Tachi: Rana"],{})
  555.             sets.WS["Tachi: Rana"].MidACC.STP = set_combine(sets.WS["Tachi: Rana"].MidACC,{})
  556.             sets.WS["Tachi: Rana"].HighACC.STP = set_combine(sets.WS["Tachi: Rana"].HighACC,{})
  557.      
  558.             -- Namas Arrow Sets --
  559.             sets.WS["Namas Arrow"] = {
  560.                             ammo="Tulfaire Arrow",
  561.                             head="Lithelimb Cap",
  562.                             neck="Light Gorget",
  563.                             ear1="Wilhelm's Earring",
  564.                             ear2="Altdorf's Earring",
  565.                             body="Phorcys Korazin",
  566.                             hands="Unkai Kote +2",
  567.                             ring1="Strigoi Ring",
  568.                             ring2="Rajas Ring",
  569.                             back="Buquwik Cape",
  570.                             waist="Metalsinger Belt",
  571.                             legs="Wakido Haidate +1",
  572.                             feet="Waki. Sune-Ate +1"}
  573.             sets.WS["Namas Arrow"].MidACC = set_combine(sets.WS["Namas Arrow"] {
  574.                                                     body="Kyujutsugi"})
  575.             sets.WS["Namas Arrow"].HighACC = set_combine(sets.WS["Namas Arrow"].MidACC,{
  576.                                     ring2="Longshot Ring",
  577.                                                     ring1="Paqichikaji Ring",
  578.                                                     hands="Buremte Gloves",
  579.                                                     body="Kyujutsugi"})
  580.      
  581.             -- Apex Arrow Sets --
  582.             sets.WS["Apex Arrow"] = {}
  583.             sets.WS["Apex Arrow"].MidACC = set_combine(sets.WS["Apex Arrow"],{})
  584.             sets.WS["Apex Arrow"].HighACC = set_combine(sets.WS["Apex Arrow"].MidACC,{})
  585.      
  586.             -- JA Sets --
  587.             sets.JA['Sengikori'] = {feet="Unkai Sune-Ate +2"}
  588.             sets.JA['Sekkanoki'] = {hands="Unkai Kote +2"}
  589.             sets.JA["Meditate"] = {head="Wakido Kabuto +1",hands="Sakonji Kote"}
  590.             sets.JA["Warding Circle"] = {head="Wakido Kabuto +1"}
  591.             sets.JA['Meikyo Shisui'] = {feet="Sak. sune-ate +1"}
  592.      
  593.             -- Waltz Set --
  594.             sets.Waltz = {}
  595.      
  596.             sets.Precast = {}
  597.             -- Capacity Set --
  598.                     sets.CapacityMantle = {back="Mecistopins Mantle"}
  599.                    
  600.                     -- WSDayBonus Set--
  601.             sets.WSDayBonus = {head="Gavialis Helm"}
  602.      
  603.             sets.Midcast = {}
  604.             -- Magic Haste Set --
  605.             sets.Midcast.Haste = set_combine(sets.PDT,{})
  606.     end
  607.      
  608.     function pretarget(spell,action)
  609.             if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  610.                     cancel_spell()
  611.                     send_command('input /item "Echo Drops" <me>')
  612.             elseif spell.english == "Berserk" and buffactive.Berserk then -- Change Berserk To Aggressor If Berserk Is On --
  613.                     cancel_spell()
  614.                     send_command('Aggressor')
  615.             elseif spell.english == "Seigan" and buffactive.Seigan then -- Change Seigan To Third Eye If Seigan Is On --
  616.                     cancel_spell()
  617.                     send_command('ThirdEye')
  618.             elseif spell.english == "Meditate" and player.tp > 2900 then -- Cancel Meditate If TP Is Above 2900 --
  619.                     cancel_spell()
  620.                     add_to_chat(123, spell.name .. ' Canceled: ['..player.tp..' TP]')
  621.             elseif spell.action_type == 'Ranged Attack' and spell.target.distance > 24.9 then
  622.                     cancel_spell()
  623.                     add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  624.                     return
  625.             elseif spell.type == 'WeaponSkill' and player.status == 'Engaged' then
  626.                     if spell.skill == 'Archery' then
  627.                             if spell.target.distance > 20+target_distance then
  628.                                     cancel_spell()
  629.                                     add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  630.                                     return
  631.                             end
  632.                     else
  633.                             if spell.target.distance > target_distance then
  634.                                     cancel_spell()
  635.                                     add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  636.                                     return
  637.                             end
  638.                     end
  639.             end
  640.     end
  641.      
  642.     function precast(spell,action)
  643.             local check_ammo
  644.             local check_ammo_count = 1
  645.             if spell.action_type == 'Ranged Attack' then
  646.                     check_ammo = player.equipment.ammo
  647.                     if player.equipment.ammo == 'empty' or player.inventory[check_ammo].count <= check_ammo_count then
  648.                             add_to_chat(123, spell.name..' Canceled: [Out of Ammo]')
  649.                             cancel_spell()
  650.                             return
  651.                     else
  652.                             equip(sets.Preshot)
  653.                             if player.inventory[check_ammo].count <= ammo_warning_limit and player.inventory[check_ammo].count > 1 and not warning then
  654.                                     add_to_chat(8, '***** [Low Ammo Warning!] *****')
  655.                                     warning = true
  656.                             elseif player.inventory[check_ammo].count > ammo_warning_limit and warning then
  657.                                     warning = false
  658.                             end
  659.                     end
  660.             elseif spell.type == "WeaponSkill" then
  661.                     if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  662.                             cancel_spell()
  663.                             add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  664.                             return
  665.                     else
  666.                             equipSet = sets.WS
  667.                             if equipSet[spell.english] then
  668.                                     equipSet = equipSet[spell.english]
  669.                             end
  670.                                                     if state.CapacityMode.value then
  671.                                     equip(sets.CapacityMantle)
  672.                             end
  673.                             if Attack == 'ON' then
  674.                                     equipSet = equipSet["ATT"]
  675.                             end
  676.                             if equipSet[AccArray[AccIndex]] then
  677.                                     equipSet = equipSet[AccArray[AccIndex]]
  678.                             end
  679.                             if buffactive["Samurai Roll"] and equipSet["STP"] and Samurai_Roll == 'ON' then
  680.                                     equipSet = equipSet["STP"]
  681.                             end
  682.                             if buffactive.Sekkanoki then -- Equip Unkai Kote +2 When Sekkanoki Is On --
  683.                                     equipSet = set_combine(equipSet,{hands="Unkai Kote +2"})
  684.                             end
  685.                                                     if buffactive['Meikyo Shisui'] then -- Equip Sak. sune-ate +1 When Meikyo Shisui Is On --
  686.                                     equipSet = set_combine(equipSet,{feet="Sak. Sune-ate +1"})
  687.                             end
  688.                             if buffactive.Sengikori then -- Equip Unkai Sune-ate +2 When Sengikori Is On --
  689.                                     equipSet = set_combine(equipSet,{feet="Unkai Sune-ate +2"})
  690.                             end
  691.                             if (spell.english == "Tachi: Fudo" or spell.english == "Tachi: Shoha") and (player.tp > 2999 or buffactive.Sekkanoki or (player.tp > 1999 and buffactive.Hagakure)) then -- Equip When You Have 300 TP or Sekkanoki On or 200+ TP For Hagakure --
  692.                                     equipSet = set_combine(equipSet,{ear1=""})
  693.                             end
  694.                             equip(equipSet)
  695.                            
  696.                             if spell.type == 'WeaponSkill' then
  697.                                 if is_sc_element_today(spell) then
  698.                                         equip(sets.WSDayBonus)
  699.                                 end
  700.                             end
  701.                     end
  702.             elseif spell.type == "JobAbility" then
  703.                     if sets.JA[spell.english] then
  704.                             equip(sets.JA[spell.english])
  705.                     end
  706.             elseif spell.action_type == 'Magic' then
  707.                     if string.find(spell.english,'Utsusemi') then
  708.                             if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  709.                                     cancel_spell()
  710.                                     add_to_chat(123, spell.name .. ' Canceled: [3+ Images]')
  711.                                     return
  712.                             else
  713.                                     equip(sets.Precast.FastCast)
  714.                             end
  715.                     else
  716.                             equip(sets.Precast.FastCast)
  717.                     end
  718.             elseif spell.type == "Waltz" then
  719.                     refine_waltz(spell,action)
  720.                     equip(sets.Waltz)
  721.             elseif spell.name == 'Spectral Jig' and buffactive.sneak then
  722.                 -- If sneak is active when using, cancel before completion
  723.                 send_command('cancel 71')
  724.             end
  725.             if Twilight == 'Twilight' then
  726.                     equip(sets.Twilight)
  727.             end
  728.     end
  729.      
  730.     function midcast(spell,action)
  731.             if spell.action_type == 'Ranged Attack' then
  732.                     equipSet = sets.Midshot
  733.                     if equipSet[AccArray[AccIndex]] then
  734.                             equipSet = equipSet[AccArray[AccIndex]]
  735.                     end
  736.                     equip(equipSet)
  737.             elseif spell.action_type == 'Magic' then
  738.                     if string.find(spell.english,'Utsusemi') then
  739.                             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  740.                                     send_command('@wait 1.7;cancel Copy Image*')
  741.                             end
  742.                             equip(sets.Midcast.Haste)
  743.                     elseif spell.english == 'Monomi: Ichi' then
  744.                             if buffactive['Sneak'] then
  745.                                     send_command('@wait 1.7;cancel sneak')
  746.                             end
  747.                             equip(sets.Midcast.Haste)
  748.                     else
  749.                             equip(sets.Midcast.Haste)
  750.                     end
  751.             end
  752.     end
  753.      
  754.     function aftercast(spell,action)
  755.             if not spell.interrupted then
  756.                     if spell.type == "WeaponSkill" then
  757.                             send_command('wait 0.2;gs c TP')
  758.                     elseif spell.english == "Warding Circle" then -- Warding Circle Countdown --
  759.                             send_command('wait 260;input /echo '..spell.name..': [WEARING OFF IN 10 SEC.];wait 10;input /echo '..spell.name..': [OFF]')
  760.                     end
  761.             end
  762.             status_change(player.status)
  763.     end
  764.      
  765.     function is_sc_element_today(spell)
  766.         if spell.type ~= 'WeaponSkill' then
  767.             return
  768.         end
  769.        
  770.         local weaponskill_elements = S{}:
  771.             union(skillchain_elements[spell.skillchain_a]):
  772.             union(skillchain_elements[spell.skillchain_b]):
  773.             union(skillchain_elements[spell.skillchain_c])
  774.      
  775.         if weaponskill_elements:contains(world.day_element) then
  776.             return true
  777.         else
  778.             return false
  779.         end
  780.     end
  781.      
  782.     function status_change(new,old)
  783.             if Armor == 'PDT' then
  784.                     equip(sets.PDT)
  785.             elseif Armor == 'MDT' then
  786.                     equip(sets.MDT)
  787.             elseif new == 'Engaged' then
  788.                     equipSet = sets.TP
  789.                     if Armor == 'Hybrid' and equipSet["Hybrid"] then
  790.                             equipSet = equipSet["Hybrid"]
  791.                     end
  792.                                     if state.CapacityMode.value then
  793.                             meleeSet = set_combine(meleeSet, sets.CapacityMantle)
  794.                     end
  795.                     if equipSet[WeaponArray[WeaponIndex]] then
  796.                             equipSet = equipSet[WeaponArray[WeaponIndex]]
  797.                     end
  798.                     if equipSet[AccArray[AccIndex]] then
  799.                             equipSet = equipSet[AccArray[AccIndex]]
  800.                     end
  801.                     if buffactive["Aftermath: Lv.3"] and equipSet["AM3"] then
  802.                             equipSet = equipSet["AM3"]
  803.                     end
  804.                     if buffactive.Ionis and equipSet["Ionis"] then
  805.                             equipSet = equipSet["Ionis"]
  806.                     end
  807.                     if buffactive["Samurai Roll"] and equipSet["STP"] and Samurai_Roll == 'ON' then
  808.                             equipSet = equipSet["STP"]
  809.                     end
  810.                     if buffactive.Seigan and Seigan == 'ON' then -- Use Seigan Toggle For Seigan TP Set --
  811.                             equipSet = set_combine(equipSet,sets.TP.Seigan)
  812.                     end
  813.                     if buffactive["Third Eye"] and Third_Eye == 'ON' then -- Use Third Eye Toggle For Third Eye TP Set --
  814.                             equipSet = set_combine(equipSet,sets.TP["Third Eye"])
  815.                     end
  816.                     equip(equipSet)
  817.             else
  818.                     equipSet = sets.Idle
  819.                     if equipSet[IdleArray[IdleIndex]] then
  820.                             equipSet = equipSet[IdleArray[IdleIndex]]
  821.                     end
  822.                     if equipSet[WeaponArray[WeaponIndex]] then
  823.                             equipSet = equipSet[WeaponArray[WeaponIndex]]
  824.                     end
  825.                     equip(equipSet)
  826.             end
  827.             if Twilight == 'Twilight' then
  828.                     equip(sets.Twilight)
  829.             end
  830.     end
  831.      
  832.     function buff_change(buff,gain)
  833.             buff = string.lower(buff)
  834.             if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
  835.                     if gain then
  836.                             send_command('timers create "Aftermath: Lv.3" 180 down;wait 120;input /echo Aftermath: Lv.3 [WEARING OFF IN 60 SEC.];wait 30;input /echo Aftermath: Lv.3 [WEARING OFF IN 30 SEC.];wait 20;input /echo Aftermath: Lv.3 [WEARING OFF IN 10 SEC.]')
  837.                     else
  838.                             send_command('timers delete "Aftermath: Lv.3"')
  839.                             add_to_chat(123,'AM3: [OFF]')
  840.                     end
  841.             elseif buff == "perfect defense" then -- PD Timer --
  842.                     if gain then
  843.                             send_command('timers create "Perfect Defense" 57 down')
  844.                     else
  845.                             send_command('timers delete "Perfect Defense"')
  846.                             add_to_chat(123,'PD: [OFF]')
  847.                     end
  848.             elseif buff == "Yaegasumi" then -- Yaegasumi Timer --
  849.                     if gain then
  850.                             send_command('timers create "Yaegasumi" 45 down')
  851.                     else
  852.                             send_command('timers delete "Yaegasumi"')
  853.                             add_to_chat(123,'Yaegasumi: [OFF]')
  854.                     end
  855.             elseif buff == 'weakness' then -- Weakness Timer --
  856.                     if gain then
  857.                             send_command('timers create "Weakness" 300 up')
  858.                     else
  859.                             send_command('timers delete "Weakness"')
  860.                     end
  861.             end
  862.             if buff == "sleep" and gain and player.hp > 200 and player.status == "Engaged" then -- Equip Berserker's Torque When You Are Asleep & Have 200+ HP --
  863.                     equip({neck="Berserker's Torque"})
  864.             else
  865.                     if not midaction() then
  866.                             status_change(player.status)
  867.                     end
  868.             end
  869.     end
  870.      
  871.     -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  872.     function self_command(command)
  873.             if command == 'C1' then -- Accuracy Toggle --
  874.                     AccIndex = (AccIndex % #AccArray) + 1
  875.                     add_to_chat(158,'Accuracy Level: '..AccArray[AccIndex])
  876.                     status_change(player.status)
  877.             elseif command == 'C17' then -- Main Weapon Toggle --
  878.                     WeaponIndex = (WeaponIndex % #WeaponArray) + 1
  879.                     add_to_chat(158,'Main Weapon: '..WeaponArray[WeaponIndex])
  880.                     status_change(player.status)
  881.             elseif command == 'C5' then -- Auto Update Gear Toggle --
  882.                     status_change(player.status)
  883.                     add_to_chat(158,'Auto Update Gear')
  884.             elseif command == 'C2' then -- Hybrid Toggle --
  885.                     if Armor == 'Hybrid' then
  886.                             Armor = 'None'
  887.                             add_to_chat(123,'Hybrid Set: [Unlocked]')
  888.                     else
  889.                             Armor = 'Hybrid'
  890.                             add_to_chat(158,'Hybrid Set: '..AccArray[AccIndex])
  891.                     end
  892.                     status_change(player.status)
  893.             elseif command == 'C7' then -- PDT Toggle --
  894.                     if Armor == 'PDT' then
  895.                             Armor = 'None'
  896.                             add_to_chat(123,'PDT Set: [Unlocked]')
  897.                     else
  898.                             Armor = 'PDT'
  899.                             add_to_chat(158,'PDT Set: [Locked]')
  900.                     end
  901.                     status_change(player.status)
  902.             elseif command == 'C15' then -- MDT Toggle --
  903.                     if Armor == 'MDT' then
  904.                             Armor = 'None'
  905.                             add_to_chat(123,'MDT Set: [Unlocked]')
  906.                     else
  907.                             Armor = 'MDT'
  908.                             add_to_chat(158,'MDT Set: [Locked]')
  909.                     end
  910.                     status_change(player.status)
  911.             elseif command == 'C16' then -- Seigan Toggle --
  912.                     if Seigan == 'ON' then
  913.                             Seigan = 'OFF'
  914.                             add_to_chat(123,'Seigan Set: [Unlocked]')
  915.                     else
  916.                             Seigan = 'ON'
  917.                             add_to_chat(158,'Seigan Set: [Locked]')
  918.                     end
  919.                     status_change(player.status)
  920.             elseif command == 'C12' then -- Third Eye Toggle --
  921.                     if Third_Eye == 'ON' then
  922.                             Third_Eye = 'OFF'
  923.                             add_to_chat(123,'Third Eye Set: [Unlocked]')
  924.                     else
  925.                             Third_Eye = 'ON'
  926.                             add_to_chat(158,'Third Eye Set: [Locked]')
  927.                     end
  928.                     status_change(player.status)
  929.             elseif command == 'C11' then -- SAM Roll Toggle --
  930.                     if Samurai_Roll == 'ON' then
  931.                             Samurai_Roll = 'OFF'
  932.                             add_to_chat(123,'SAM Roll: [OFF]')
  933.                     else
  934.                             Samurai_Roll = 'ON'
  935.                             add_to_chat(158,'SAM Roll: [ON]')
  936.                     end
  937.                     status_change(player.status)
  938.             elseif command == 'C9' then -- Attack Toggle --
  939.                     if Attack == 'ON' then
  940.                             Attack = 'OFF'
  941.                             add_to_chat(123,'Attack: [OFF]')
  942.                     else
  943.                             Attack = 'ON'
  944.                             add_to_chat(158,'Attack: [ON]')
  945.                     end
  946.                     status_change(player.status)
  947.             elseif command == 'C3' then -- Twilight Toggle --
  948.                     if Twilight == 'Twilight' then
  949.                             Twilight = 'None'
  950.                             add_to_chat(123,'Twilight Set: [Unlocked]')
  951.                     else
  952.                             Twilight = 'Twilight'
  953.                             add_to_chat(158,'Twilight Set: [locked]')
  954.                     end
  955.                     status_change(player.status)
  956.             elseif command == 'C8' then -- Distance Toggle --
  957.                     if player.target.distance then
  958.                             target_distance = math.floor(player.target.distance*10)/10
  959.                             add_to_chat(158,'Distance: '..target_distance)
  960.                     else
  961.                             add_to_chat(123,'No Target Selected')
  962.                     end
  963.             elseif command == 'C10' then -- Cancel Meikyo Shisui --
  964.                     send_command('Cancel Meikyo Shisui')
  965.                     add_to_chat(123,'Meikyo Shisui: [OFF]')
  966.             elseif command == 'C6' then -- Idle Toggle --
  967.                     IdleIndex = (IdleIndex % #IdleArray) + 1
  968.                     add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  969.                     status_change(player.status)
  970.             elseif command == 'TP' then
  971.                     add_to_chat(158,'TP Return: ['..tostring(player.tp)..']')
  972.             elseif command:match('^SC%d$') then
  973.                     send_command('//'..sc_map[command])
  974.             end
  975.     end
  976.      
  977.     function refine_waltz(spell,action)
  978.             if spell.type ~= 'Waltz' then
  979.                     return
  980.             end
  981.      
  982.             if spell.name == "Healing Waltz" or spell.name == "Divine Waltz" then
  983.                     return
  984.             end
  985.      
  986.             local newWaltz = spell.english
  987.             local waltzID
  988.      
  989.             local missingHP
  990.      
  991.             if spell.target.type == "SELF" then
  992.                     missingHP = player.max_hp - player.hp
  993.             elseif spell.target.isallymember then
  994.                     local target = find_player_in_alliance(spell.target.name)
  995.                     local est_max_hp = target.hp / (target.hpp/100)
  996.                     missingHP = math.floor(est_max_hp - target.hp)
  997.             end
  998.      
  999.             if missingHP ~= nil then
  1000.                     if player.sub_job == 'DNC' then
  1001.                             if missingHP < 40 and spell.target.name == player.name then
  1002.                                     add_to_chat(123,'Full HP!')
  1003.                                     cancel_spell()
  1004.                                     return
  1005.                             elseif missingHP < 150 then
  1006.                                     newWaltz = 'Curing Waltz'
  1007.                                     waltzID = 190
  1008.                             elseif missingHP < 300 then
  1009.                                     newWaltz = 'Curing Waltz II'
  1010.                                     waltzID = 191
  1011.                             else
  1012.                                     newWaltz = 'Curing Waltz III'
  1013.                                     waltzID = 192
  1014.                             end
  1015.                     else
  1016.                             return
  1017.                     end
  1018.             end
  1019.      
  1020.             local waltzTPCost = {['Curing Waltz'] = 200, ['Curing Waltz II'] = 350, ['Curing Waltz III'] = 500}
  1021.             local tpCost = waltzTPCost[newWaltz]
  1022.      
  1023.             local downgrade
  1024.      
  1025.             if player.tp < tpCost then
  1026.      
  1027.                     if player.tp < 20 then
  1028.                             add_to_chat(123, 'Insufficient TP ['..tostring(player.tp)..']. Cancelling.')
  1029.                             cancel_spell()
  1030.                             return
  1031.                     elseif player.tp < 350 then
  1032.                             newWaltz = 'Curing Waltz II'
  1033.                     elseif player.tp < 500 then
  1034.                             newWaltz = 'Curing Waltz III'
  1035.                     end
  1036.      
  1037.                     downgrade = 'Insufficient TP ['..tostring(player.tp)..']. Downgrading to '..newWaltz..'.'
  1038.             end
  1039.      
  1040.             if newWaltz ~= spell.english then
  1041.                     send_command('@input /ja "'..newWaltz..'" '..tostring(spell.target.raw))
  1042.                     if downgrade then
  1043.                             add_to_chat(8, downgrade)
  1044.                     end
  1045.                     cancel_spell()
  1046.                     return
  1047.             end
  1048.      
  1049.             if missingHP > 0 then
  1050.                     add_to_chat(8,'Trying to cure '..tostring(missingHP)..' HP using '..newWaltz..'.')
  1051.             end
  1052.     end
  1053.      
  1054.     function find_player_in_alliance(name)
  1055.             for i,v in ipairs(alliance) do
  1056.                     for k,p in ipairs(v) do
  1057.                             if p.name == name then
  1058.                                     return p
  1059.                             end
  1060.                     end
  1061.             end
  1062.     end
  1063.      
  1064.     function sub_job_change(newSubjob, oldSubjob)
  1065.             select_default_macro_book()
  1066.     end
  1067.      
  1068.     function set_macro_page(set,book)
  1069.             if not tonumber(set) then
  1070.                     add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  1071.                     return
  1072.             end
  1073.             if set < 1 or set > 10 then
  1074.                     add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  1075.                     return
  1076.             end
  1077.      
  1078.             if book then
  1079.                     if not tonumber(book) then
  1080.                             add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  1081.                             return
  1082.                     end
  1083.                     if book < 1 or book > 20 then
  1084.                             add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  1085.                             return
  1086.                     end
  1087.                     send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  1088.             else
  1089.                     send_command('@input /macro set '..tostring(set))
  1090.             end
  1091.     end
  1092.      
  1093.     function select_default_macro_book()
  1094.             -- Default macro set/book
  1095.             if player.sub_job == 'WAR' then
  1096.                     set_macro_page(1, 4)
  1097.             elseif player.sub_job == 'DNC' then
  1098.                     set_macro_page(1, 4)
  1099.             elseif player.sub_job == 'DRK' then
  1100.                     set_macro_page(1, 4)
  1101.             elseif player.sub_job == 'NIN' then
  1102.                     set_macro_page(1, 4)
  1103.             else
  1104.                     set_macro_page(1, 4)
  1105.             end
  1106.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement