Advertisement
Guest User

sam

a guest
Dec 4th, 2016
967
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 46.61 KB | None | 0 0
  1. -- *** Credit goes to Flippant for helping me with Gearswap *** --
  2. -- ** I Use Motenten's Macro Book Function ** --
  3. -- Last Updated: 05/02/14 8:00 PM *Added RA Sets* --
  4.  
  5. function get_sets()
  6.     include('organizer-lib')
  7.     include('gs_bribuddy')
  8.     include('Hastecount')
  9.     count = 0
  10.     hasso = 0
  11.     seigan = 0
  12.     fewd = 0
  13.     AccIndex = 1
  14.     AccArray = {"Normal","Acc","MaxAcc","MaxAcc2"}
  15.     WeaponIndex = 1
  16.     WeaponArray = {"Kogarasumaru", "Dojikiri"}  -- Default TP Set Is Kogarasumaru. Can Delete Any Weapons/Sets That You Don't Need Or Replace/Add The New Weapons That You Want To Use. --
  17.     WsAccIndex = 1
  18.     WsAccArray = {"Normal","Acc","MaxAcc","MaxAcc2"}
  19.     IdleIndex = 1
  20.     IdleArray = {"Regen",} -- Default Idle Set Is Movement --
  21.     AM = "off"
  22.     Quicktest = "off"
  23.     Armor = 'None'
  24.     Twilight = 'None'
  25.     warning = false
  26.     Attack = 'OFF' -- Set Default Attack Set ON or OFF Here --
  27.     Seigan = 'ON' -- Set Default Seigan Set ON or OFF Here --
  28.     Third_Eye = 'ON' -- Set Default Third Eye Set ON or OFF Here --
  29.     Samurai_Roll = 'OFF' -- Set Default SAM Roll ON or OFF Here --
  30.     ammo_warning_limit = 10 -- Set Ammo Limit Check Here --
  31.     target_distance = 5 -- Set Default Distance Here --
  32.     select_default_macro_book() -- Change Default Macro Book At The End --
  33.     areasCities = S{"Ru'Lude Gardens","Upper Jeuno","Lower Jeuno","Port Jeuno",
  34.         "Port Windurst","Windurst Waters","Windurst Woods","Windurst Walls","Heavens Tower",
  35.         "Port San d'Oria","Northern San d'Oria","Southern San d'Oria","Port Bastok",
  36.         "Bastok Markets","Bastok Mines","Metalworks","Aht Urhgan Whitegate","Tavanazian Safehold",
  37.         "Nashmau","Selbina","Mhaura","Norg","Eastern Adoulin","Western Adoulin","Kazham", "Konschtat Highlands",}
  38.     windower.send_command('input //gs org; input /echo [ Job Changed to sam ]')
  39.     windower.send_command('input /lockstyleset 2')
  40.    
  41.  
  42.     --NOTICED ON STARTUP--
  43.     notice('    SAMURAI KEY BINDS')
  44.     notice('  F9 --------  Cycles Accuracy Modes')
  45.     notice('  F10 -------  Lock/unlock PDT')
  46.     notice('  CTRL + F11 - Reset changes weapon')
  47.     notice('  F11 - Lock/unlock MDT')
  48.     notice('  CTRL + F12 - Prints Variables')
  49.     notice('  ALT + F12 -- Resets defense')
  50.     windower.send_command('bind F9 gs c C1')    
  51.     windower.send_command('bind F10 gs c C7')
  52.     windower.send_command('bind F11 gs c C15')
  53.     windower.send_command('bind ^F11 gs c C17')
  54.     windower.send_command('bind ^F12 gs c C6')
  55.     windower.send_command('bind !F12 gs c vars')
  56.    
  57.     organizer_items = {
  58.         echos="Remedies",
  59.         shihei="Shihei",
  60.         sushi="Sole Sushi",
  61.         sushione="Sole Sushi +1",
  62.         sushitwo="Sublime Sushi",
  63.         sushithree="Bream Sushi",
  64.         Warpr="Warp Ring",
  65.         n="Hangaku-no-Yumi",k="Lugra Earring +1",
  66.             }
  67.    
  68.     sets.buffs = {}
  69.     sets.buffs.Doom = {
  70.             ring1="Saida Ring",
  71.             ring2="Saida Ring"
  72.                 }
  73.     sets.buffs.reive = {
  74.             neck="Adoulin's Refuge +1",
  75.                 }
  76.     sets.buffs.sleep = {
  77.             neck="Vim Torque +1",
  78.                 }      
  79.    
  80.     sets.Utility = {}
  81.     -- PDT/MDT Sets --
  82.     sets.Utility.PDT = {
  83.             head="Hizamaru Somen +1",
  84.             body="Emet Harness +1",
  85.             hands="Hizamaru Kote +1",
  86.             legs="Hiza. Hizayoroi +1",
  87.             feet="Hiza. Sune-Ate +1",
  88.             neck="Loricate Torque +1",
  89.             waist="Flume Belt +1",
  90.             left_ear="Genmei Earring",
  91.             right_ear="Merman's Earring",
  92.             left_ring="Defending Ring",
  93.             right_ring={ name="Dark Ring", augments={'Phys. dmg. taken -4%','Magic dmg. taken -3%','Breath dmg. taken -3%',}},
  94.             back="Repulse Mantle", 
  95.                 }
  96.  
  97.     sets.Utility.MDT = {
  98.             head="Terminal Helm",
  99.             body="Hiza. Haramaki +1",
  100.             hands="Hizamaru Kote +1",
  101.             legs="Hiza. Hizayoroi +1",
  102.             feet="Hiza. Sune-Ate +1",
  103.             neck="Loricate Torque +1",
  104.             waist="Flume Belt +1",
  105.             left_ear="Merman's Earring",
  106.             right_ear="Merman's Earring",
  107.             left_ring="Defending Ring",
  108.             right_ring={ name="Dark Ring", augments={'Magic dmg. taken -4%','Breath dmg. taken -4%','Phys. dmg. taken -3%',}},
  109.             back="Repulse Mantle",}
  110.        
  111.     -- Hybrid Sets --
  112.     sets.Utility.Charm = set_combine(sets.Utility.MDT,{
  113.     ammo="Pemphredo Tathlum",
  114.                 neck="M. No.17's Locket",
  115.                 waist="Slipor Sash",
  116.                 left_ring="Wuji Ring",
  117.                 right_ring="Dusksoul Ring",
  118.                 back="Solemnity Cape",
  119.     })
  120.     sets.Utility.Death = set_combine(sets.Utility.MDT,{
  121.                 head="Flawless Ribbon",
  122.                 left_ring="Eihwaz Ring",
  123.                 right_ring="Shadow Ring",
  124.     })
  125.     sets.Utility.Severe = set_combine(sets.Utility.MDT,{head="Nocturnus helm",body="Found. Breastplate",rring="Archon Ring",lring="Shadow Ring",})
  126.     sets.Utility.Hybrid = set_combine(sets.Utility.MDT,{})
  127.     sets.Utility.MEva = set_combine(sets.Utility.MDT,{})
  128.     sets.Utility.BDT = set_combine(sets.Utility.MDT,{})
  129.     sets.Utility.Stun = set_combine(sets.Utility.MDT,{body="Onca Suit",back="Tantalic cape", lring="terrasoul Ring",  rring="Icecrack Ring", lear="Stoic Earring", rear="Arete Del Sol", head="Flawless Ribbon",})
  130.    
  131.    
  132.     sets.Idle = {}
  133.     -- Idle/Town Sets --
  134.     sets.Idle.Regen = {
  135.             range="Cibitshavore",
  136.             ammo="Stone Arrow",
  137.             head="Flam. zucchetto +1",
  138.             body="Hiza. Haramaki +1",
  139.             hands="Hizamaru Kote +1",
  140.             legs="Hiza. Hizayoroi +1",
  141.             feet="Hiza. Sune-Ate +1",
  142.             neck="Loricate Torque +1",
  143.             waist="Flume Belt +1",
  144.             left_ear="Genmei Earring",
  145.             right_ear="Merman's Earring",
  146.             lring="Defending Ring",
  147.             rring="Karieyh Ring",
  148.             back="Repulse Mantle",}
  149.        
  150.     sets.Idle.Town = set_combine(sets.Idle.Regen,{Head="Hizamaru Somen +1",neck="Sanctity Necklace",})
  151.            
  152.     sets.Idle.Regen.Kogarasumaru = set_combine(sets.Idle.Regen,{
  153.             })
  154.    
  155.            
  156.  
  157.     sets.Twilight = {
  158.             head="Twilight Helm",
  159.             body="Twilight Mail"}
  160.  
  161.     -- Preshot Set --
  162.     sets.Preshot = {}
  163.  
  164.     -- Midshot Sets --
  165.     sets.Midshot = {
  166.             range={ name="Cibitshavore", augments={'STR+12','Rng.Acc.+10','"Store TP"+7',}},
  167.             ammo="Stone Arrow",
  168.             head="Terminal Helm",
  169.             body="Kasuga Domaru +1",
  170.             hands="Kobo Kote",
  171.             legs="Kasuga Haidate +1",
  172.             feet="Wakido Sune-Ate",
  173.             neck="Combatant's Torque",
  174.             waist="Windbuffet Belt +1",
  175.             left_ear="Enervating Earring",
  176.             right_ear="Telos Earring",
  177.             left_ring="Hajduk Ring",
  178.             right_ring="Hajduk Ring",
  179.             back="Sokolski Mantle",}
  180.     sets.Midshot.Acc =  set_combine(sets.Midshot,{})
  181.            
  182.     sets.Midshot.MaxAcc = set_combine(sets.Midshot.Acc,{})
  183.     sets.Main = {}
  184.     sets.Main.Kogarasumaru = {main="Kogarasumaru",sub="Bloodrain Strap",}
  185.     sets.Main.Dojikiri = {main="Dojikiri Yasutsuna",sub="Bloodrain Strap",}
  186.     -- TP Base Set --
  187.     sets.TP = {}
  188.     ---------------------------------------------------------------------------------------------------AFTERMATH DOWN--------------------------------------
  189.     -- Kogarasumaru(AM3 Down) TP Sets --
  190.     sets.TP.Kogarasumaru = {
  191.             main="Kogarasumaru",
  192.             sub="Bloodrain Strap",
  193.             range={ name="Cibitshavore", augments={'STR+12','Rng.Acc.+10','"Store TP"+7',}},
  194.             head={ name="Ryuo Somen", augments={'STR+10','DEX+10','Accuracy+15',}},
  195.             body="Flamma Korazin +1",
  196.             hands={ name="Valorous Mitts", augments={'Accuracy+23 Attack+23','"Store TP"+8','DEX+4','Accuracy+12',}},
  197.             legs="Hiza. Hizayoroi +1",
  198.             feet={ name="Valorous Greaves", augments={'Accuracy+25','"Store TP"+6',}},
  199.             neck="Clotharius Torque",
  200.             waist="Windbuffet Belt +1",
  201.             left_ear="Telos Earring",
  202.             right_ear="Digni. Earring",
  203.             left_ring="Ifrit Ring +1",
  204.             right_ring="Karieyh Ring",
  205.             back={ name="Smertrios's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10',}},
  206.             }
  207.            
  208.     sets.TP.Kogarasumaru.Acc = set_combine(sets.TP.Kogarasumaru,{
  209.             head="Flam. zucchetto +1",
  210.             hands={ name="Valorous Mitts", augments={'Accuracy+23 Attack+23','"Store TP"+8','DEX+4','Accuracy+12',}},
  211.             neck="Clotharius Torque",
  212.             waist="Kentarch Belt +1",
  213.             right_ring="Enlivened Ring",
  214.             })
  215.            
  216.     sets.TP.Kogarasumaru.MaxAcc = set_combine(sets.TP.Kogarasumaru,sets.TP.Kogarasumaru.Acc, {
  217.         right_ear="Digni. Earring",
  218.             })
  219.      
  220.     sets.TP.Kogarasumaru.MaxAcc2 = set_combine(sets.TP.Kogarasumaru,sets.TP.Kogarasumaru.Acc,sets.TP.Kogarasumaru.MaxAcc, {
  221.         body={ name="Valorous Mail", augments={'Accuracy+25 Attack+25','Weapon skill damage +1%','STR+10','Accuracy+8','Attack+11',}},
  222.             })
  223.     --------------------------------------------------------------AM DOWN + HASTE ------------------------------   
  224.         -- Kogarasumaru(AM3 Down: Haste) TP Sets --
  225.     sets.TP.Kogarasumaru.Haste = set_combine(sets.TP.Kogarasumaru,{
  226.                     })
  227.    
  228.     sets.TP.Kogarasumaru.Acc.Haste = set_combine(sets.TP.Kogarasumaru.Acc,sets.TP.Kogarasumaru.Haste,{
  229.                     })
  230.    
  231.     sets.TP.Kogarasumaru.MaxAcc.Haste = set_combine(sets.TP.Kogarasumaru.Acc.Haste,sets.TP.Kogarasumaru.MaxAcc,{
  232.                     })
  233.    
  234.     sets.TP.Kogarasumaru.MaxAcc2.Haste = set_combine(sets.TP.Kogarasumaru.MaxAcc.Haste,sets.TP.Kogarasumaru.MaxAcc2,{
  235.                     })
  236.     -----------------------------------------------------------AM DOWN + SAM -----------------------------------               
  237.     -- Kogarasumaru(AM3 Down: SAM Roll) TP Sets --
  238.     sets.TP.Kogarasumaru.STP = set_combine(sets.TP.Kogarasumaru,{})
  239.    
  240.     sets.TP.Kogarasumaru.Acc.STP = set_combine(sets.TP.Kogarasumaru.Acc,sets.TP.Kogarasumaru.STP,{})
  241.    
  242.     sets.TP.Kogarasumaru.MaxAcc.STP = set_combine(sets.TP.Kogarasumaru.MaxAcc,sets.TP.Kogarasumaru.Acc.STP,{})
  243.    
  244.     sets.TP.Kogarasumaru.MaxAcc2.STP = set_combine(sets.TP.Kogarasumaru.MaxAcc2,sets.TP.Kogarasumaru.MaxAcc.STP,{})    
  245.     ----------------------------------------------------------AM DOWN + HASTE + SAM ----------------------------
  246.     -- Kogarasumaru(AM3 Down:Haste UP: SAM Roll) TP Sets --
  247.     sets.TP.Kogarasumaru.Haste.STP = set_combine(sets.TP.Kogarasumaru,{})
  248.    
  249.     sets.TP.Kogarasumaru.Acc.Haste.STP = set_combine(sets.TP.Kogarasumaru.Acc,sets.TP.Kogarasumaru.Haste.STP,{})
  250.    
  251.     sets.TP.Kogarasumaru.MaxAcc.Haste.STP = set_combine(sets.TP.Kogarasumaru.MaxAcc,sets.TP.Kogarasumaru.Acc.Haste.STP,{})
  252.    
  253.     sets.TP.Kogarasumaru.MaxAcc2.Haste.STP = set_combine(sets.TP.Kogarasumaru.MaxAcc2,sets.TP.Kogarasumaru.MaxAcc.Haste.STP,{})
  254.     ---------------------------------------------------------------------------------------AFTERMATH UP---------------------------------------------------
  255.     -- Kogarasumaru(AM3 Up) TP Sets --
  256.     sets.TP.Kogarasumaru.AM3 = {
  257.             main="Kogarasumaru",
  258.             sub="Bloodrain Strap",
  259.             range={ name="Cibitshavore", augments={'STR+12','Rng.Acc.+10','"Store TP"+7',}},
  260.             head={ name="Ryuo Somen", augments={'STR+10','DEX+10','Accuracy+15',}},
  261.             body="Flamma Korazin +1",
  262.             hands={ name="Valorous Mitts", augments={'Accuracy+23 Attack+23','"Store TP"+8','DEX+4','Accuracy+12',}},
  263.             legs="Hiza. Hizayoroi +1",
  264.             feet={ name="Valorous Greaves", augments={'Accuracy+25','"Store TP"+6',}},
  265.             neck="Clotharius Torque",
  266.             waist="Windbuffet Belt +1",
  267.             left_ear="Telos Earring",
  268.             right_ear="Digni. Earring",
  269.             left_ring="Ifrit Ring +1",
  270.             right_ring="Karieyh Ring",
  271.             back={ name="Smertrios's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10',}},
  272.             }
  273.            
  274.     sets.TP.Kogarasumaru.Acc.AM3 = set_combine(sets.TP.Kogarasumaru.AM3,{
  275.             head="Ryuo somen",
  276.             })
  277.            
  278.     sets.TP.Kogarasumaru.MaxAcc.AM3 = set_combine(sets.TP.Kogarasumaru.Acc.AM3, {
  279.             neck="Clotharius Torque",
  280.             body={ name="Valorous Mail", augments={'Accuracy+25 Attack+25','Weapon skill damage +1%','STR+10','Accuracy+8','Attack+11',}},
  281.             legs={ name="Valor. Hose", augments={'Accuracy+22 Attack+22','"Store TP"+7','AGI+2','Accuracy+9','Attack+8',}},
  282.             waist="Kentarch Belt +1",
  283.             left_ring="Enlivened Ring",
  284.             })
  285.            
  286.     sets.TP.Kogarasumaru.MaxAcc2.AM3 = set_combine(sets.TP.Kogarasumaru.MaxAcc.AM3, {
  287.         back="Ground. Mantle +1",
  288.             })
  289.     -----------------------------------------------------------aftermath + haste-------------------------------
  290.     -- Kogarasumaru(AM3 Up: Haste) TP Sets --
  291.     sets.TP.Kogarasumaru.AM3.Haste = set_combine(sets.TP.Kogarasumaru.AM3,{
  292.             })
  293.    
  294.     sets.TP.Kogarasumaru.Acc.AM3.Haste = set_combine(sets.TP.Kogarasumaru.Acc.AM3,{
  295.             })
  296.    
  297.     sets.TP.Kogarasumaru.MaxAcc.AM3.Haste = set_combine(sets.TP.Kogarasumaru.MaxAcc.AM3,{
  298.             })
  299.    
  300.     sets.TP.Kogarasumaru.MaxAcc2.AM3.Haste = set_combine(sets.TP.Kogarasumaru.MaxAcc2.AM3,{
  301.             })
  302.                
  303.     ---------------------------------------------------------AFTERMATH + SAM----------------------------------
  304.     -- Kogarasumaru(AM3 Up: SAM Roll) TP Sets --
  305.     sets.TP.Kogarasumaru.AM3.STP = set_combine(sets.TP.Kogarasumaru.AM3,{
  306.             })
  307.     sets.TP.Kogarasumaru.Acc.AM3.STP = set_combine(sets.TP.Kogarasumaru.Acc.AM3,sets.TP.Kogarasumaru.AM3.STP,{
  308.             })     
  309.     sets.TP.Kogarasumaru.MaxAcc.AM3.STP = set_combine(sets.TP.Kogarasumaru.MaxAcc.AM3,sets.TP.Kogarasumaru.Acc.AM3.STP,{
  310.             })     
  311.     sets.TP.Kogarasumaru.MaxAcc2.AM3.STP = set_combine(sets.TP.Kogarasumaru.MaxAcc2.AM3,sets.TP.Kogarasumaru.MaxAcc.AM3.STP,{
  312.             })
  313.     --------------------------------------------------------AFTERMATH + HASTE + SAM---------------------------     
  314.     -- Kogarasumaru(AM3 Up:Haste UP: SAM Roll) TP Sets --
  315.     sets.TP.Kogarasumaru.AM3.Haste.STP = set_combine(sets.TP.Kogarasumaru.AM3,{
  316.             head="Flam. zucchetto +1",
  317.             body={ name="Valorous Mail", augments={'Accuracy+25 Attack+25','Weapon skill damage +1%','STR+10','Accuracy+8','Attack+11',}},
  318.             hands={ name="Ryuo Tekko", augments={'DEX+10','Accuracy+20','"Dbl.Atk."+3',}},
  319.             legs={ name="Valor. Hose", augments={'Accuracy+25','Crit.hit rate+3',}},
  320.             feet={ name="Valorous Greaves", augments={'Attack+13','Crit.hit rate+4','CHR+9','Accuracy+12',}},
  321.             })
  322.     sets.TP.Kogarasumaru.Acc.AM3.Haste.STP = set_combine(sets.TP.Kogarasumaru.Acc.AM3,sets.TP.Kogarasumaru.AM3.Haste.STP,{
  323.             })     
  324.     sets.TP.Kogarasumaru.MaxAcc.AM3.Haste.STP = set_combine(sets.TP.Kogarasumaru.MaxAcc.AM3,sets.TP.Kogarasumaru.Acc.AM3.Haste.STP,{
  325.             })     
  326.     sets.TP.Kogarasumaru.MaxAcc2.AM3.Haste.STP = set_combine(sets.TP.Kogarasumaru.MaxAcc2.AM3,sets.TP.Kogarasumaru.MaxAcc.AM3.Haste.STP,{
  327.             })
  328.     --   -----xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx----
  329.        
  330.     sets.TP.Dojikiri = {
  331.             main="Dojikiri Yasutsuna",
  332.             sub="Bloodrain Strap",
  333.             range={ name="Cibitshavore", augments={'STR+12','Rng.Acc.+10','"Store TP"+7',}},
  334.             head={ name="Ryuo Somen", augments={'STR+10','DEX+10','Accuracy+15',}},
  335.             body={ name="Valorous Mail", augments={'Accuracy+14 Attack+14','"Store TP"+5','Accuracy+14',}},
  336.             hands={ name="Valorous Mitts", augments={'Accuracy+23 Attack+23','"Store TP"+8','DEX+4','Accuracy+12',}},
  337.             legs="Hiza. Hizayoroi +1",
  338.             feet={ name="Valorous Greaves", augments={'Accuracy+25','"Store TP"+6',}},
  339.             neck="Clotharius Torque",
  340.             waist="Windbuffet Belt +1",
  341.             left_ear="Telos Earring",
  342.             right_ear="Digni. Earring",
  343.             left_ring="Ifrit Ring +1",
  344.             right_ring="Karieyh Ring",
  345.             back={ name="Smertrios's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10',}},
  346.             }
  347.            
  348.     sets.TP.Dojikiri.Acc = set_combine(sets.TP.Dojikiri,{
  349.             head="Flam. zucchetto +1",
  350.             hands={ name="Valorous Mitts", augments={'Accuracy+23 Attack+23','"Store TP"+8','DEX+4','Accuracy+12',}},
  351.             neck="Clotharius Torque",
  352.             waist="Kentarch Belt +1",
  353.             right_ring="Enlivened Ring",
  354.             })
  355.            
  356.     sets.TP.Dojikiri.MaxAcc = set_combine(sets.TP.Dojikiri,sets.TP.Dojikiri.Acc, {
  357.         right_ear="Digni. Earring",
  358.             })
  359.      
  360.     sets.TP.Dojikiri.MaxAcc2 = set_combine(sets.TP.Dojikiri,sets.TP.Dojikiri.Acc,sets.TP.Dojikiri.MaxAcc, {
  361.         body={ name="Valorous Mail", augments={'Accuracy+25 Attack+25','Weapon skill damage +1%','STR+10','Accuracy+8','Attack+11',}},
  362.             })
  363.     --------------------------------------------------------------AM DOWN + HASTE ------------------------------   
  364.         -- Dojikiri(AM3 Down: Haste) TP Sets --
  365.     sets.TP.Dojikiri.Haste = set_combine(sets.TP.Dojikiri,{
  366.                     })
  367.    
  368.     sets.TP.Dojikiri.Acc.Haste = set_combine(sets.TP.Dojikiri.Acc,sets.TP.Dojikiri.Haste,{
  369.                     })
  370.    
  371.     sets.TP.Dojikiri.MaxAcc.Haste = set_combine(sets.TP.Dojikiri.Acc.Haste,sets.TP.Dojikiri.MaxAcc,{
  372.                     })
  373.    
  374.     sets.TP.Dojikiri.MaxAcc2.Haste = set_combine(sets.TP.Dojikiri.MaxAcc.Haste,sets.TP.Dojikiri.MaxAcc2,{
  375.                     })
  376.     -----------------------------------------------------------AM DOWN + SAM -----------------------------------               
  377.     -- Dojikiri(AM3 Down: SAM Roll) TP Sets --
  378.     sets.TP.Dojikiri.STP = set_combine(sets.TP.Dojikiri,{})
  379.    
  380.     sets.TP.Dojikiri.Acc.STP = set_combine(sets.TP.Dojikiri.Acc,sets.TP.Dojikiri.STP,{})
  381.    
  382.     sets.TP.Dojikiri.MaxAcc.STP = set_combine(sets.TP.Dojikiri.MaxAcc,sets.TP.Dojikiri.Acc.STP,{})
  383.    
  384.     sets.TP.Dojikiri.MaxAcc2.STP = set_combine(sets.TP.Dojikiri.MaxAcc2,sets.TP.Dojikiri.MaxAcc.STP,{})    
  385.     ----------------------------------------------------------AM DOWN + HASTE + SAM ----------------------------
  386.     -- Dojikiri(AM3 Down:Haste UP: SAM Roll) TP Sets --
  387.     sets.TP.Dojikiri.Haste.STP = set_combine(sets.TP.Dojikiri,{})
  388.    
  389.     sets.TP.Dojikiri.Acc.Haste.STP = set_combine(sets.TP.Dojikiri.Acc,sets.TP.Dojikiri.Haste.STP,{})
  390.    
  391.     sets.TP.Dojikiri.MaxAcc.Haste.STP = set_combine(sets.TP.Dojikiri.MaxAcc,sets.TP.Dojikiri.Acc.Haste.STP,{})
  392.    
  393.     sets.TP.Dojikiri.MaxAcc2.Haste.STP = set_combine(sets.TP.Dojikiri.MaxAcc2,sets.TP.Dojikiri.MaxAcc.Haste.STP,{})
  394.     ---------------------------------------------------------------------------------------AFTERMATH UP---------------------------------------------------
  395.     -- Dojikiri(AM3 Up) TP Sets --
  396.     sets.TP.Dojikiri.AM3 = {
  397.             main="Dojikiri Yasutsuna",
  398.             sub="Bloodrain Strap",
  399.             range={ name="Cibitshavore", augments={'STR+12','Rng.Acc.+10','"Store TP"+7',}},
  400.             head={ name="Ryuo Somen", augments={'STR+10','DEX+10','Accuracy+15',}},
  401.             body={ name="Valorous Mail", augments={'Accuracy+14 Attack+14','"Store TP"+5','Accuracy+14',}},
  402.             hands={ name="Valorous Mitts", augments={'Accuracy+23 Attack+23','"Store TP"+8','DEX+4','Accuracy+12',}},
  403.             legs="Hiza. Hizayoroi +1",
  404.             feet={ name="Valorous Greaves", augments={'Accuracy+25','"Store TP"+6',}},
  405.             neck="Clotharius Torque",
  406.             waist="Windbuffet Belt +1",
  407.             left_ear="Telos Earring",
  408.             right_ear="Digni. Earring",
  409.             left_ring="Ifrit Ring +1",
  410.             right_ring="Karieyh Ring",
  411.             back={ name="Smertrios's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10',}},
  412.             }
  413.            
  414.     sets.TP.Dojikiri.Acc.AM3 = set_combine(sets.TP.Dojikiri.AM3,{
  415.             })
  416.            
  417.     sets.TP.Dojikiri.MaxAcc.AM3 = set_combine(sets.TP.Dojikiri.Acc.AM3, {
  418.             waist="Kentarch Belt +1",
  419.             })
  420.            
  421.     sets.TP.Dojikiri.MaxAcc2.AM3 = set_combine(sets.TP.Dojikiri.MaxAcc.AM3, {
  422.             })
  423.     -----------------------------------------------------------aftermath + haste-------------------------------
  424.     -- Dojikiri(AM3 Up: Haste) TP Sets --
  425.     sets.TP.Dojikiri.AM3.Haste = set_combine(sets.TP.Dojikiri.AM3,{
  426.             })
  427.    
  428.     sets.TP.Dojikiri.Acc.AM3.Haste = set_combine(sets.TP.Dojikiri.Acc.AM3,{
  429.             })
  430.    
  431.     sets.TP.Dojikiri.MaxAcc.AM3.Haste = set_combine(sets.TP.Dojikiri.MaxAcc.AM3,{
  432.             })
  433.    
  434.     sets.TP.Dojikiri.MaxAcc2.AM3.Haste = set_combine(sets.TP.Dojikiri.MaxAcc2.AM3,{
  435.             })
  436.                
  437.     ---------------------------------------------------------AFTERMATH + SAM----------------------------------
  438.     -- Dojikiri(AM3 Up: SAM Roll) TP Sets --
  439.     sets.TP.Dojikiri.AM3.STP = set_combine(sets.TP.Dojikiri.AM3,{
  440.             })
  441.     sets.TP.Dojikiri.Acc.AM3.STP = set_combine(sets.TP.Dojikiri.Acc.AM3,sets.TP.Dojikiri.AM3.STP,{
  442.             })     
  443.     sets.TP.Dojikiri.MaxAcc.AM3.STP = set_combine(sets.TP.Dojikiri.MaxAcc.AM3,sets.TP.Dojikiri.Acc.AM3.STP,{
  444.             })     
  445.     sets.TP.Dojikiri.MaxAcc2.AM3.STP = set_combine(sets.TP.Dojikiri.MaxAcc2.AM3,sets.TP.Dojikiri.MaxAcc.AM3.STP,{
  446.             })
  447.     --------------------------------------------------------AFTERMATH + HASTE + SAM---------------------------     
  448.     -- Dojikiri(AM3 Up:Haste UP: SAM Roll) TP Sets --
  449.     sets.TP.Dojikiri.AM3.Haste.STP = set_combine(sets.TP.Dojikiri.AM3,{
  450.             })
  451.     sets.TP.Dojikiri.Acc.AM3.Haste.STP = set_combine(sets.TP.Dojikiri.Acc.AM3,sets.TP.Dojikiri.AM3.Haste.STP,{
  452.             })     
  453.     sets.TP.Dojikiri.MaxAcc.AM3.Haste.STP = set_combine(sets.TP.Dojikiri.MaxAcc.AM3,sets.TP.Dojikiri.Acc.AM3.Haste.STP,{
  454.             })     
  455.     sets.TP.Dojikiri.MaxAcc2.AM3.Haste.STP = set_combine(sets.TP.Dojikiri.MaxAcc2.AM3,sets.TP.Dojikiri.MaxAcc.AM3.Haste.STP,{
  456.             })
  457.     --   ---------------------------------------------------------------------------
  458.    
  459.  
  460.    
  461.    
  462.     -- Seigan TP Set --
  463.     sets.TP.Seigan = {head="Kasuga Kabuto +1"}
  464.  
  465.     -- Third Eye TP Set --
  466.     sets.TP['Third Eye'] = {legs="Sakonji Haidate +1"}
  467.    
  468.     sets.TP.Hybrid = set_combine(sets.Utility.PDT,{})
  469.    
  470.     sets.TP.Hybrid.Acc = set_combine(sets.TP.Hybrid,{})
  471.    
  472.     sets.TP.Hybrid.MaxAcc = set_combine(sets.TP.Hybrid.Acc,{})
  473.    
  474.     sets.TP.Hybrid.MaxAcc2 = set_combine(sets.TP.Hybrid.MaxAcc,{})
  475.    
  476.    
  477.  
  478.     -- WS Base Set --
  479.     sets.WS = {
  480.             sub="Bloodrain Strap",
  481.             ammo="Stone Arrow",
  482.             head="Sukeroku Hachi.",
  483.             body={ name="Valorous Mail", augments={'Accuracy+25 Attack+25','Weapon skill damage +1%','STR+10','Accuracy+8','Attack+11',}},
  484.             hands={ name="Valorous Mitts", augments={'Accuracy+23 Attack+23','"Store TP"+8','DEX+4','Accuracy+12',}},
  485.             legs="Hiza. Hizayoroi +1",
  486.             feet={ name="Valorous Greaves", augments={'Accuracy+25','"Store TP"+6',}},
  487.             neck="Combatant's Torque",
  488.             waist="Windbuffet Belt +1",
  489.             left_ear="Telos Earring",
  490.             right_ear="Moonshade Earring",
  491.             left_ring="Enlivened Ring",
  492.             right_ring="Petrov Ring",
  493.             back={ name="Smertrios's Mantle", augments={'STR+20','Accuracy+20 Attack+20','Weapon skill damage +10%',}},
  494.                     }
  495.  
  496.     -- Tachi: Fudo Sets --
  497.     sets.WS["Tachi: Fudo"] = {
  498.             head={ name="Valorous Mask", augments={'Accuracy+21 Attack+21','"Dbl.Atk."+5','Accuracy+11','Attack+15',}},
  499.             body={ name="Valorous Mail", augments={'Accuracy+25 Attack+25','Weapon skill damage +1%','STR+10','Accuracy+8','Attack+11',}},
  500.             hands={ name="Valorous Mitts", augments={'Weapon skill damage +5%','STR+4','Accuracy+12','Attack+7',}},
  501.             legs="Hiza. Hizayoroi +1",
  502.             feet={ name="Valorous Greaves", augments={'Attack+14','Weapon skill damage +4%','VIT+5','Accuracy+15',}},
  503.             neck="Fotia Gorget",
  504.             waist="Fotia Belt",
  505.             left_ear="Telos Earring",
  506.             right_ear={ name="Moonshade Earring", augments={'Accuracy+4','TP Bonus +25',}},
  507.             left_ring="Ifrit Ring +1",
  508.             right_ring="Karieyh Ring",
  509.             back={ name="Smertrios's Mantle", augments={'STR+20','Accuracy+20 Attack+20','Weapon skill damage +10%',}}, }
  510.    
  511.     sets.WS["Tachi: Fudo"].Acc = set_combine(sets.WS["Tachi: Fudo"],{})
  512.            
  513.     sets.WS["Tachi: Fudo"].MaxAcc = set_combine(sets.WS["Tachi: Fudo"].Acc,{
  514.             })
  515.    
  516.     sets.WS["Tachi: Fudo"].MaxAcc2 = set_combine(sets.WS["Tachi: Fudo"].MaxAcc,{})
  517.  
  518.    
  519.  
  520.     -- Tachi: Fudo(SAM Roll) Sets --
  521.     sets.WS["Tachi: Fudo"].STP = set_combine(sets.WS["Tachi: Fudo"],{})
  522.    
  523.     sets.WS["Tachi: Fudo"].Acc.STP = set_combine(sets.WS["Tachi: Fudo"].Acc,{})
  524.    
  525.     sets.WS["Tachi: Fudo"].MaxAcc.STP = set_combine(sets.WS["Tachi: Fudo"].MaxAcc,{})
  526.  
  527.     -- Tachi: Fudo(Attack) Set --
  528.     sets.WS["Tachi: Fudo"].ATT = set_combine(sets.WS["Tachi: Fudo"],{})
  529.  
  530.     -- Tachi: Shoha Sets --
  531.     sets.WS["Tachi: Shoha"] = sets.WS["Tachi: Fudo"]
  532.            
  533.     sets.WS["Tachi: Shoha"].Acc = set_combine(sets.WS["Tachi: Shoha"],{})
  534.        
  535.     sets.WS["Tachi: Shoha"].MaxAcc = set_combine(sets.WS["Tachi: Shoha"].Acc,{})
  536.    
  537.    
  538.  
  539.     -- Tachi: Shoha(SAM Roll) Sets --
  540.     sets.WS["Tachi: Shoha"].STP = set_combine(sets.WS["Tachi: Shoha"],{})
  541.    
  542.     sets.WS["Tachi: Shoha"].Acc.STP = set_combine(sets.WS["Tachi: Shoha"].Acc,{})
  543.    
  544.     sets.WS["Tachi: Shoha"].MaxAcc.STP = set_combine(sets.WS["Tachi: Shoha"].MaxAcc,{})
  545.  
  546.     -- Tachi: Kaiten Sets --
  547.     sets.WS["Tachi: Kaiten"] = {}
  548.     sets.WS["Tachi: Kaiten"].Acc = set_combine(sets.WS["Tachi: Kaiten"],{})
  549.    
  550.     sets.WS["Tachi: Kaiten"].MaxAcc = set_combine(sets.WS["Tachi: Kaiten"].Acc,{})
  551.    
  552.  
  553.     -- Tachi: Kaiten(SAM Roll) Sets --
  554.     sets.WS["Tachi: Kaiten"].STP = set_combine(sets.WS["Tachi: Kaiten"],{})
  555.    
  556.     sets.WS["Tachi: Kaiten"].Acc.STP = set_combine(sets.WS["Tachi: Kaiten"].Acc,{})
  557.    
  558.     sets.WS["Tachi: Kaiten"].MaxAcc.STP = set_combine(sets.WS["Tachi: Kaiten"].MaxAcc,{})
  559.  
  560.     -- Tachi: Kaiten(Attack) Set --
  561.     sets.WS["Tachi: Kaiten"].ATT = set_combine(sets.WS["Tachi: Kaiten"],{})
  562.  
  563.     -- Tachi: Rana Sets --
  564.     sets.WS["Tachi: Rana"] = sets.WS
  565.            
  566.     sets.WS["Tachi: Rana"].Acc = set_combine(sets.WS["Tachi: Rana"],{})
  567.            
  568.     sets.WS["Tachi: Rana"].MaxAcc = set_combine(sets.WS["Tachi: Rana"].Acc,{})
  569.  
  570.    
  571.  
  572.     -- Tachi: Rana(SAM Roll) Sets --
  573.     sets.WS["Tachi: Rana"].STP = set_combine(sets.WS["Tachi: Rana"],{})
  574.    
  575.     sets.WS["Tachi: Rana"].Acc.STP = set_combine(sets.WS["Tachi: Rana"].Acc,{})
  576.    
  577.     sets.WS["Tachi: Rana"].MaxAcc.STP = set_combine(sets.WS["Tachi: Rana"].MaxAcc,{})
  578.    
  579.    
  580.    
  581.     -- Tachi: Ageha Sets --
  582.     sets.WS["Tachi: Ageha"] = {
  583.             head="Flam. Zucchetto +1",
  584.             body="Flamma Korazin +1",
  585.             hands="Flam. Manopolas +1",
  586.             legs="Flamma Dirs +1",
  587.             feet="Flam. Gambieras +1",
  588.             neck="Sanctity Necklace",
  589.             waist="Fotia Belt",
  590.             left_ear="Digni. Earring",
  591.             right_ear={ name="Moonshade Earring", augments={'Accuracy+4','TP Bonus +25',}},
  592.             left_ring="Rufescent Ring",
  593.             right_ring="Karieyh Ring",
  594.             back={ name="Smertrios's Mantle", augments={'STR+20','Accuracy+20 Attack+20','Weapon skill damage +10%',}},
  595.         }
  596.            
  597.     sets.WS["Tachi: Ageha"].Acc = set_combine(sets.WS["Tachi: Ageha"],{})
  598.            
  599.     sets.WS["Tachi: Ageha"].MaxAcc = set_combine(sets.WS["Tachi: Ageha"].Acc,{})
  600.    
  601.    
  602.    
  603.     -- Tachi: Gekko Sets --
  604.     sets.WS["Tachi: Gekko"] = sets.WS["Tachi: Ageha"]
  605.            
  606.     sets.WS["Tachi: Gekko"].Acc = set_combine(sets.WS["Tachi: Gekko"],{})
  607.            
  608.     sets.WS["Tachi: Gekko"].MaxAcc = set_combine(sets.WS["Tachi: Gekko"].Acc,{})
  609.    
  610.    
  611.     -- Tachi: Hobaku Sets --
  612.     sets.WS["Tachi: Hobaku"] = sets.WS["Tachi: Ageha"]
  613.            
  614.     sets.WS["Tachi: Hobaku"].Acc = set_combine(sets.WS["Tachi: Hobaku"],{})
  615.            
  616.     sets.WS["Tachi: Hobaku"].MaxAcc = set_combine(sets.WS["Tachi: Hobaku"].Acc,{})
  617.    
  618.     -- Tachi: Jinpu--
  619.     sets.WS["Tachi: Jinpu"] = sets.WS["Tachi: Shoha"]
  620.  
  621.     -- Namas Arrow Sets --
  622.     sets.WS["Namas Arrow"] = {}
  623.            
  624.     sets.WS["Namas Arrow"].Acc = set_combine(sets.WS["Namas Arrow"],{})
  625.    
  626.     sets.WS["Namas Arrow"].MaxAcc = set_combine(sets.WS["Namas Arrow"].Acc,{})
  627.  
  628.     -- Apex Arrow Sets --
  629.     sets.WS["Apex Arrow"] = {
  630.     sub="Bloodrain Strap",
  631.     range={ name="Cibitshavore", augments={'STR+12','Rng.Acc.+10','"Store TP"+7',}},
  632.     ammo="Eminent Arrow",
  633.     hands="Kasuga Kote +1",
  634.     feet="Waki. Sune-Ate",
  635.     neck="Combatant's Torque",
  636.     left_ear="Neritic Earring",
  637.     right_ear="Moonshade Earring",
  638.     left_ring="Hajduk Ring",
  639.     right_ring="Karieyh Ring",
  640.     back="Takaha Mantle",}
  641.            
  642.     sets.WS["Apex Arrow"].Acc = set_combine(sets.WS["Apex Arrow"],{
  643.             body=""})
  644.    
  645.     sets.WS["Apex Arrow"].MaxAcc = set_combine(sets.WS["Apex Arrow"].Acc,{})
  646.    
  647.     sets.WS["Sonic Thrust"] = set_combine(sets.WS["Tachi: Fudo"], {
  648.             neck="Fotia Gorget",
  649.             waist="Fotia Belt"})
  650.    
  651.     sets.WS["Sonic Thrust"].Acc = set_combine(sets.WS["Sonic Thrust"],{})
  652.    
  653.     sets.WS["Sonic Thrust"].MaxAcc = set_combine(sets.WS["Sonic Thrust"].Acc,{})
  654.    
  655.    
  656.     sets.WSDayBonus = {}
  657.     -- JA Sets --
  658.     sets.JA = {}
  659.     sets.JA.Meditate = {
  660.             head="Myochin Kabuto",
  661.             hands="Sakonji Kote",
  662.             back={ name="Smertrios's Mantle", augments={'STR+20','Accuracy+20 Attack+20','Weapon skill damage +10%',}},}
  663.            
  664.     sets.JA["Ikishoten"] = {
  665.             head="Sakonji Kabuto +1"}
  666.     sets.JA["Warding Circle"] = {
  667.             head="Myochin Kabuto"}
  668.     sets.JA["Sengikori"] = {
  669.             feet="Kasuga Sune-Ate +1"}
  670.  
  671.     -- Waltz Set --
  672.     sets.Waltz = {}
  673.  
  674.     sets.Precast = {}
  675.     -- Fastcast Set --
  676.     sets.Precast.FastCast = {}
  677.    
  678.     sets.Midcast = {}
  679.     -- Magic Haste Set --
  680.     sets.Midcast.Haste = set_combine(sets.Utility.PDT,{body="Yoran Unity Shirt",})
  681. end
  682.  
  683. local weaponskill = {
  684. Firesday =  {'Liquefaction','Fusion'},  Earthsday = {'Scission','Gravitation'},  Watersday =  {'Reverberation','Distortion'}, Windsday = {'Detonation','Fragmentation'},
  685.       Iceday = {'Induration','Distortion'}, Lightningsday = {'Impaction','Fragmentation'}, Lightsday= {'Transfixion','Fusion'}, Darksday = {'Compression','Gravitation'},}
  686.     -- weaponskill.Firesday = T{'Liquefaction','Fusion'}
  687.     -- weaponskill.Earthsday = T{'Scission','Gravitation'}
  688.     -- weaponskill.Watersday = T{'Reverberation','Distortion'}
  689.     -- weaponskill.Windsday = T{'Detonation','Fragmentation'}
  690.     -- weaponskill.Iceday = T{'Induration','Distortion'}
  691.     -- weaponskill.Lightningsday = T{'Impaction','Fragmentation'}
  692.     -- weaponskill.Lightsday = T{'Transfixion','Fusion'}
  693.     -- weaponskill.Darksday = T{'Compression','Gravitation'}
  694.    
  695.  
  696.  function notice(msg, color)
  697.         if color == nil then
  698.             color = 158
  699.         end
  700.             windower.add_to_chat(color, msg)
  701.  end
  702.  
  703.   function file_unload()
  704.         windower.send_command('unbind F9')
  705.         windower.send_command('unbind F10')
  706.         windower.send_command('unbind F11')
  707.         windower.send_command('unbind F12')
  708.         windower.send_command('unbind ^`')
  709.         windower.send_command('unbind !`')
  710.         windower.send_command('unbind F9')
  711.         windower.send_command('unbind !F12')
  712.         notice('Unbinding Samurai Interface.')
  713.     end
  714.  
  715. function pretarget(spell,action)
  716.     if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  717.         cancel_spell()
  718.         send_command('input /item "Echo Drops" <me>')
  719.     elseif spell.english == "Berserk" and buffactive.Berserk then -- Change Berserk To Aggressor If Berserk Is On --
  720.         cancel_spell()
  721.         send_command('Aggressor')
  722.     elseif spell.english == "Seigan" and buffactive.Seigan then -- Change Seigan To Third Eye If Seigan Is On --
  723.         cancel_spell()
  724.         send_command('ThirdEye')
  725.     elseif spell.english == "Meditate" and player.tp > 2900 then -- Cancel Meditate If TP Is Above 2900 --
  726.         cancel_spell()
  727.         add_to_chat(123, spell.name .. ' Canceled: ['..player.tp..' TP]')
  728.     elseif spell.action_type == 'Ranged Attack' and spell.target.distance > 24.9 then
  729.         cancel_spell()
  730.         add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  731.         return
  732.     elseif spell.type == 'WeaponSkill' and player.status == 'Engaged' then
  733.         if spell.skill == 'Archery' then
  734.             if spell.target.distance > 16+target_distance then
  735.                 cancel_spell()
  736.                 add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  737.                 return
  738.             end
  739.         else
  740.         end
  741.     end
  742. end
  743.  
  744. function m_table_contains(t, searchVal0, searchVal1, searchVal2)
  745.    
  746.        if (t ~= nil) then
  747.         for key,value in pairs(t) do
  748.             if (searchVal0 ~= nil) then
  749.                 if (string.find(value, searchVal0)) then
  750.                     return true;
  751.                 end
  752.             end
  753.  
  754.             if (searchVal1 ~= nil) then
  755.                 if (string.find(value, searchVal1)) then
  756.                     return true;
  757.                 end
  758.             end
  759.  
  760.             if (searchVal2 ~= nil) then
  761.                 if (string.find(value, searchVal2)) then
  762.                     return true;
  763.                 end
  764.             end
  765.         end
  766.     end
  767.  
  768.     return false;
  769. end
  770.  
  771.  
  772. function precast(spell,action)
  773.    
  774.     if spell.action_type == 'Ranged Attack' then
  775.         if player.equipment.ammo == 'empty' then
  776.             add_to_chat(123, spell.name..' Canceled: [Out of Ammo]')
  777.             cancel_spell()
  778.             return
  779.         else
  780.             equip(sets.Preshot)
  781.            
  782.         end
  783.     end
  784.     if spell.type == "WeaponSkill" and player.equipment.main == "Kogarasumaru" and player.tp > 999 then
  785.         if spell.english == "Tachi: Fudo" and player.tp > 2999 and AM == 'off' then
  786.             cancel_spell()
  787.             windower.send_command('Tachi: Rana')
  788.         else
  789.             equipSet = sets.WS
  790.             if equipSet[spell.english] then
  791.                 equipSet = equipSet[spell.english]
  792.             end
  793.             if Attack == 'ON' then
  794.                 equipSet = equipSet["ATT"]
  795.             end
  796.             --EDITED CODE--
  797.             if equipSet[WsAccArray[WsAccIndex]] then
  798.                 equipSet = equipSet[WsAccArray[WsAccIndex]]
  799.             end
  800.             if equipSet[WeaponArray[WeaponIndex]] then
  801.             equipSet = equipSet[WeaponArray[WeaponIndex]]
  802.         end
  803.             if buffactive.Sekkanoki then -- Equip Kasuga Kote When Sekkanoki Is On --
  804.                 equipSet = set_combine(equipSet,{hands="Kasuga Kote +1"})
  805.             end
  806.             if buffactive.Sengikori then -- Equip Unkai Sune-Ate +2 When Sengikori Is On --
  807.                 equipSet = set_combine(equipSet,{feet="Kasuga Sune-Ate +1"})
  808.             end
  809.              -- Equip Vulcan's Pearl When You Have 300 TP or Sekkanoki On or 200+ TP For Hagakure --
  810.             -- 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
  811.                 -- equipSet = set_combine(equipSet,{ear1="Flame Pearl"})
  812.             -- end
  813.             if (m_table_contains(weaponskill[world['day']], spell['skillchain_a'], spell['skillchain_b'], spell['skillchain_c'])) then
  814.                 equipSet = set_combine(equipSet,{head="Gavialis Helm"})
  815.                 windower.add_to_chat(123, spell.skillchain_a);
  816.                 windower.add_to_chat(123, spell.skillchain_b);
  817.                 windower.add_to_chat(123, spell.skillchain_c);
  818.             end
  819.             if (spell.english == "Tachi: Fudo" or spell.english == "Tachi: Shoha") and world.time >= 1020 or world.time <= 420 then
  820.                 equipSet = set_combine(equipSet,{ear1="Lugra Earring +1"})
  821.             end
  822.             equip(equipSet)
  823.         end
  824.     end
  825.     if spell.type == "JobAbility" then
  826.         if sets.JA[spell.english] then
  827.             equip(sets.JA[spell.english])
  828.         end
  829.     end
  830.     if spell.action_type == 'Magic' then
  831.         if string.find(spell.english,'Utsusemi') then
  832.             if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  833.                 cancel_spell()
  834.                 add_to_chat(123, spell.name .. ' Canceled: [3+ Images]')
  835.                 return
  836.             else
  837.                 equip(sets.Precast.FastCast)
  838.             end
  839.         else
  840.             equip(sets.Precast.FastCast)
  841.         end
  842.     end
  843.     if spell.type == "Waltz" then
  844.         refine_waltz(spell,action)
  845.         equip(sets.Waltz)
  846.         elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  847.             cast_delay(0.2)
  848.             send_command('cancel Sneak')
  849.     end
  850.     if Twilight == 'Twilight' then
  851.         equip(sets.Twilight)
  852.     end
  853. end
  854.  
  855. function midcast(spell,action)
  856.    
  857.     if spell.action_type == 'Ranged Attack' then
  858.         equip(sets.Midshot.Acc)
  859.     elseif spell.action_type == 'Magic' then
  860.         if string.find(spell.english,'Utsusemi') then
  861.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  862.                 send_command('@wait 1.7;cancel Copy Image*')
  863.             end
  864.             equip(sets.Midcast.Haste)
  865.         elseif spell.english == 'Monomi: Ichi' then
  866.             if buffactive['Sneak'] then
  867.                 send_command('@wait 1.7;cancel sneak')
  868.             end
  869.             equip(sets.Midcast.Haste)
  870.         else
  871.             equip(sets.Midcast.Haste)
  872.         end
  873.     end
  874. end
  875.  
  876. function aftercast(spell,action)
  877.    
  878.     if not spell.interrupted then
  879.         if spell.type == "WeaponSkill" then
  880.             send_command('wait 0.2;gs c TP')
  881.             if buffactive["Meikyo Shisui"] and player.tp < 1000 then
  882.                 send_command('cancel Meikyo Shisui')
  883.             end
  884.         elseif spell.english == "Warding Circle" then -- Warding Circle Countdown --
  885.             send_command('wait 260;input /echo '..spell.name..': [WEARING OFF IN 10 SEC.];wait 10;input /echo '..spell.name..': [OFF]')
  886.         end
  887.     end
  888.     status_change(player.status)
  889. end
  890.  
  891. function status_change(new,old)
  892.    
  893.     if Armor == 'PDT' then
  894.         equip(sets.Utility.PDT)
  895.     elseif Armor == 'MDT' then
  896.         equip(sets.Utility.MDT)
  897.     elseif player.status == 'Engaged' then
  898.         equipSet = sets.TP
  899.         if Armor == 'Hybrid' and equipSet["Hybrid"] then
  900.             equipSet = equipSet["Hybrid"]
  901.         end
  902.         if equipSet[WeaponArray[WeaponIndex]] then
  903.             equipSet = equipSet[WeaponArray[WeaponIndex]]
  904.         end
  905.         if equipSet[AccArray[AccIndex]] then
  906.             equipSet = equipSet[AccArray[AccIndex]]
  907.         end
  908.         if buffactive["Aftermath: Lv.3"]  then
  909.             equipSet = equipSet["AM3"]
  910.         end
  911.         -- haste 1 and two id 33  entrust haste id 580  magic haste cap 43.75%
  912.         -- if count >= 15 then
  913.             -- equipSet = equipSet["Haste"]
  914.         -- end
  915.         if buffactive.Seigan then -- Use Seigan Toggle For Seigan TP Set --
  916.             equipSet = set_combine(equipSet,sets.TP.Seigan)
  917.         end
  918.         if buffactive["Third Eye"]  then -- Use Third Eye Toggle For Third Eye TP Set --
  919.             equipSet = set_combine(equipSet,sets.TP["Third Eye"])
  920.         end
  921.         equip(equipSet)
  922.     else
  923.         equipSet = sets.Idle
  924.         if areasCities:contains(world.zone) then
  925.         equipSet = sets.Idle.Town
  926.         end
  927.         if equipSet[IdleArray[IdleIndex]] then
  928.             equipSet = equipSet[IdleArray[IdleIndex]]
  929.         end
  930.         if equipSet[WeaponArray[WeaponIndex]] then
  931.             equipSet = equipSet[WeaponArray[WeaponIndex]]
  932.            
  933.         end
  934.         equip(equipSet)
  935.     end
  936.     if Twilight == 'Twilight' then
  937.         equip(sets.Twilight)
  938.     end
  939. end
  940.  
  941.  
  942.  
  943.  
  944.  
  945. --   ***********all buff names must be in lowercase to work*************
  946. function buff_change(buff,gain)
  947.     buff = buff:lower();
  948.     if buff == "hasso" then
  949.         if hasso == nil then
  950.             hasso = 0
  951.         end
  952.         if gain then
  953.             seigan = 0
  954.             hasso = world.zone_id
  955.             add_to_chat(158,'HASSO: [ON]')
  956.         elseif not gain and world.zone_id == hasso then
  957.             add_to_chat(158,'HASSO: [OFF]')
  958.             windower.send_command('Hasso')
  959.         end
  960.     end
  961.    
  962.     -- if buff == "encumbrance" and not gain then
  963.             -- equip(sets.Twilight)
  964.     -- end
  965.    
  966.    
  967.     if buff == "seigan" then
  968.         if seigan == nil then
  969.             seigan = 0
  970.         end
  971.         if gain then
  972.             hasso = 0
  973.             seigan = world.zone_id
  974.             add_to_chat(158,'Seigan: [ON]')
  975.         elseif not gain and world.zone_id == seigan then
  976.             add_to_chat(158,'Seigan: [OFF]')
  977.             windower.send_command('Seigan')
  978.         end
  979.     end
  980.     if buff == "food" then
  981.         if fewd == nil then
  982.             fewd = 0
  983.         end
  984.         if gain then
  985.             fewd = world.zone_id
  986.         elseif not gain and world.zone_id == fewd then
  987.             add_to_chat(158,'FOOD: [OFF]')
  988.         end
  989.     end
  990.    
  991.     if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
  992.         if gain then
  993.             AM = 'on'
  994.             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.]')
  995.         else
  996.             AM = 'off'
  997.             send_command('timers delete "Aftermath: Lv.3"')
  998.             add_to_chat(123,'AM3: [OFF]')
  999.         end
  1000.     elseif buff == "perfect defense" then -- PD Timer --
  1001.         if gain then
  1002.             send_command('timers create "Perfect Defense" 57 down')
  1003.         else
  1004.             send_command('timers delete "Perfect Defense"')
  1005.             add_to_chat(123,'PD: [OFF]')
  1006.         end
  1007.     elseif buff == "yaegasumi" then -- Yaegasumi Timer --
  1008.         if gain then
  1009.             send_command('timers create "Yaegasumi" 45 down')
  1010.         else
  1011.             send_command('timers delete "Yaegasumi"')
  1012.             add_to_chat(123,'Yaegasumi: [OFF]')
  1013.         end
  1014.     elseif buff == 'weakness' then -- Weakness Timer --
  1015.         if gain then
  1016.             send_command('timers create "Weakness" 300 up')
  1017.         else
  1018.             send_command('timers delete "Weakness"')
  1019.         end
  1020.     end
  1021.     if buff == "sleep" then  -- Equip Vim Torque +1 When You Are Asleep & Have 200+ HP --
  1022.         if gain and player.status == "Engaged" then
  1023.             equip(sets.buffs.sleep)
  1024.             disable('neck')
  1025.         else
  1026.                 enable('neck')
  1027.                 status_change(player.status)
  1028.                 add_to_chat(158,'SLEEP IS OFF')
  1029.         end
  1030.     end
  1031.     if buff == 'doom' then
  1032.             if gain then
  1033.             disable('lring','rring')
  1034.             equip(sets.buffs.Doom)
  1035.             add_to_chat(123,'Doom rings ON')
  1036.            
  1037.             elseif not gain then
  1038.             enable('left_ring','right_ring')
  1039.             add_to_chat(123,'DOOM IS OFF')
  1040.             update_current_set()
  1041.             end
  1042.         end
  1043.    
  1044.    
  1045.         -- if buff == 'Reive Mark' then
  1046.             -- if gain then
  1047.                 -- send_command('gs disable neck')
  1048.                 -- equip(sets.buffs.reive)
  1049.                 -- add_to_chat(123,'Rieve started')
  1050.            
  1051.             -- elseif not gain then
  1052.                 -- enable('neck')
  1053.                 -- add_to_chat(123,'Reive over')
  1054.                 -- status_change(player.status)
  1055.             -- end
  1056.         -- end
  1057.         if (m_buff_change ~= nil) then
  1058.             m_buff_change(buff, gain);
  1059.         end
  1060. end
  1061.  
  1062. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  1063. function self_command(command)
  1064.      bri_command(command)
  1065.     if command == 'C1' then -- Accuracy Toggle --
  1066.         AccIndex = (AccIndex % #AccArray) + 1
  1067.         add_to_chat(158,'Accuracy Level: '..AccArray[AccIndex])
  1068.         WsAccIndex = (WsAccIndex % #WsAccArray) +1
  1069.         status_change(player.status)
  1070.         --END MANUAL CODE--
  1071.     elseif command == 'C17' then -- Main Weapon Toggle --
  1072.         WeaponIndex = (WeaponIndex % #WeaponArray) + 1
  1073.         add_to_chat(158,'Main Weapon: '..WeaponArray[WeaponIndex])
  1074.         status_change(player.status)
  1075.         if WeaponIndex == 1 then
  1076.             equip(sets.Main.Kogarasumaru)
  1077.             elseif WeaponIndex == 2 then
  1078.             equip(sets.Main.Dojikiri)
  1079.         end
  1080.     elseif command == 'C5' then -- Auto Update Gear Toggle --
  1081.         status_change(player.status)
  1082.         add_to_chat(158,'Auto Update Gear')
  1083.     elseif command == 'C7' then -- PDT Toggle --
  1084.         if Armor == 'PDT' then
  1085.             Armor = 'None'
  1086.             add_to_chat(123,'PDT Set: [Unlocked]')
  1087.         else
  1088.             Armor = 'PDT'
  1089.             add_to_chat(158,'PDT Set: [Locked]')
  1090.         end
  1091.         status_change(player.status)
  1092.     elseif command == 'C15' then -- MDT Toggle --
  1093.         if Armor == 'MDT' then
  1094.             Armor = 'None'
  1095.             add_to_chat(123,'MDT Set: [Unlocked]')
  1096.         else
  1097.             Armor = 'MDT'
  1098.             add_to_chat(158,'MDT Set: [Locked]')
  1099.         end
  1100.         status_change(player.status)
  1101.     elseif command == 'C16' then -- Seigan Toggle --
  1102.         if Seigan == 'ON' then
  1103.             Seigan  = 'OFF'
  1104.             add_to_chat(123,'Seigan Set: [Unlocked]')
  1105.         else
  1106.             Seigan = 'ON'
  1107.             add_to_chat(158,'Seigan Set: [Locked]')
  1108.         end
  1109.         status_change(player.status)
  1110.     elseif command == 'C12' then -- Third Eye Toggle --
  1111.         if Third_Eye == 'ON' then
  1112.             Third_Eye = 'OFF'
  1113.             add_to_chat(123,'Third Eye Set: [Unlocked]')
  1114.         else
  1115.             Third_Eye = 'ON'
  1116.             add_to_chat(158,'Third Eye Set: [Locked]')
  1117.         end
  1118.         status_change(player.status)
  1119.     elseif command == 'C11' then -- SAM Roll Toggle --
  1120.         if Samurai_Roll == 'ON' then
  1121.             Samurai_Roll = 'OFF'
  1122.             add_to_chat(123,'SAM Roll: [OFF]')
  1123.         else
  1124.             Samurai_Roll = 'ON'
  1125.             add_to_chat(158,'SAM Roll: [ON]')
  1126.         end
  1127.         status_change(player.status)
  1128.     elseif command == 'C9' then -- Attack Toggle --
  1129.         if Attack == 'ON' then
  1130.             Attack = 'OFF'
  1131.             add_to_chat(123,'Attack: [OFF]')
  1132.         else
  1133.             Attack = 'ON'
  1134.             add_to_chat(158,'Attack: [ON]')
  1135.         end
  1136.         status_change(player.status)
  1137.     elseif command == 'C3' then -- Twilight Toggle --
  1138.         if Twilight == 'Twilight' then
  1139.             Twilight = 'None'
  1140.             add_to_chat(123,'Twilight Set: [Unlocked]')
  1141.         else
  1142.             Twilight = 'Twilight'
  1143.             add_to_chat(158,'Twilight Set: [locked]')
  1144.         end
  1145.         status_change(player.status)
  1146.     elseif command == 'C8' then -- Distance Toggle --
  1147.         if player.target.distance then
  1148.             target_distance = math.floor(player.target.distance*10)/10
  1149.             add_to_chat(158,'Distance: '..target_distance)
  1150.         else
  1151.             add_to_chat(123,'No Target Selected')
  1152.         end
  1153.     elseif command == 'C10' then -- Cancel Meikyo Shisui --
  1154.         send_command('Cancel Meikyo Shisui')
  1155.         add_to_chat(123,'Meikyo Shisui: [OFF]')
  1156.     elseif command == 'C6' then -- Idle Toggle --
  1157.         IdleIndex = (IdleIndex % #IdleArray) + 1
  1158.         add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  1159.         status_change(player.status)
  1160.     elseif command == 'TP' then
  1161.         add_to_chat(158,'TP Return: ['..tostring(player.tp)..']')
  1162.     elseif command == 'vars' then
  1163.             windower.add_to_chat(158,string.format('[VariableCheck]: hasso [%d] -- haste%% [%s] count [%d] -- Acc [%s] -- SamRoll [%s] -- AM [%s] ',hasso, count_buffs(), count, AccArray[AccIndex], Samurai_Roll, AM));
  1164.     end
  1165.    
  1166.     if command == 'info' then
  1167.                 index_guy = 317 -- can put the index of a mob here if you just want other info
  1168.                 name_guy = "Orcish Fodder" -- put a name here for that if you want
  1169.                     if windower.ffxi.get_mob_by_target('t') ~= nil then
  1170.                      guy = windower.ffxi.get_mob_by_target('t')
  1171.                     elseif windower.ffxi.get_mob_by_index(index_guy) ~= nil then
  1172.                      guy = windower.ffxi.get_mob_by_index(index_guy)
  1173.                     elseif windower.ffxi.get_mob_by_name(name_guy) ~= nil then
  1174.                      guy = windower.ffxi.get_mob_by_name(name_guy)    
  1175.                     else
  1176.                     send_command('input /echo No target selected for Info')
  1177.                     return
  1178.                     end
  1179.                     if guy.valid_target == true then
  1180.                     valid = "TRUE"
  1181.                     else
  1182.                     valid = "FALSE"
  1183.                     end
  1184.                     local x = math.abs(player.x-guy.x)
  1185.                     local y = math.abs(player.y-guy.y)
  1186.                     local z = math.abs(player.z-guy.z)    
  1187.             windower.add_to_chat(50,guy.name..' Info!')
  1188.             windower.add_to_chat(50,'index '..guy.index..'  ID '..guy.id..'   movement speed '..guy.movement_speed..'  valid target? '..valid)
  1189.             windower.add_to_chat(50,'facing '..guy.heading..'   spawn type '..guy.spawn_type..'  status '..guy.status)
  1190.             windower.add_to_chat(50,'X: '..guy.x..'  Y: '..guy.y..'  Z: '..guy.z..'   race: '..guy.race)
  1191.             windower.add_to_chat(50,'DistX: '..x..'  DistY: '..y..'  DistZ: '..z..'  HP: '..guy.hpp)
  1192.         end
  1193.    
  1194. end
  1195.  
  1196. function refine_waltz(spell,action)
  1197.     if spell.type ~= 'Waltz' then
  1198.         return
  1199.     end
  1200.  
  1201.     if spell.name == "Healing Waltz" or spell.name == "Divine Waltz" then
  1202.         return
  1203.     end
  1204.  
  1205.     local newWaltz = spell.english
  1206.     local waltzID
  1207.  
  1208.     local missingHP
  1209.  
  1210.     if spell.target.type == "SELF" then
  1211.         missingHP = player.max_hp - player.hp
  1212.     elseif spell.target.isallymember then
  1213.         local target = find_player_in_alliance(spell.target.name)
  1214.         local est_max_hp = target.hp / (target.hpp/100)
  1215.         missingHP = math.floor(est_max_hp - target.hp)
  1216.     end
  1217.  
  1218.     if missingHP ~= nil then
  1219.         if player.sub_job == 'DNC' then
  1220.             if missingHP < 40 and spell.target.name == player.name then
  1221.                 add_to_chat(123,'Full HP!')
  1222.                 cancel_spell()
  1223.                 return
  1224.             elseif missingHP < 150 then
  1225.                 newWaltz = 'Curing Waltz'
  1226.                 waltzID = 190
  1227.             elseif missingHP < 300 then
  1228.                 newWaltz = 'Curing Waltz II'
  1229.                 waltzID = 191
  1230.             else
  1231.                 newWaltz = 'Curing Waltz III'
  1232.                 waltzID = 192
  1233.             end
  1234.         else
  1235.             return
  1236.         end
  1237.     end
  1238.  
  1239.     local waltzTPCost = {['Curing Waltz'] = 200, ['Curing Waltz II'] = 350, ['Curing Waltz III'] = 500}
  1240.     local tpCost = waltzTPCost[newWaltz]
  1241.  
  1242.     local downgrade
  1243.  
  1244.     if player.tp < tpCost then
  1245.  
  1246.         if player.tp < 200 then
  1247.             add_to_chat(123, 'Insufficient TP ['..tostring(player.tp)..']. Cancelling.')
  1248.             cancel_spell()
  1249.             return
  1250.         elseif player.tp < 350 then
  1251.             newWaltz = 'Curing Waltz'
  1252.         elseif player.tp < 500 then
  1253.             newWaltz = 'Curing Waltz II'
  1254.         end
  1255.  
  1256.         downgrade = 'Insufficient TP ['..tostring(player.tp)..']. Downgrading to '..newWaltz..'.'
  1257.     end
  1258.  
  1259.     if newWaltz ~= spell.english then
  1260.         send_command('@input /ja "'..newWaltz..'" '..tostring(spell.target.raw))
  1261.         if downgrade then
  1262.             add_to_chat(8, downgrade)
  1263.         end
  1264.         cancel_spell()
  1265.         return
  1266.     end
  1267.  
  1268.     if missingHP > 0 then
  1269.         add_to_chat(8,'Trying to cure '..tostring(missingHP)..' HP using '..newWaltz..'.')
  1270.     end
  1271. end
  1272.  
  1273. function find_player_in_alliance(name)
  1274.     for i,v in ipairs(alliance) do
  1275.         for k,p in ipairs(v) do
  1276.             if p.name == name then
  1277.                 return p
  1278.             end
  1279.         end
  1280.     end
  1281. end
  1282.  
  1283. function sub_job_change(newSubjob, oldSubjob)
  1284.     select_default_macro_book()
  1285. end
  1286.  
  1287. function set_macro_page(set,book)
  1288.     if not tonumber(set) then
  1289.         add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  1290.         return
  1291.     end
  1292.     if set < 1 or set > 10 then
  1293.         add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  1294.         return
  1295.     end
  1296.  
  1297.     if book then
  1298.         if not tonumber(book) then
  1299.             add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  1300.             return
  1301.         end
  1302.         if book < 1 or book > 20 then
  1303.             add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  1304.             return
  1305.         end
  1306.         send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  1307.     else
  1308.         send_command('@input /macro set '..tostring(set))
  1309.     end
  1310. end
  1311.  
  1312. function select_default_macro_book()
  1313.     -- Default macro set/book
  1314.     if player.sub_job == 'WAR' then
  1315.         set_macro_page(1, 3)
  1316.     elseif player.sub_job == 'DNC' then
  1317.         set_macro_page(1, 3)
  1318.     elseif player.sub_job == 'DRK' then
  1319.         set_macro_page(1, 3)
  1320.     elseif player.sub_job == 'NIN' then
  1321.         set_macro_page(1, 3)
  1322.     else
  1323.         set_macro_page(1, 3)
  1324.     end
  1325. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement