SHARE
TWEET

DRG.lua 16th Feb, 2019

Spicyryan Mar 21st, 2017 (edited) 2,786 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Built off of my BLU and RUN GSs.
  2. ---Thanks to various sources such as LS members and BlueGartr for the help building this GearSwap.
  3.  
  4. -------------------------------------
  5. ---------                   ---------
  6. ------                         ------
  7. ---         Start of Gear         ---
  8. ------                         ------
  9. ---------                   ---------
  10. -------------------------------------
  11.  
  12. ---------------------------------
  13. --   Start of Augmented Gear   --
  14. ---------------------------------
  15.  
  16. function get_sets()
  17.     maps()
  18.    
  19.     CarmineMask = {}
  20.     CarmineMask.MND = { name = "Carmine Mask +1", augments = { 'Accuracy+12','DEX+12','MND+20', } }
  21.     CarmineMask.FC = { name = "Carmine Mask +1", augments = { 'Accuracy+20','Mag. Acc.+12','"Fast Cast"+4', } }
  22.  
  23.     ValorousMask = {}
  24.     ValorousMask.SCD = { name="Valorous Mask", augments={'Attack+20','Sklchn.dmg.+4%','STR+15','Accuracy+9',}}
  25.     ValorousMask.WSD = { name="Valorous Mask", augments={'Attack+23','Weapon skill damage +4%','STR+10','Accuracy+7',}}
  26.     ValorousMask.DA = { name="Valorous Mask", augments={'Mag. Acc.+11','"Dbl.Atk."+4','STR+15','Accuracy+5',}}
  27.    
  28.     ValorousMitts = {}
  29.     ValorousMitts.SCDAcc = { name="Valorous Mitts", augments={'Accuracy+20','Sklchn.dmg.+4%','STR+13',}}
  30.     ValorousMitts.WSD = { name="Valorous Mitts", augments={'Weapon skill damage +3%','STR+8','Attack+14',}}
  31.    
  32.     AcroGauntlets = {}
  33.     AcroGauntlets.STP = { name="Acro Gauntlets", augments={'Accuracy+20 Attack+20','"Store TP"+6','STR+6 DEX+6',}}
  34.     AcroGauntlets.Breath = { name="Acro Gauntlets", augments={'Pet: Breath+7',}}
  35.    
  36.     TaeonBody = {}
  37.     TaeonBody.FC = { name="Taeon Tabard", augments={'Accuracy+23','"Fast Cast"+5','HP+36',} }
  38.     TaeonBody.SIR = { name="Taeon Tabard", augments = {'Spell interruption rate down -8%','STR+7 VIT+7'} }
  39.    
  40.     ValorousBody = {}
  41.     ValorousBody.STP = { name="Valorous Mail", augments={'"Store TP"+7','DEX+8','Accuracy+15',}}
  42.     ValorousBody.WSD = { name="Valorous Mail", augments={'STR+7','Pet: DEX+7','Weapon skill damage +6%','Mag. Acc.+11 "Mag.Atk.Bns."+11',}}
  43.     ValorousBody.STRDA = { name="Valorous Mail", augments={'Accuracy+23 Attack+23','"Dbl.Atk."+4','STR+10','Attack+8',}}
  44.     ValorousBody.DA = { name="Valorous Mail", augments={'Accuracy+22','"Dbl.Atk."+5','STR+5','Attack+12',}}
  45.    
  46.     ValorousHose = {}
  47.     ValorousHose.STP = { name="Valor. Hose", augments={'Accuracy+21','"Store TP"+8','VIT+6','Attack+15',}}
  48.     ValorousHose.WSD = { name="Valor. Hose", augments={'Weapon skill damage +5%','STR+8','Accuracy+2','Attack+13',}}
  49.     ValorousHose.SCD = { name="Valor. Hose", augments={'Attack+22','Sklchn.dmg.+3%','STR+9','Accuracy+12',}}
  50.    
  51.     ValorousFeet = {}
  52.    
  53.     LustFeet = {}
  54.     LustFeet.STRDA = { name="Lustra. Leggings +1", augments={'Attack+20','STR+8','"Dbl.Atk."+3',}}
  55.  
  56.     Brig = {}
  57.     Brig.STP = { name="Brigantia's Mantle", augments = { 'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10','Pet: "Regen"+5', } }
  58.     Brig.DATP = { name="Brigantia's Mantle", augments = {'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10', } }
  59.     Brig.STRDA = { name="Brigantia's Mantle", augments = { 'STR+20','Accuracy+20 Attack+20','STR+10','"Dbl.Atk."+10', } }
  60.     Brig.WSD = { name = "Brigantia's Mantle", augments = { 'STR+20', 'Accuracy+20 Attack+20', 'Weapon skill damage +10%', } }
  61.     Brig.FCMeva = { name = "Brigantia's Mantle", augments = { 'HP+60','Eva.+20 /Mag. Eva.+20','"Fast Cast"+10', } }
  62.    
  63. -------------------------------
  64. --   End of Augmented Gear   --
  65. -------------------------------
  66.  
  67.     sets.Idle = {}
  68.     --Idle Sets--
  69.     sets.Idle.index = { 'Standard', 'DT' }
  70.     Idle_ind = 1
  71.     sets.Idle.Standard = {
  72.         ammo = "Staunch Tathlum +1",
  73.         head = ValorousMask.SCD,
  74.         neck = "Loricate Torque +1",
  75.         ear1 = "Etiolation Earring",
  76.         ear2 = "Anastasi Earring",
  77.         body = "Vishap Mail +3",
  78.         hands = "Sulevia's Gauntlets +2",
  79.         ring1 = "Sheltered ring",
  80.         ring2 = "Karieyh Ring +1",
  81.         back = Brig.STP,
  82.         waist = "Flume Belt",
  83.         legs = "Carmine Cuisses +1",
  84.         feet = "Ptero. Greaves +3"
  85.     }
  86.    
  87.     sets.Idle.DT = {
  88.         ammo = "Staunch Tathlum +1",
  89.         head = ValorousMask.SCD,
  90.         neck = "Loricate Torque +1",
  91.         ear1 = "Etiolation Earring",
  92.         ear2 = "Anastasi Earring",
  93.         body = "Arke Corazza",
  94.         hands = "Sulevia's Gauntlets +2",
  95.         ring1 = "Sheltered ring",
  96.         ring2 = "Defending Ring",
  97.         back = Brig.DATP,
  98.         waist = "Flume Belt",
  99.         legs = "Carmine Cuisses +1",
  100.         feet = "Emicho Gambieras +1"
  101.     }
  102.    
  103.     --Dat Waifu--
  104.     sets.Idle.Town = set_combine(sets.Idle.Standard, {
  105.         ring1 = "Matrimony ring",
  106.     })
  107.    
  108.     --Idle Refresh--
  109.     sets.Idle.Refresh = {
  110.         head = "Jumalik Helm",
  111.         body = "Chozoron Coselete"
  112.     }
  113.    
  114.     --Best in slot items depend on Acc and if you have SAMs roll or not.
  115.     --Unless the extra accuracy from something like the Shulmanu Collar comes into play.
  116.    
  117.     -----------
  118.     --TP Sets--
  119.     -----------
  120.     sets.TP = {}
  121.     sets.TP.index = {'CappedHaste', 'AccuracyLite', 'AccuracyMid', 'AccuracyFull' }
  122.     TP_ind = 1
  123.  
  124.     sets.TP.CappedHaste = {
  125.         ammo = "Ginsen",
  126.         head = "Flamma Zucchetto +2",
  127.         neck = "Anu Torque",
  128.         ear1 = "Telos Earring",
  129.         ear2 = "Sherida Earring",
  130.         body = ValorousBody.STP,
  131.         --hands = "Flamma Manopolas +2",
  132.         hands = AcroGauntlets.STP,
  133.         ring1 = "Niqmaddu Ring",
  134.         ring2 = "Petrov Ring",
  135.         back = Brig.DATP,
  136.         waist = "Ioskeha Belt +1",
  137.         legs = ValorousHose.STP,
  138.         feet = "Flamma Gambieras +2"
  139.     }
  140.    
  141.     sets.TP.AccuracyLite = {
  142.         ammo = "Ginsen",
  143.         head = "Flamma Zucchetto +2",
  144.         neck = "Combatant's Torque",
  145.         ear1 = "Telos Earring",
  146.         ear2 = "Sherida Earring",
  147.         body = ValorousBody.STP,
  148.         --hands = "Flamma Manopolas +2",
  149.         hands = AcroGauntlets.STP,
  150.         ring1 = "Niqmaddu Ring",
  151.         ring2 = "Flamma Ring",
  152.         back = Brig.DATP,
  153.         waist = "Ioskeha Belt +1",
  154.         legs = ValorousHose.STP,
  155.         feet = "Flamma Gambieras +2"
  156.     }
  157.  
  158.     sets.TP.AccuracyMid = {
  159.         ammo = "Ginsen",
  160.         head = "Flamma Zucchetto +2",
  161.         neck = "Combatant's Torque",
  162.         ear1 = "Telos Earring",
  163.         ear2 = "Sherida Earring",
  164.         body = ValorousBody.STP,
  165.         hands = "Flamma Manopolas +2",
  166.         ring1 = "Niqmaddu Ring",
  167.         ring2 = "Flamma Ring",
  168.         back = Brig.DATP,
  169.         waist = "Ioskeha Belt +1",
  170.         legs = "Pteroslaver Brais +3",
  171.         feet = "Flamma Gambieras +2"
  172.     }
  173.  
  174.     sets.TP.AccuracyFull = {
  175.         ammo = "Amar Cluster",
  176.         head = "Flamma Zucchetto +2",
  177.         neck = "Shulmanu Collar",
  178.         ear1 = "Telos Earring",
  179.         ear2 = "Sherida Earring",
  180.         body = "Vishap Mail +3",
  181.         hands = "Emicho Gauntlets +1",
  182.         ring1 = "Niqmaddu Ring",
  183.         ring2 = "Flamma Ring",
  184.         back = Brig.STP,
  185.         waist = "Ioskeha Belt +1",
  186.         legs = "Pteroslaver Brais +3",
  187.         feet = "Flamma Gambieras +2"
  188.     }
  189.    
  190.      --SAM Roll--
  191.      --Changes gearsets while Samurai Roll is on
  192.    
  193.     sets.SAMRoll = {}
  194.     sets.SAMRoll.index = { 'CappedHaste', 'AccuracyLite', 'AccuracyMid', 'AccuracyFull' }
  195.     SAMRoll_ind = 1 -- In the same rule as the TP Toggle so it toggles it at the same time
  196.  
  197.     sets.SAMRoll.CappedHaste = set_combine(sets.TP.CappedHaste, {        
  198.         neck = "Ganesha's Mala",
  199.         ear1 = "Brutal Earring",
  200.         body = "Dagon Breastplate",
  201.         hands = "Sulevia's Gauntlets +2",
  202.         back = Brig.DATP,
  203.     })
  204.  
  205.     sets.SAMRoll.AccuracyLite = set_combine(sets.TP.AccuracyLite, {        
  206.         neck = "Shulmanu Collar",
  207.         ear1 = "Cessance Earring",
  208.         body = "Dagon Breastplate",
  209.         hands = "Sulevia's Gauntlets +2",
  210.         back = Brig.DATP,
  211.     })
  212.  
  213.     sets.SAMRoll.AccuracyMid = set_combine(sets.TP.AccuracyMid, {        
  214.         neck = "Shulmanu Collar",
  215.         body = "Dagon Breastplate",
  216.         hands = "Sulevia's Gauntlets +2",
  217.         back = Brig.DATP,
  218.     })
  219.  
  220.     sets.SAMRoll.AccuracyFull = set_combine(sets.TP.AccuracyFull, {        
  221.         neck = "Shulmanu Collar",
  222.         hands = "Sulevia's Gauntlets +2",
  223.         back = Brig.DATP,
  224.     })
  225.    
  226.      --DT Sets--
  227.     sets.DT = {}
  228.     sets.DT.index = { 'DT', 'DTHybrid', 'MDTV', 'MEVA', 'DTPet', 'DTAcc' }
  229.     DT_ind = 1
  230.    
  231.     sets.DT.DT = {
  232.         ammo = "Staunch Tathlum +1",
  233.         head = "Sulevia's Mask +2",
  234.         neck = "Loricate Torque +1",
  235.         ear1 = "Genmei Earring",
  236.         ear2 = "Telos Earring",
  237.         body = ValorousBody.STP,
  238.         hands = "Sulevia's Gauntlets +2",
  239.         ring1 = "Defending Ring",
  240.         ring2 = "Niqmaddu Ring",
  241.         back = Brig.DATP,
  242.         waist = "Ioskeha Belt +1",
  243.         legs = "Sulevia's Cuisses +2",
  244.         feet = "Flamma Gambieras +2"
  245.     }
  246.    
  247.     sets.DT.DTHybrid = {
  248.         ammo = "Staunch Tathlum +1",
  249.         head = "Flamma Zucchetto +2",
  250.         neck = "Loricate Torque +1",
  251.         ear1 = "Telos Earring",
  252.         ear2 = "Sherida Earring",
  253.         body = ValorousBody.STP,
  254.         hands = "Sulevia's Gauntlets +2",
  255.         ring1 = "Defending Ring",
  256.         ring2 = "Niqmaddu Ring",
  257.         back = Brig.DATP,
  258.         waist = "Ioskeha Belt +1",
  259.         legs = "Sulevia's Cuisses +2",
  260.         feet = "Flamma Gambieras +2"
  261.     }
  262.     --Shell V on. Need 23% when 5/5 with pants, 21% with sheltered ring (24 with sheltered and trust)--
  263.         sets.DT.MDTV = {
  264.         ammo = "Staunch Tathlum +1",
  265.         head = "Flamma Zucchetto +2",
  266.         neck = "Warder's Charm +1",
  267.         ear1 = "Eabani Earring",
  268.         ear2 = "Sherida Earring",
  269.         body = ValorousBody.STP,
  270.         hands = "Sulevia's Gauntlets +2",
  271.         ring1 = "Defending Ring",
  272.         ring2 = "Shadow Ring",
  273.         back = Brig.FCMeva,
  274.         waist = "Ioskeha Belt +1",
  275.         legs = "Sulevia's Cuisses +2",
  276.         feet = "Flamma Gambieras +2"
  277.     }
  278.    
  279.     sets.DT.MEVA = {
  280.         ammo = "Staunch Tathlum +1",
  281.         head = "Flamma Zucchetto +2",
  282.         neck = "Warder's Charm +1",
  283.         ear1 = "Eabani Earring",
  284.         ear2 = "Odnowa Earring +1",
  285.         body = "Chozoron Coselete",
  286.         hands = "Leyline Gloves",
  287.         ring1 = "Defending Ring",
  288.         ring2 = "Purity Ring",
  289.         back = Brig.FCMeva,
  290.         waist = "Carrier's Sash",
  291.         legs = "Vishap Brais +3",
  292.         feet = "Flamma Gambieras +2"
  293.     }
  294.    
  295.     sets.DT.DTPet = {
  296.         ammo = "Staunch Tathlum +1",
  297.         head = "Peltast's Mezail +1",
  298.         neck = "Loricate Torque +1",
  299.         ear1 = "Genmei Earring",
  300.         ear2 = "Enmerkar Earring",
  301.         body = "Arke Corazza",
  302.         hands = "Sulevia's Gauntlets +2",
  303.         ring1 = "Defending Ring",
  304.         ring2 = "Gelatinous Ring +1",
  305.         back = "Updraft Mantle",
  306.         waist = "Ioskeha Belt +1",
  307.         legs = "Sulevia's Cuisses +2",
  308.         feet = "Flamma Gambieras +2"
  309.     }
  310.    
  311.     sets.DT.DTAcc = {
  312.         ammo = "Staunch Tathlum +1",
  313.         head = "Flamma Zucchetto +2",
  314.         neck = "Loricate Torque +1",
  315.         ear1 = "Telos Earring",
  316.         ear2 = "Sherida Earring",
  317.         body = "Vishap Mail +3",
  318.         hands = "Sulevia's Gauntlets +2",
  319.         ring1 = "Defending Ring",
  320.         ring2 = "Niqmaddu Ring",
  321.         back = Brig.DATP,
  322.         waist = "Ioskeha Belt +1",
  323.         legs = "Sulevia's Cuisses +2",
  324.         feet = "Flamma Gambieras +2"
  325.     }
  326.    
  327.     sets.WS = {}
  328.  
  329.     sets.Stardiver = {}
  330.  
  331.     sets.Stardiver.index = { 'Attack', 'MidAcc', 'HighAcc' }
  332.     Stardiver_ind = 1
  333.    
  334.     --1118 Acc, Lowest TP set is 1161, be careful--
  335.     sets.Stardiver.Attack = {
  336.         ammo = "Knobkierrie",
  337.         head = "Pteroslaver Armet +3",
  338.         neck = "Fotia Gorget",
  339.         ear1 = "Moonshade Earring",
  340.         ear2 = "Sherida Earring",
  341.         body = "Dagon Breastplate",
  342.         hands = "Sulevia's Gauntlets +2",
  343.         ring1 = "Regal Ring",
  344.         ring2 = "Niqmaddu Ring",
  345.         back = Brig.STRDA,
  346.         waist = "Fotia Belt",
  347.         legs = "Sulevia's Cuisses +2",
  348.         feet = LustFeet.STRDA
  349.     }
  350.    
  351.     sets.Stardiver.MidAcc = {
  352.         ammo = "Amar Cluster",
  353.         head = "Flamma Zucchetto +2",
  354.         neck = "Fotia Gorget",
  355.         ear1 = "Moonshade Earring",
  356.         ear2 = "Sherida Earring",
  357.         body = "Dagon Breastplate",
  358.         hands = "Sulevia's Gauntlets +2",
  359.         ring1 = "Regal Ring",
  360.         ring2 = "Niqmaddu Ring",
  361.         back = Brig.STRDA,
  362.         waist = "Fotia Belt",
  363.         legs = "Sulevia's Cuisses +2",
  364.         feet = "Flamma Gambieras +2"  
  365.     }
  366.  
  367.     sets.Stardiver.HighAcc = {
  368.         ammo = "Amar Cluster",
  369.         head = "Pteroslaver Armet +3",
  370.         neck = "Fotia Gorget",
  371.         ear1 = "Moonshade Earring",
  372.         ear2 = "Sherida Earring",
  373.         body = "Dagon Breastplate",
  374.         hands = "Sulevia's Gauntlets +2",
  375.         ring1 = "Regal Ring",
  376.         ring2 = "Niqmaddu Ring",
  377.         back = Brig.STRDA,
  378.         waist = "Fotia Belt",
  379.         legs = "Vishap Brais +3",
  380.         feet = "Vishap Greaves +3"
  381.     }
  382.  
  383.     sets.Drakesbane = {}
  384.  
  385.     sets.Drakesbane.index = { 'Attack', 'MidAcc', 'HighAcc' }
  386.     Drakesbane_ind = 1
  387.  
  388.     sets.Drakesbane.Attack = {
  389.         ammo = "Knobkierrie",
  390.         head = "Pteroslaver Armet +3",
  391.         neck = "Fotia Gorget",
  392.         ear1 = "Brutal Earring",
  393.         ear2 = "Sherida Earring",
  394.         body = "Dagon Breastplate",
  395.         hands = "Flamma Manopolas +2",
  396.         ring1 = "Niqmaddu Ring",
  397.         ring2 = "Begrudging Ring",
  398.         back = Brig.STRDA,
  399.         waist = "Windbuffet Belt +1",
  400.         legs = "Peltast's Cuissots +1",
  401.         feet = LustFeet.STRDA
  402.     }
  403.    
  404.     sets.Drakesbane.MidAcc = {
  405.         ammo = "Knobkierrie",
  406.         head = "Flamma Zucchetto +2",
  407.         neck = "Fotia Gorget",
  408.         ear1 = "Brutal Earring",
  409.         ear2 = "Sherida Earring",
  410.         body = "Dagon Breastplate",
  411.         hands = "Flamma Manopolas +2",
  412.         ring1 = "Niqmaddu Ring",
  413.         ring2 = "Begrudging Ring",
  414.         back = Brig.STRDA,
  415.         waist = "Ioskeha Belt +1",
  416.         legs = "Peltast's Cuissots +1",
  417.         feet = "Flamma Gambieras +2"
  418.     }
  419.    
  420.     sets.Drakesbane.HighAcc = {
  421.         ammo = "Knobkierrie",
  422.         head = "Flamma Zucchetto +2",
  423.         neck = "Fotia Gorget",
  424.         ear1 = "Brutal Earring",
  425.         ear2 = "Sherida Earring",
  426.         body = "Dagon Breastplate",
  427.         hands = "Flamma Manopolas +2",
  428.         ring1 = "Niqmaddu Ring",
  429.         ring2 = "Regal Ring",
  430.         back = Brig.STRDA,
  431.         waist = "Ioskeha Belt +1",
  432.         legs = "Vishap Brais +3",
  433.         feet = "Vishap Greaves +3"
  434.     }
  435.  
  436.     sets.CamlannsTorment = {}
  437.  
  438.     sets.CamlannsTorment.index = { 'Attack', 'Accuracy' }
  439.     CamlannsTorment_ind = 1
  440.  
  441.     sets.CamlannsTorment.Attack = {
  442.         ammo = "Knobkierrie",
  443.         head = ValorousMask.WSD,
  444.         neck = "Fotia Gorget",
  445.         ear1 = "Ishvara Earring",
  446.         ear2 = "Sherida Earring",
  447.         body = ValorousBody.WSD,
  448.         hands = "Pteroslaver Finger Gauntlets +3",
  449.         ring1 = "Niqmaddu Ring",
  450.         ring2 = "Karieyh Ring +1",
  451.         back = Brig.WSD,
  452.         waist = "Fotia Belt",
  453.         legs = "Vishap Brais +3",
  454.         feet = "Sulevia's Leggings +2"
  455.     }      
  456.                                
  457.     sets.CamlannsTorment.Accuracy = {
  458.         ammo = "Knobkierrie",
  459.         head = ValorousMask.WSD,
  460.         neck = "Fotia Gorget",
  461.         ear1 = "Telos Earring",
  462.         ear2 = "Sherida Earring",
  463.         body = ValorousBody.WSD,
  464.         hands = "Pteroslaver Finger Gauntlets +3",
  465.         ring1 = "Niqmaddu Ring",
  466.         ring2 = "Karieyh Ring +1",
  467.         back = Brig.WSD,
  468.         waist = "Fotia Belt",
  469.         legs = "Vishap Brais +3",
  470.         feet = "Sulevia's Leggings +2"
  471.     }
  472.    
  473.     sets.SonicThrust = {}
  474.  
  475.     sets.SonicThrust.index = { 'Attack', 'Accuracy' }
  476.     SonicThrust_ind = 1
  477.     sets.SonicThrust.Attack = {
  478.         ammo = "Knobkierrie",
  479.         head = ValorousMask.WSD,
  480.         neck = "Fotia Gorget",
  481.         ear1 = "Moonshade Earring",
  482.         ear2 = "Sherida Earring",
  483.         body = ValorousBody.WSD,
  484.         hands = "Pteroslaver Finger Gauntlets +3",
  485.         ring1 = "Niqmaddu Ring",
  486.         ring2 = "Regal Ring",
  487.         back = Brig.WSD,
  488.         waist = "Fotia Belt",
  489.         legs = "Vishap Brais +3",
  490.         feet = "Sulevia's Leggings +2"
  491.     }
  492.    
  493.     sets.SonicThrust.Accuracy = {
  494.         ammo = "Knobkierrie",
  495.         head = ValorousMask.WSD,
  496.         neck = "Fotia Gorget",
  497.         ear1 = "Moonshade Earring",
  498.         ear2 = "Sherida Earring",
  499.         body = "Sulevia's Platemail +2",
  500.         hands = "Pteroslaver Finger Gauntlets +3",
  501.         ring1 = "Niqmaddu Ring",
  502.         ring2 = "Regal Ring",
  503.         back = Brig.WSD,
  504.         waist = "Fotia Belt",
  505.         legs = "Vishap Brais +3",
  506.         feet = "Sulevia's Leggings +2"
  507.     }
  508.  
  509.     sets.LegSweep = {
  510.         ammo = "Pemphredo Tathlum",
  511.         head = "Flamma Zucchetto +2",
  512.         neck = "Fotia Gorget",
  513.         ear1 = "Moonshade Earring",
  514.         ear2 = "Dignitary's Earring",
  515.         body = "Vishap Mail +3",
  516.         hands = "Flamma Manopolas +2",
  517.         ring1 = "Regal Ring",
  518.         ring2 = "Flamma Ring",
  519.         back = Brig.STRDA,
  520.         waist = "Fotia Belt",
  521.         legs = "Pteroslaver Brais +3",
  522.         feet = "Flamma Gambieras +2"
  523.     }
  524.    
  525.     --SC DMG Sets-- 34%
  526.     sets.SCDmg = {
  527.         head = ValorousMask.SCD,
  528.         body = "Sulevia's Platemail +2",
  529.         hands = ValorousMitts.SCDAcc,
  530.         ring2 = "Mujin Band",      
  531.         legs = ValorousHose.SCD,
  532.         feet = "Emicho Gambieras +1"
  533.     }
  534.    
  535.     --When Allies is on, assumes 20% is being given, caps 50%--
  536.     sets.SCDmgAllies = {
  537.         body = "Sulevia's Platemail +2",
  538.         hands = ValorousMitts.SCDAcc,
  539.         ring2 = "Mujin Band",      
  540.         legs = ValorousHose.SCD,
  541.         feet = "Emicho Gambieras +1"
  542.     }
  543.    
  544. -------------------------
  545. --   Blue Magic Sets   --
  546. -------------------------
  547.     sets.BlueMagic = {}
  548.  
  549.     sets.BlueMagic.STR = {
  550.         ammo = "Floestone",
  551.         head = ValorousMask.SCD,
  552.         neck = "Caro Necklace",
  553.         ear1 = "Telos Earring",
  554.         ear2 = "Sherida Earring",
  555.         body = "Sulevia's Platemail +2",
  556.         hands = "Sulevia's Gauntlets +2",
  557.         ring1 = "Shukuyu Ring",
  558.         ring2 = "Regal Ring",
  559.         back = Brig.STRDA,
  560.         waist = "Prosilio Belt +1",
  561.         legs = "Sulevia's Cuisses +2",
  562.         feet = "Sulevia's Leggings +2"
  563.     }
  564.    
  565. --------------------------
  566. --   Curing Magic Set   --
  567. --------------------------
  568.    
  569.     sets.Cures = {
  570.         ammo = "",
  571.         head = "",
  572.         neck = "",
  573.         ear1 = "",
  574.         ear2 = "",
  575.         body = "",
  576.         hands = "",
  577.         ring1 = "",
  578.         ring2 = "",
  579.         back = "",
  580.         waist = "",
  581.         legs = "",
  582.         feet = ""
  583.     }
  584. ----------------------
  585. --   Utility Sets   --
  586. -----------------------
  587. --   Sets for one thing or another.
  588. --   Macro in game with:
  589.  
  590. --   /console gs equip sets.butts.andfronts
  591. --   /console gs c lockgearindex
  592.  
  593.     sets.Utility = {}
  594.  
  595.     sets.Utility.Steps = set_combine(sets.TP.AccuracyFull, {})
  596.  
  597.     sets.Utility.Twilight = {
  598.         head = "Twilight Helm",
  599.         body = "Twilight Mail"
  600.     }
  601.    
  602.     sets.Utility.Doom = {
  603.         ring1 = "Purity Ring",
  604.         ring2 = "Saida Ring",
  605.         waist = "Gishdubar Sash"
  606.     }
  607.    
  608.     sets.WSDayBonus = (set_combine(equipSet,{head="Gavialis Helm"}))
  609.    
  610.     sets.Utility.TH = {
  611.         waist = "Chaac Belt"
  612.     }
  613.    
  614.     sets.Utility.DerpDT = {
  615.         ammo = "Staunch Tathlum +1",
  616.         head = "Sulevia's Mask +2",
  617.         neck = "Loricate Torque +1",
  618.         ear1 = "Etiolation Earring",
  619.         ear2 = "Odnowa Earring +1",
  620.         body = "Sulevia's Platemail +2",
  621.         hands = "Sulevia's Gauntlets +2",
  622.         ring1 = "Defending Ring",
  623.         ring2 = "Gelatinous Ring +1",
  624.         back = Brig.FCMeva,
  625.         waist = "Ioskeha Belt +1",
  626.         legs = "Sulevia's Cuisses +2",
  627.         feet = "Flamma Gambieras +2"
  628.     }
  629.    
  630.     --Shell II only--
  631.     sets.Utility.MDTII = {
  632.         ammo = "",
  633.         head = "",
  634.         neck = "",
  635.         ear1 = "",
  636.         ear2 = "",
  637.         body = "",
  638.         hands = "",
  639.         ring1 = "",
  640.         ring2 = "",
  641.         back = "",
  642.         waist = "",
  643.         legs = "",
  644.         feet = ""
  645.     }
  646.  
  647.     --No Shell--
  648.     sets.Utility.MDTNO = {
  649.         ammo = "",
  650.         head = "",
  651.         neck = "",
  652.         ear1 = "",
  653.         ear2 = "",
  654.         body = "",
  655.         hands = "",
  656.         ring1 = "",
  657.         ring2 = "",
  658.         back = "",
  659.         waist = "",
  660.         legs = "",
  661.         feet = ""
  662.     }
  663.  
  664. ---------------------
  665. --   Enmity Set   --
  666. ---------------------
  667.  
  668.     sets.Enmity = {
  669.         ammo = "",
  670.         head = "",
  671.         neck = "",
  672.         ear1 = "",
  673.         ear2 = "",
  674.         body = "",
  675.         hands = "",
  676.         ring1 = "",
  677.         ring2 = "",
  678.         back = "",
  679.         waist = "",
  680.         legs = "",
  681.         feet = ""
  682.     }
  683.    
  684. ------------------------
  685. --   Enhancing Sets   --
  686. ------------------------
  687.    
  688.     sets.Enhancing = {}
  689.    
  690.     sets.Enhancing.Skill = {
  691.         ammo = "",
  692.         head = "",
  693.         neck = "",
  694.         ear1 = "",
  695.         ear2 = "",
  696.         body = "",
  697.         hands = "",
  698.         ring1 = "",
  699.         ring2 = "",
  700.         back = "",
  701.         waist = "",
  702.         legs = "",
  703.         feet = ""
  704.     }
  705.    
  706.     sets.Enhancing.Phalanx = set_combine(sets.Enhancing.Skill, {
  707.     })
  708.    
  709.     sets.Enhancing.Refresh = set_combine(sets.Enhancing.Skill, {
  710.         waist = "Gishdubar Sash",
  711.     })
  712.    
  713.     sets.Enhancing.Regen = set_combine(sets.Enhancing.Skill, {
  714.         --feet = "Taeon Boots",
  715.     })
  716.    
  717.     sets.Enhancing.ProShell = set_combine(sets.Enhancing.Skill, {
  718.         ring2 = "Sheltered Ring",
  719.     })
  720.    
  721. ------------------------
  722. --   Healing Breath   --
  723. ------------------------
  724.  
  725.     sets.HB = {}
  726.     --Midcast Set for HB spell triggers--
  727.     sets.HB.Trigger = {
  728.         ammo = "Staunch Tathlum +1",
  729.         head = "Vishap Armet",
  730.         neck = "Sanctity Necklace",
  731.         ear1 = "Etiolation Earring",
  732.         ear2 = "Eabani Earring",
  733.         body = TaeonBody.FC,
  734.         hands = "Emicho Gauntlets +1",
  735.         ring1 = "Etana Ring",
  736.         ring2 = "Gelatinous Ring +1",
  737.         waist = "Carrier's Sash",
  738.         legs = "Vishap Brais +3",
  739.         back = "Moonbeam Cape"
  740.     }
  741.    
  742.     --The Freshmaker--
  743.     sets.HB.Mentos = {
  744.         head = "Pteroslaver Armet +3",
  745.         ear2 = "Anastasi Earring",
  746.         body = "Acro Surcoat",
  747.         hands = "Despair Finger Gauntlets",
  748.         legs = "Vishap Brais +3",
  749.         feet = "Ptero. Greaves +3",
  750.         back = "Updraft Mantle"
  751.     }
  752.    
  753.     --Elemental Breath--
  754.     sets.HB.Ricola = {
  755.         head = "Pteroslaver Armet +3",
  756.         body = "Acro Surcoat",
  757.         hands = AcroGauntlets.Breath,
  758.         legs = "Acro Breeches",
  759.         feet = "Acro Leggings",
  760.         back = "Updraft Mantle"
  761.     }
  762.    
  763. -------------------------- 
  764. --   Job Ability Sets   --
  765. --------------------------
  766.     sets.JA = {}
  767.  
  768.     sets.JA.SpiritSurge = {
  769.         body = "Pteroslaver Mail +3"
  770.     }
  771.  
  772.     sets.JA.CallWyvern = {
  773.         hands = "Pteroslaver Mail +3"
  774.     }
  775.    
  776.     sets.JA.AncientCircle = {
  777.         legs = "Vishap Brais +3"
  778.     }
  779.    
  780.     sets.JA.SpiritLink = {
  781.         head = "Vishap Armet",
  782.         ear1 = "Pratik Earring",
  783.         hands = "Peltast's Vambraces",
  784.         feet = "Ptero. Greaves +3"
  785.     }
  786.    
  787.     sets.JA.Angon = {
  788.         hands = "Pteroslaver Finger Gauntlets +3"
  789.     }
  790.     --If you actually use DB then you will need to make a buff active rule to make it active--
  791.     sets.JA.DeepBreathing = {
  792.         head = "Pteroslaver Armet +3"
  793.     }
  794.  
  795. ----------------------
  796. --   Precast Sets   --
  797. ----------------------
  798.     sets.precast = {}
  799.    
  800.     sets.precast.FastCast = {}
  801.  
  802.     sets.precast.FastCast.Standard = {
  803.         ammo = "Sapience Orb",
  804.         head = CarmineMask.MND,
  805.         neck = "Orunmila's Torque",
  806.         ear1 = "Etiolation Earring",
  807.         ear2 = "Loquac. Earring",
  808.         body = TaeonBody.FC,
  809.         hands = "Leyline Gloves",
  810.         ring1 = "Prolix Ring",
  811.         ring2 = "Rahab Ring",
  812.         back = Brig.FCMeva,
  813.         legs = "Enif Cosciales",
  814.         feet = "Carmine Greaves +1"
  815.     }
  816.    
  817. end
  818.  
  819. ---End of Gear---------------------------------------------------------------------------------------------------------------------------------------------------------
  820.  
  821. -------------------------------------
  822. ---------                   ---------
  823. ------                         ------
  824. ---         Start of Maps         ---
  825. ------                         ------
  826. ---------                   ---------
  827. -------------------------------------
  828.  
  829. -------------------------
  830. --   BLU Spells List   --
  831. -------------------------
  832.  
  833. function maps()
  834.     PhysicalSpells = S {
  835.         'Bludgeon', 'Body Slam', 'Feather Storm', 'Mandibular Bite', 'Queasyshroom',
  836.         'Screwdriver', 'Sickle Slash', 'Smite of Rage', 'Power Attack',
  837.         'Terror Touch', 'Battle Dance', 'Claw Cyclone', 'Grand Slam',
  838.         'Jet Stream', 'Pinecone Bomb', 'Wild Oats', 'Uppercut'
  839.     }
  840.  
  841.     MagicalSpells = S {}
  842.    
  843.     BlueMagic_Buffs = S {
  844.         'Refueling'
  845.     }
  846.  
  847.     BlueMagic_Healing = S {
  848.         'Healing Breeze', 'Pollen', 'Wild Carrot'
  849.     }
  850.  
  851.     BlueMagic_Enmity = S {
  852.         'Blank Gaze', 'Jettatura', 'Geist Wall', 'Sheep Song', 'Soporific'
  853.     }
  854.    
  855. end
  856.  
  857. ------------------------
  858. --   Sub Mage Table   --
  859. ------------------------
  860.  
  861. mp_jobs = S {"WHM", "BLM", "RDM", "SMN", "BLU", "SCH", "GEO", "PLD", "DRK", "RUN"}
  862.  
  863. --------------------------------
  864. --   Elemental Breath Table   --
  865. --------------------------------
  866.  
  867. ElementalBreath = S { "Flame Breath", "Sand Breath", "Hydro Breath",
  868. "Gust Breath", "Frost Breath", "Lightning Breath", }
  869.  
  870. -------------------------------
  871. --   WS Chart For Gavialis   --
  872. -------------------------------
  873.  
  874. check_ws_day = {
  875. Firesday = S {'Liquefaction','Fusion','Light'},
  876. Earthsday= S {'Scission','Gravitation','Darkness'},
  877. Watersday = S {'Reverberation','Distortion','Darkness'},
  878. Windsday = S {'Detonation','Fragmentation','Light'},
  879. Iceday = S {'Induration','Distortion','Darkness'},
  880. Lightningsday = S {'Impaction','Fragmentation','Light'},
  881. Lightsday = S {'Transfixion','Fusion','Light'},
  882. Darksday = S {'Compression','Gravitation','Darkness'},}
  883.  
  884.  
  885. ---------------------
  886. --   HB Triggers   --
  887. ---------------------
  888. Trigger = S {
  889.     'Power Attack', 'Foot Kick', 'Sprout Smack', 'Helldive', 'Cocoon', 'Wild Carrot',
  890.     'Dia', 'Diaga', 'Dia II', 'Sneak', 'Invisible', 'Cure', 'Cure II', 'Cure III', 'Cure IV', 'Cura',
  891.     'Raise', 'Reraise', 'Poisona', 'Paralyna', 'Blindna', 'Silena', 'Stona', 'Cursna', 'Haste',
  892.     'Regen', 'Regen II', 'Erase', 'Flash'
  893. }
  894.  
  895. ------------------------
  896. --   Town Gear List   --
  897. ------------------------
  898.  
  899. Town = S {
  900.     "Ru'Lude Gardens", "Upper Jeuno", "Lower Jeuno", "Port Jeuno",
  901.     "Port Windurst", "Windurst Waters", "Windurst Woods", "Windurst Walls", "Heavens Tower",
  902.     "Port San d'Oria", "Northern San d'Oria", "Southern San d'Oria", "Chateau d'Oraguille",
  903.     "Port Bastok", "Bastok Markets", "Bastok Mines", "Metalworks",
  904.     "Aht Urhgan Whitegate", "Nashmau",
  905.     "Selbina", "Mhaura", "Norg",  "Kazham", "Tavanazian Safehold",
  906.     "Eastern Adoulin", "Western Adoulin", "Celennia Memorial Library", "Mog Garden"
  907. }
  908.  
  909. ---End of Maps----------------------------------------------------------------------------------------------------------------------------------------------------------
  910.  
  911.  
  912. --------------------------------------
  913. ---------                    ---------
  914. ------                          ------
  915. ---         Start of Rules         ---
  916. ------                          ------
  917. ---------                    ---------
  918. --------------------------------------
  919.  
  920. ----------------------------------------------
  921. --   Macro and Style Change on Job Change   --
  922. ----------------------------------------------
  923. function set_macros(sheet,book)
  924.     if book then
  925.         send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(sheet))
  926.         return
  927.     end
  928.     send_command('@input /macro set '..tostring(sheet))
  929. end
  930.  
  931. function set_style(sheet)
  932.     send_command('@input ;wait 5.0;input /lockstyleset '..sheet)
  933.     add_to_chat (56, 'Your lockstyle looks like shit, and you should feel bad.')
  934.     add_to_chat (55, 'You are on '..('DRG '):color(5)..''..('btw. '):color(55)..''..('Macros set!'):color(121))
  935. --  add_to_chat (23, '"I merely chewed in self defense, but I never swallowed"')
  936. end
  937.  
  938. --Page, Book--
  939. set_macros(1,16)
  940. --Use the Lockstyle Number--
  941. set_style(62)
  942. -------------------------------
  943. --         Variables         --
  944. -------------------------------
  945. SetLocked = false --Used to Check if set is locked before changing equipment
  946. LockedEquipSet = {} --Placeholder to store desired lock set
  947. LockGearSet = {}
  948. equipSet = {} --Currently Equiped Gearset
  949. LockGearIndex = false
  950. LockGearIndex = false
  951. TargetDistance = 0
  952. TH = false --TH rule default
  953. DT = false
  954. SkillchainPending = false
  955. AllowSkillchainGear = true   --Whether or not hte skillchainPending system should be disabled
  956. PetBreathFailover = false
  957. SkillchainTimer = 0
  958.  
  959. ------------------------------------
  960. --         Windower Hooks         --
  961. ------------------------------------
  962.  
  963. function buff_change(n, gain, buff_table)
  964.     local name
  965.     name = string.lower(n)
  966.     if S{"terror","petrification","sleep","stun"}:contains(name) then
  967.         if gain then
  968.             ChangeGear(sets.Utility.DerpDT)
  969.         elseif not has_any_buff_of({"terror","petrification","sleep","stun"}) then
  970.             if player.status == 'Engaged' then
  971.                 if LockGearIndex then
  972.                     ChangeGear(LockGearSet)
  973.                 elseif not LockGearIndex then
  974.                     if DT == true then
  975.                         ChangeGear(sets.DT[sets.DT.index[DT_ind]])
  976.                     elseif SAMRoll == true then
  977.                         ChangeGear(sets.SAMRoll[sets.SAMRoll.index[SAMRoll_ind]])
  978.                     else
  979.                         ChangeGear(sets.TP[sets.TP.index[TP_ind]])
  980.                     end
  981.                 end
  982.             elseif player.status == 'Idle' then
  983.                 if LockGearIndex then
  984.                     ChangeGear(LockGearSet)
  985.                 elseif not LockGearIndex then
  986.                     ChangeGear(sets.Idle[sets.Idle.index[Idle_ind]])
  987.                 end
  988.             end
  989.         end
  990.     elseif name == "doom" then
  991.         if gain then
  992.             ChangeGear(sets.Utility.Doom)
  993.             send_command('@input /p Doomed {~o~:} !')
  994.             disable('ring1','ring2','waist')
  995.         else
  996.             if player.status == 'Engaged' then
  997.                 if LockGearIndex then
  998.                     send_command('@input /p Doom is off {^_^}')
  999.                     enable('ring1','ring2','waist')
  1000.                     ChangeGear(LockGearSet)
  1001.                 else
  1002.                     send_command('@input /p Doom is off {^_^}')
  1003.                     enable('ring1','ring2','waist')
  1004.                     if DT == true then
  1005.                         ChangeGear(sets.DT[sets.DT.index[DT_ind]])
  1006.                     elseif SAMRoll == true then
  1007.                         ChangeGear(sets.SAMRoll[sets.SAMRoll.index[SAMRoll_ind]])
  1008.                     else
  1009.                         ChangeGear(sets.TP[sets.TP.index[TP_ind]])
  1010.                     end
  1011.                 end
  1012.             elseif player.status == 'Idle' then
  1013.                 if LockGearIndex then
  1014.                     send_command('@input /p Doom is off {^_^}')
  1015.                     enable('ring1','ring2','waist')
  1016.                     ChangeGear(LockGearSet)
  1017.                 else
  1018.                     send_command('@input /p Doom is off {^_^}')
  1019.                     enable('ring1','ring2','waist')
  1020.                     ChangeGear(sets.Idle[sets.Idle.index[Idle_ind]])
  1021.                 end
  1022.             end
  1023.         end
  1024.     elseif name == "charm" then
  1025.         if gain then
  1026.             send_command('@input /p Charmed {<3_<3:} !')
  1027.         else
  1028.             send_command('@input /p Charm is off {~_^}')
  1029.         end
  1030.     elseif name == "weakness" then
  1031.         if gain then
  1032.             enable('ring1','ring2','waist')
  1033.         end
  1034.     elseif name == "weakness" and player.status == 'Idle' then
  1035.         if gain then
  1036.             enable('ring1','ring2','waist')
  1037.             ChangeGear(sets.Utility.Twilight)
  1038.         else
  1039.             if player.status == 'Idle' then
  1040.                 if LockGearIndex then
  1041.                     ChangeGear(LockGearSet)
  1042.                 else
  1043.                     ChangeGear(sets.Idle[sets.Idle.index[Idle_ind]])
  1044.                 end
  1045.    
  1046.             end
  1047.         end
  1048.     elseif name == "hasso" then
  1049.         if gain then
  1050.         else
  1051.             send_command('gs c -cd Hasso Lost!')
  1052.         end
  1053.     end
  1054.    
  1055.     if name == "samurai roll" then
  1056.         if gain then
  1057.             SAMRoll = true
  1058.              if LockGearIndex then
  1059.                 ChangeGear(LockGearSet)
  1060.             elseif DT == true then
  1061.                 ChangeGear(sets.DT[sets.DT.index[DT_ind]])
  1062.             else
  1063.                 if player.status == 'Engaged' then
  1064.                     ChangeGear(sets.SAMRoll[sets.SAMRoll.index[SAMRoll_ind]])
  1065.                 end
  1066.             end
  1067.         else
  1068.             SAMRoll = false
  1069.         end
  1070.     end
  1071. end
  1072.  
  1073. function has_any_buff_of(buff_set)--returns true if you have any of the buffs given
  1074.     for i,v in pairs(buff_set) do
  1075.         if buffactive[v] ~= nil then return true end
  1076.     end
  1077. end
  1078.  
  1079. ---------------------------
  1080. --         Binds         --
  1081. ---------------------------
  1082. send_command('bind f9 gs c toggle TP set') -- Hit f9, toggles the sets
  1083. send_command('bind f10 gs c toggle Stardiver set')
  1084. send_command('bind f11 gs c toggle Camlann set')
  1085. send_command('bind f12 gs c toggle Idle set')
  1086. send_command('bind ^f8 input /ws "Leg Sweep" <t>')
  1087. send_command('bind ^f9 input /ws "Stardiver" <t>') -- ^ means cntrl, so hit cntrl + f9
  1088. send_command('bind ^f10 input /ws "Camlann\'s Torment"] <t>')
  1089. send_command('bind ^f11 input /ws "Sonic Thrust" <t>')
  1090. send_command('bind ^f12 input /ws "Drakesbane" <t>')
  1091. send_command('bind !f7 gs c toggle DT set') -- ! means alt. this exists only for toggling outside of this mode being active, otherwise f9
  1092. send_command('bind !f8 gs c toggle DT') -- ! means alt.  DT on or off
  1093. send_command('bind !f9 gs c toggle backwards')
  1094. send_command('bind !f10 gs c AllowSkillchainGear')
  1095. send_command('bind !f11 empty')
  1096. send_command('bind !f12 gs c lockgearindex')
  1097.  
  1098. send_command('bind !e input /item "Echo Drops" <me>')
  1099. send_command('bind !r input /item "Remedy" <me>')
  1100. send_command('bind !p input /item "Panacea" <me>')
  1101. send_command('bind !h input /item "Holy Water" <me>')
  1102. send_command('bind !w input /equip ring2 "Warp Ring"; /echo Warping; wait 11; input /item "Warp Ring" <me>;')
  1103. send_command('bind !q input /equip ring2 "Dim. Ring (Holla)"; /echo Reisenjima; wait 11; input /item "Dim. Ring (Holla)" <me>;')
  1104. send_command('bind !t gs c toggle TH') -- alt + t toggles TH mode
  1105.  
  1106. --Unload Binds
  1107. function file_unload()
  1108.     send_command('unbind ^f8')
  1109.     send_command('unbind ^f9')
  1110.     send_command('unbind ^f10')
  1111.     send_command('unbind ^f11')
  1112.     send_command('unbind ^f12')
  1113.     send_command('unbind !f7')
  1114.     send_command('unbind !f8')
  1115.     send_command('unbind !f9')
  1116.     send_command('unbind !f10')
  1117.     send_command('unbind !f11')
  1118.     send_command('unbind !f12')
  1119.     send_command('unbind f9')
  1120.     send_command('unbind f10')
  1121.     send_command('unbind f11')
  1122.     send_command('unbind f12')
  1123.    
  1124.     send_command('unbind !e')
  1125.     send_command('unbind !r')
  1126.     send_command('unbind !p')
  1127.     send_command('unbind !h')
  1128.     send_command('unbind !w')
  1129.     send_command('unbind !t')
  1130. end
  1131.  
  1132. --------------------------------------
  1133. --         Console Commands         --
  1134. --------------------------------------
  1135. function self_command(command)
  1136.     if command == 'togglelock' then
  1137.         if SetLocked == false then
  1138.             msg("Equipment Set LOCKED !!!")
  1139.         else
  1140.             SetLocked = false
  1141.             msg("Equipment Set UNLOCKED!")
  1142.         end
  1143.     elseif command == 'lockgearindex' then
  1144.         if LockGearIndex == false then
  1145.             LockGearIndex = true
  1146.             LockGearSet = {
  1147.                 ammo = player.equipment.ammo,
  1148.                 head = player.equipment.head,
  1149.                 neck = player.equipment.neck,
  1150.                 ear1 = player.equipment.left_ear,
  1151.                 ear2 = player.equipment.right_ear,
  1152.                 body = player.equipment.body,
  1153.                 hands = player.equipment.hands,
  1154.                 ring1 = player.equipment.left_ring,
  1155.                 ring2 = player.equipment.right_ring,
  1156.                 back = player.equipment.back,
  1157.                 waist = player.equipment.waist,
  1158.                 legs = player.equipment.legs,
  1159.                 feet = player.equipment.feet
  1160.             }
  1161.             msg("Gear Index Locked !!!")
  1162.         else
  1163.             LockGearIndex = false
  1164.             msg("Gear Index Unlocked")
  1165.             if player.status == 'Engaged' then
  1166.                 if DT == true then
  1167.                     ChangeGear(sets.DT[sets.DT.index[DT_ind]])
  1168.                 elseif SAMRoll == true then
  1169.                     ChangeGear(sets.SAMRoll[sets.SAMRoll.index[SAMRoll_ind]])
  1170.                 else
  1171.                     ChangeGear(sets.TP[sets.TP.index[TP_ind]])
  1172.                 end
  1173.             else
  1174.                 ChangeGear(sets.Idle[sets.Idle.index[Idle_ind]])
  1175.             end
  1176.         end
  1177.     end
  1178.     if command == 'toggle TP set' then
  1179.         if DT == true then
  1180.             DT_ind = DT_ind + 1
  1181.             if DT_ind > #sets.DT.index then DT_ind = 1 end
  1182.             send_command('@input /echo <----- DT Set changed to ' .. sets.DT.index[DT_ind] .. ' ----->')
  1183.             ChangeGear(sets.DT[sets.DT.index[DT_ind]])
  1184.         elseif DT == false then
  1185.         TP_ind = TP_ind + 1
  1186.         SAMRoll_ind = SAMRoll_ind + 1
  1187.         if TP_ind > #sets.TP.index then TP_ind = 1 end
  1188.         if SAMRoll_ind > #sets.SAMRoll.index then SAMRoll_ind = 1 end
  1189.         send_command('@input /echo <----- TP Set changed to ' .. sets.TP.index[TP_ind] .. ' ----->')
  1190.             if player.status == 'Engaged' then
  1191.                 if SAMRoll == true then
  1192.                     ChangeGear(sets.SAMRoll[sets.SAMRoll.index[SAMRoll_ind]])
  1193.                 else
  1194.                     ChangeGear(sets.TP[sets.TP.index[TP_ind]])
  1195.                 end
  1196.             end
  1197.         end
  1198.     elseif command == 'toggle Idle set' then
  1199.         Idle_ind = Idle_ind + 1
  1200.         if Idle_ind > #sets.Idle.index then Idle_ind = 1 end
  1201.         send_command('@input /echo <----- Idle Set changed to ' .. sets.Idle.index[Idle_ind] .. ' ----->')
  1202.         if player.status == 'Idle' then
  1203.             ChangeGear(sets.Idle[sets.Idle.index[Idle_ind]])
  1204.         end
  1205.     elseif command == 'toggle Camlann set' then
  1206.         CamlannsTorment_ind = CamlannsTorment_ind + 1
  1207.         SonicThrust_ind = SonicThrust_ind + 1
  1208.         if CamlannsTorment_ind > #sets.CamlannsTorment.index then CamlannsTorment_ind = 1 end
  1209.         send_command('@input /echo <----- Camlanns/Sonic Set changed to ' .. sets.CamlannsTorment.index[CamlannsTorment_ind] .. ' ----->')
  1210.     elseif command == 'toggle Stardiver set' then
  1211.         Stardiver_ind = Stardiver_ind + 1
  1212.         Drakesbane_ind = Drakesbane_ind + 1
  1213.         if Stardiver_ind > #sets.Stardiver.index then Stardiver_ind = 1 end
  1214.         send_command('@input /echo <----- Stardiver/Drakes Set changed to ' .. sets.Stardiver.index[Stardiver_ind] .. ' ----->')
  1215.     elseif command == 'toggle DT set' then
  1216.         DT_ind = DT_ind + 1
  1217.         if DT_ind > #sets.DT.index then DT_ind = 1 end
  1218.         send_command('@input /echo <----- DT Set changed to ' .. sets.DT.index[DT_ind] .. ' ----->')
  1219.             if DT == true then
  1220.                 ChangeGear(sets.DT[sets.DT.index[DT_ind]])
  1221.             end
  1222.     elseif command == 'toggle DT' then
  1223.         if DT == true then
  1224.             DT = false
  1225.             send_command('@input /echo <----- DT TP: [Off] ----->')
  1226.         else
  1227.             DT = true
  1228.             send_command('@input /echo <----- DT TP: [On] ----->')
  1229.         end
  1230.         status_change(player.status)
  1231.     elseif command == 'toggle TH' then
  1232.         if TH == true then
  1233.             TH = false
  1234.             send_command('@input /echo <----- Treasure Hunter TP: [Off] ----->')
  1235.         else
  1236.             TH = true
  1237.             send_command('@input /echo <----- Treasure Hunter TP: [On] ----->')
  1238.         end
  1239.         status_change(player.status)
  1240.     elseif command == 'toggle backwards' then
  1241.         if DT == true then
  1242.             DT_ind = DT_ind -1
  1243.             if DT_ind == 0 then
  1244.                 DT_ind = #sets.DT.index
  1245.             end
  1246.         send_command('@input /echo <----- DT Set changed to ' .. sets.DT.index[DT_ind] .. ' ----->')
  1247.         ChangeGear(sets.DT[sets.DT.index[DT_ind]])
  1248.         elseif DT == false then
  1249.             TP_ind = TP_ind -1
  1250.             SAMRoll_ind = SAMRoll_ind -1
  1251.             if TP_ind == 0 then
  1252.                 TP_ind = #sets.TP.index
  1253.             end
  1254.             if SAMRoll_ind == 0 then
  1255.                 SAMRoll_ind = #sets.SAMRoll.index
  1256.             end
  1257.             send_command('@input /echo <----- TP Set changed to ' .. sets.TP.index[TP_ind] .. ' ----->')
  1258.             if player.status == 'Engaged' then
  1259.                 if SAMRoll == true then
  1260.                     ChangeGear(sets.SAMRoll[sets.SAMRoll.index[SAMRoll_ind]])
  1261.                 else
  1262.                     ChangeGear(sets.TP[sets.TP.index[TP_ind]])
  1263.                 end
  1264.             end
  1265.         end
  1266.     elseif command == 'ZoneChange' then
  1267.         IdleState()
  1268.     elseif command == 'AllowSkillchainGear' then
  1269.         AllowSkillchainGear = not AllowSkillchainGear
  1270.         add_to_chat (56, 'Allow use of skillchain damage gear: ' ..tostring(AllowSkillchainGear))
  1271.     elseif command == 'PetBreathFailover' then
  1272.         if PetBreathFailover == true then     --If the PetBreathFailover wasnt reset to false by pet_aftercast then we set it to false here
  1273.             PetBreathFailover = false         --And call ac_global to reset our gear
  1274.             ac_Global()
  1275.         end
  1276.     elseif string.sub(command, 0, 4) == '-cd ' then     --If the first 4 characters of the command are '-cd '
  1277.         add_to_chat (30, string.sub(command, 5, string.len(command)))      --add everything after '-cd ' to a message in the chat
  1278.     end
  1279. end
  1280.  
  1281. --------------------------------------
  1282. --         Character States         --
  1283. --------------------------------------
  1284. function IdleState()
  1285.     if LockGearIndex then
  1286.         ChangeGear(LockGearSet)
  1287.     elseif DT == true then
  1288.         ChangeGear(sets.DT[sets.DT.index[DT_ind]])
  1289.     else
  1290.         ChangeGear(sets.Idle[sets.Idle.index[Idle_ind]])
  1291.     end
  1292.    
  1293.     if buffactive['Weakness'] then
  1294.         ChangeGear(sets.Utility.Twilight) --Only on during weakened idle, and requires an action after raising to trigger. Use lockgear otherwise.
  1295.     elseif mp_jobs:contains(player.sub_job) and player.mpp < 50 then
  1296.         ChangeGear(sets.Idle.Refresh)
  1297.     else
  1298.         ChangeGear(sets.Idle[sets.Idle.index[Idle_ind]])
  1299.     end
  1300.    
  1301.     if Town:contains(world.area) and player.mpp < 65 then
  1302.         ChangeGear(set_combine(sets.Idle.Town, sets.Idle.Refresh))
  1303.     elseif Town:contains(world.area) then
  1304.         ChangeGear(sets.Idle.Town) -- Puts on Waifu/Husbando Band
  1305.     end
  1306.    
  1307. end
  1308.  
  1309. windower.raw_register_event('zone change',function()
  1310. windower.send_command('@wait 9; input //gs c ZoneChange')
  1311. end)
  1312.  
  1313. function RestingState()
  1314.  
  1315. end
  1316.  
  1317. function EngagedState()
  1318.     if LockGearIndex then
  1319.         ChangeGear(LockGearSet)
  1320.     elseif not LockGearIndex then
  1321.         if DT == true then
  1322.             ChangeGear(sets.DT[sets.DT.index[DT_ind]])
  1323.         elseif buffactive["Samurai Roll"] then
  1324.             SAMRoll = true
  1325.             ChangeGear(sets.SAMRoll[sets.SAMRoll.index[SAMRoll_ind]])
  1326.         else
  1327.             SAMRoll = false
  1328.             ChangeGear(sets.TP[sets.TP.index[TP_ind]])
  1329.         end
  1330.     end
  1331. end
  1332.  
  1333. -----------------------------
  1334. --      Spell control      --
  1335. -----------------------------
  1336. unusable_buff = {
  1337.     spell={'Charm','Mute','Omerta','Petrification','Silence','Sleep','Stun','Terror'},
  1338.     ability={'Amnesia','Charm','Impairment','Petrification','Sleep','Stun','Terror'}}
  1339.   --check_recast('ability',spell.recast_id)  check_recast('spell',spell.recast_id)
  1340. function check_recast(typ,id) --if spell can be cast(not in recast) return true
  1341.     local recasts = windower.ffxi['get_'..typ..'_recasts']()
  1342.     if id and recasts[id] and recasts[id] == 0 then
  1343.         return true
  1344.     else
  1345.         return false
  1346.     end
  1347. end
  1348.  --return true if spell/ability is unable to be used at this time
  1349. function spell_control(spell)
  1350.     if spell.type == "Item" then
  1351.         return false
  1352.     --Stops spell if you do not have a target
  1353.     elseif spell.target.name == nil and not spell.target.raw:contains("st") then
  1354.         return true
  1355.     --Stops spell if a blocking buff is active
  1356.     elseif spell.action_type == 'Ability' and spell.type ~= 'WeaponSkill' and (has_any_buff_of(unusable_buff.ability) or not check_recast('ability',spell.recast_id)) then
  1357.         return true
  1358.     elseif spell.type == 'WeaponSkill' and player.tp < 1000 then
  1359.         return true
  1360.     elseif spell.type == 'WeaponSkill' and (has_any_buff_of(unusable_buff.ability)) then
  1361.         msg("Weapon Skill Canceled, Can't")
  1362.         return true
  1363.     elseif spell.action_type == 'Magic' and (has_any_buff_of(unusable_buff.spell)
  1364.       or not check_recast('spell',spell.recast_id)) then
  1365.         return true
  1366.     --Stops spell if you do not have enuf mp/tp to use
  1367.     elseif spell.mp_cost and spell.mp_cost > player.mp and not has_any_buff_of({'Manawell','Manafont'}) then
  1368.         msg("Spell Canceled, Not Enough MP")
  1369.         return true
  1370.     end
  1371.     --Calculate how many finishing moves your char has up to 6
  1372.     local fm_count = 0
  1373.     for i, v in pairs(buffactive) do
  1374.         if tostring(i):startswith('finishing move') or tostring(i):startswith('?????????') then
  1375.             fm_count = tonumber(string.match(i, '%d+')) or 1
  1376.         end
  1377.     end
  1378.     --Stops flourishes if you do not have enough finishing moves
  1379.     local min_fm_for_flourishes = {['Animated Flourish']=1,['Desperate Flourish']=1,['Violent Flourish']=1,['Reverse Flourish']=1,['Building Flourish']=1,
  1380.                                    ['Wild Flourish']=2,['Climactic Flourish']=1,['Striking Flourish']=2,['Ternary Flourish']=3,}
  1381.     if min_fm_for_flourishes[spell.en] then
  1382.         if min_fm_for_flourishes[spell.en] > fm_count and not buffactive[507] then
  1383.             return true
  1384.         end
  1385.     end
  1386.     --Reomves Sneak when casting Spectral Jig
  1387.     if spell.en == 'Spectral Jig' then
  1388.         send_command('cancel 71')
  1389.     end
  1390.     if spell.name == 'Utsusemi: Ichi' and overwrite and buffactive['Copy Image (3)'] then
  1391.         return true
  1392.     end
  1393.     if player.tp >= 1000 and player.target and player.target.distance and player.target.distance > 7 and spell.type == 'WeaponSkill' then
  1394.         msg("Weapon Skill Canceled  Target Out of Range")
  1395.         return true
  1396.     end
  1397. end
  1398.  
  1399. -----------------------------
  1400. --         Precast         --
  1401. -----------------------------
  1402. function pc_JA(spell, act)
  1403.     if spell.english == 'Spirit Surge' then
  1404.         ChangeGear(sets.JA.SpiritSurge)
  1405.     elseif spell.english == 'Call Wyvern' then
  1406.         ChangeGear(sets.JA.CallWyvern)
  1407.     elseif spell.english == 'Ancient Circle' then
  1408.         ChangeGear(sets.JA.AncientCircle)
  1409.     elseif spell.english == 'Spirit Link' then
  1410.         ChangeGear(sets.JA.SpiritLink)
  1411.     elseif spell.english == 'Angon' then
  1412.         ChangeGear(sets.JA.Angon)
  1413.     elseif spell.english == 'Deep Breathing' then
  1414.         ChangeGear(sets.JA.DeepBreathing)
  1415.     elseif spell.english == 'Jump' then
  1416.         ChangeGear(set_combine(sets.TP[sets.TP.index[TP_ind]],{
  1417.             ammo = "Ginsen",
  1418.             body = "Pteroslaver Mail +3",
  1419.             hands = "Vis. Fng. Gaunt. +3",
  1420.             back = Brig.STP,
  1421.             legs = "Pteroslaver Brais +2",
  1422.             feet = "Ostro Greaves"}))
  1423.     elseif spell.english == 'High Jump' then
  1424.         ChangeGear(set_combine(sets.TP[sets.TP.index[TP_ind]],{
  1425.             ammo = "Ginsen",
  1426.             body = "Pteroslaver Mail +3",
  1427.             hands = "Vis. Fng. Gaunt. +3",
  1428.             back = Brig.STP,
  1429.             legs = "Pteroslaver Brais +2",
  1430.             feet = "Ostro Greaves"}))
  1431.     elseif spell.english == 'Spirit Jump' then
  1432.         ChangeGear(set_combine(sets.TP[sets.TP.index[TP_ind]],{
  1433.             ammo = "Ginsen",
  1434.             body = "Pteroslaver Mail +3",
  1435.             hands = "Vis. Fng. Gaunt. +3",
  1436.             back = Brig.STP,
  1437.             legs = "Pteroslaver Brais +2",
  1438.             feet = "Ostro Greaves"}))
  1439.     elseif spell.english == 'Soul Jump' then
  1440.         ChangeGear(set_combine(sets.TP[sets.TP.index[TP_ind]],{
  1441.             ammo = "Ginsen",
  1442.             body = "Vishap Mail +3",
  1443.             hands = "Vis. Fng. Gaunt. +3",
  1444.             back = Brig.STP,
  1445.             legs = ValorousHose.STP,
  1446.             feet = "Ostro Greaves"}))
  1447.     elseif spell.english == 'Steady Wing' then
  1448.         ChangeGear(sets.HB.Mentos)
  1449.     elseif spell.english == 'Provoke' then
  1450.         ChangeGear(sets.JA.Provoke)
  1451.     end
  1452.    
  1453.     IgnoreWS = S {"Penta Thrust"}  -- Excluded from Moonshade TP override rule.
  1454.     BrutalWS = S {"Stardiver", "Drakesbane", "Shattersoul"}
  1455.    
  1456.     if spell.type == 'WeaponSkill' then
  1457.         if spell.english == 'Stardiver' or spell.english == 'Shattersoul' then
  1458.             ChangeGear(sets.Stardiver[sets.Stardiver.index[Stardiver_ind]])
  1459.         elseif spell.english == "Camlann's Torment" or spell.english == 'Retribution' then
  1460.             ChangeGear(sets.CamlannsTorment[sets.CamlannsTorment.index[CamlannsTorment_ind]])
  1461.         elseif spell.english == 'Drakesbane' then
  1462.             ChangeGear(sets.Drakesbane[sets.Drakesbane.index[Drakesbane_ind]])
  1463.         elseif spell.english == 'Sonic Thrust' then
  1464.             ChangeGear(sets.SonicThrust[sets.SonicThrust.index[SonicThrust_ind]])
  1465.         elseif spell.english == 'Leg Sweep' then
  1466.             ChangeGear(sets.LegSweep)
  1467.         end
  1468.         if player.tp > 2025 and player.equipment.main == 'Trishula' and buffactive['TP Bonus'] and not buffactive['Sekkanoki'] then
  1469.             if IgnoreWS:contains(spell.english) then
  1470.                 do return end
  1471.             elseif BrutalWS:contains(spell.english) then
  1472.                 equip(set_combine(equipSet, { ear1 = "Brutal Earring" })) --Watch for ear conflicts between TP sets and WS sets
  1473.                 msg("Brutal Earring equiped !!!!")
  1474.             else
  1475.                 equip(set_combine(equipSet, { ear1 = "Ishvara Earring" }))
  1476.                 msg("Ishvara Earring equiped !!!!")
  1477.             end
  1478.         elseif player.tp > 2275 and player.equipment.main == 'Trishula' and not buffactive['Sekkanoki'] then
  1479.             if IgnoreWS:contains(spell.english) then
  1480.                 do return end
  1481.             elseif BrutalWS:contains(spell.english) then
  1482.                 equip(set_combine(equipSet, { ear1 = "Brutal Earring" })) --Watch for ear conflicts between TP sets and WS sets
  1483.                 msg("Brutal Earring equiped !!!!")
  1484.             else
  1485.                 equip(set_combine(equipSet, { ear1 = "Ishvara Earring" }))
  1486.                 msg("Ishvara Earring equiped !!!!")
  1487.             end
  1488.         elseif player.tp > 2550 and buffactive['TP Bonus'] and not buffactive['Sekkanoki'] then
  1489.             if IgnoreWS:contains(spell.english) then
  1490.                 do return end
  1491.             elseif BrutalWS:contains(spell.english) then
  1492.                 equip(set_combine(equipSet, { ear1 = "Brutal Earring" })) --Watch for ear conflicts between TP sets and WS sets
  1493.                 msg("Brutal Earring equiped !!!!")
  1494.             else
  1495.                 equip(set_combine(equipSet, { ear1 = "Ishvara Earring" }))
  1496.                 msg("Ishvara Earring equiped !!!!")
  1497.             end
  1498.         elseif player.tp > 2775 and not buffactive['Sekkanoki'] then
  1499.             if IgnoreWS:contains(spell.english) then
  1500.                 do return end
  1501.             elseif BrutalWS:contains(spell.english) then
  1502.                 equip(set_combine(equipSet, { ear1 = "Brutal Earring" })) --Watch for ear conflicts between TP sets and WS sets
  1503.                 msg("Brutal Earring equiped !!!!")
  1504.             else
  1505.                 equip(set_combine(equipSet, { ear1 = "Ishvara Earring" }))
  1506.                 msg("Ishvara Earring equiped !!!!")
  1507.             end
  1508.         end
  1509.     end
  1510.    
  1511. if spell.english == 'Stardiver' and Stardiver_ind ~= 1 and (check_ws_day[world.day]:contains(spell.skillchain_a) -- Remove the and _ind ~=1 (not equal) for Gavialis if you don't have Ptero +2/3.
  1512.     or check_ws_day[world.day]:contains(spell.skillchain_b)
  1513.     or check_ws_day[world.day]:contains(spell.skillchain_c)) then
  1514.     ChangeGear(sets.WSDayBonus)
  1515. end
  1516. --Tested, Aeonic AM Doesn't work with Gavialis, but I will keep the extra rule on ice for now below:
  1517. --or (check_ws_day[world.day]:contains("Darkness") and player.equipment.main == 'Trishula' and (buffactive['Aftermath: Lv.3'] or buffactive['Aftermath: Lv.2'] or buffactive['Aftermath: Lv.1']))) then
  1518.  
  1519.     if spell.english == 'Box Step' or spell.english == 'Quick Step' then
  1520.         ChangeGear(sets.Utility.Steps)
  1521.     elseif spell.english == 'Animated Flourish' then
  1522.         ChangeGear(sets.Enmity)
  1523.     end
  1524. end
  1525.  
  1526. function pc_Magic(spell, act)
  1527.     if spell.action_type == 'Magic' then
  1528.         ChangeGear(sets.precast.FastCast.Standard)
  1529.     end
  1530. end
  1531.  
  1532. function pretarget(spell,action)
  1533.  
  1534.     if  spell.english =="Call Wyvern" and pet.isvalid then -- Change Call Wyvern To Spirit Link If Wyvern Is Present --
  1535.         cancel_spell()
  1536.         send_command('Spirit Link')
  1537.     end
  1538.  
  1539. end
  1540.  
  1541.  
  1542. function pc_Item(spell, act)
  1543. end
  1544.  
  1545.  
  1546. -----------------------------
  1547. --         Midcast         --
  1548. -----------------------------
  1549. function mc_JA(spell, act)
  1550. end
  1551.  
  1552. function mc_Magic(spell, act)
  1553.     if spell.action_type == 'Magic' and player.hpp <= 50 then
  1554.         ChangeGear(sets.HB.Trigger)
  1555.     elseif Trigger:contains(spell.english) then --Put whatever you want to trigger the helm change in the table above
  1556.         ChangeGear(sets.HB.Trigger)
  1557.     end
  1558.  
  1559.     if spell.skill == 'Enhancing Magic' then
  1560.         if spell.english == 'Refresh' then
  1561.             ChangeGear(sets.Enhancing.Refresh)
  1562.         elseif string.find(spell.english,'Regen')then
  1563.             ChangeGear(sets.Enhancing.Regen)
  1564.         elseif string.find(spell.english,'Bar') then
  1565.             ChangeGear(sets.Enhancing.Skill)
  1566.         elseif spell.english=="Phalanx" then
  1567.             ChangeGear(sets.Enhancing.Phalanx)
  1568.         elseif string.find(spell.english,'Shell') or string.find(spell.english,'Protect') then
  1569.             ChangeGear(sets.Enhancing.ProShell)
  1570.         end
  1571.     end
  1572.    
  1573.     if PhysicalSpells:contains(spell.english) then
  1574.         ChangeGear(sets.BlueMagic.STR)
  1575.     end
  1576.  
  1577.     if BlueMagic_Enmity:contains(spell.english) then
  1578.         ChangeGear(sets.Enmity)
  1579.     elseif BlueMagic_Buffs:contains(spell.english) then
  1580.         ChangeGear(sets.TP.Tank)
  1581.     elseif BlueMagic_Healing:contains(spell.english) or string.find(spell.english,'Cure')then
  1582.         ChangeGear(set_combine(sets.Cures, sets.HB.Trigger))
  1583.     end
  1584. end
  1585.  
  1586. function mc_Item(spell, act)
  1587. end
  1588.  
  1589.  
  1590. --------------------------------
  1591. --         After Cast         --
  1592. --------------------------------
  1593. function ac_JA(spell)
  1594. end
  1595.  
  1596. function ac_Magic(spell)
  1597. end
  1598.  
  1599. function ac_Item(spell)
  1600. end
  1601.  
  1602. function ac_Global()
  1603.     if LockGearIndex == true then
  1604.         ChangeGear(LockGearSet)
  1605.         msg("Lock Gear is ON -- Swapping Gear")
  1606.     else
  1607.         if player.status == 'Engaged' then
  1608.             EngagedState()
  1609.         else
  1610.             IdleState()
  1611.         end
  1612.     end
  1613. end
  1614.  
  1615. ------------------------------------
  1616. --         Framework Core         --
  1617. ------------------------------------
  1618. function status_change(new, old)
  1619.     if new == 'Idle' then
  1620.         IdleState()
  1621.     elseif new == 'Resting' then
  1622.         RestingState()
  1623.     elseif new == 'Engaged' then
  1624.         EngagedState()
  1625.     end
  1626.    
  1627.     if player.status == 'Engaged' and TH == true and spell.type ~= "WeaponSkill" then
  1628.         ChangeGear(set_combine(equipSet, sets.Utility.TH))
  1629.     end
  1630.    
  1631.     if DT == true then
  1632.         ChangeGear(sets.DT[sets.DT.index[DT_ind]])
  1633.     end
  1634.    
  1635. end
  1636.  
  1637. function pet_midcast(spell, act)
  1638.     PetBreathFailover = true
  1639.     if string.find(spell.english,'Healing Breath')  then
  1640.         ChangeGear(sets.HB.Mentos)
  1641.     elseif ElementalBreath:contains(spell.english) then
  1642.         ChangeGear(sets.HB.Ricola)
  1643.     end
  1644.     send_command('wait 1.2;gs c PetBreathFailover')
  1645. end
  1646.  
  1647. function pet_aftercast(spell, act, spellMap, eventArgs)
  1648.     PetBreathFailover = false
  1649.     if spell.action_type == 'Ability' then
  1650.         ac_JA(spell)
  1651.     elseif spell.action_type == 'Magic' then
  1652.         ac_Magic(spell)
  1653.     else
  1654.         ac_Item(spell)
  1655.     end
  1656.     ac_Global()
  1657. end
  1658.        
  1659. function precast(spell, act, spellMap, eventArgs)
  1660.     if spell_control(spell) then
  1661.         cancel_spell()
  1662.         return
  1663.     end
  1664.     if spell.action_type == 'Ability' then
  1665.         pc_JA(spell, act)
  1666.     elseif spell.action_type == 'Magic' then
  1667.         pc_Magic(spell, act)
  1668.     else
  1669.         pc_Item(spell, act)
  1670.     end
  1671.    
  1672.     if spell.type:lower() == "weaponskill" and SkillchainPending == true then          
  1673.         if (os.time() - SkillchainTimer) <= 9 and AllowSkillchainGear == true then
  1674.             if buffactive["Allies' Roll"] then
  1675.                 equip(sets.SCDmgAllies)
  1676.             else
  1677.                 equip(sets.SCDmg)           -- If the current operating system time (in seconds)
  1678.             end                             -- minus SkillchainTimer variable is less than 9, equip skillchain gear
  1679.         else
  1680.             SkillchainPending = false
  1681.         end                                      
  1682.     end
  1683. end
  1684.  
  1685. function midcast(spell, act)
  1686.     if spell.action_type == 'Ability' and TH == true then
  1687.         ChangeGear(set_combine(equipSet, sets.Utility.TH))
  1688.     elseif spell.action_type == 'Ability' then
  1689.         mc_JA(spell, act)
  1690.     elseif spell.action_type == 'Magic' then
  1691.         mc_Magic(spell, act)
  1692.     else
  1693.         mc_Item(spell, act)
  1694.     end
  1695. end
  1696.  
  1697. function aftercast(spell, act, spellMap, eventArgs)
  1698.     if spell.action_type == 'Ability' then
  1699.         ac_JA(spell)
  1700.     elseif spell.action_type == 'Magic' then
  1701.         ac_Magic(spell)
  1702.     else
  1703.         ac_Item(spell)
  1704.     end
  1705.     ac_Global()
  1706.    
  1707.     --Countdowns--
  1708.     if not spell.interrupted then
  1709.         if spell.english == "Meditate" then
  1710.             send_command('wait 169;gs c -cd '..spell.name..': [Ready In 10 Seconds!];wait 10;gs c -cd '..spell.name..': [Ready !]')
  1711.         elseif spell.english == "Sekkanoki" then
  1712.             send_command('wait 289;gs c -cd '..spell.name..': [Ready In 10 Seconds!];wait 10;gs c -cd '..spell.name..': [Ready !]')
  1713.         elseif spell.english == "Jump" then
  1714.             send_command('wait 49;gs c -cd '..spell.name..': [Ready!]')
  1715.         elseif spell.english == "High Jump" then
  1716.             send_command('wait 100;gs c -cd '..spell.name..': [Ready!!]')
  1717.         elseif spell.english == "Spirit Jump" then
  1718.             send_command('wait 49;gs c -cd '..spell.name..': [Ready!]')
  1719.         elseif spell.english == "Soul Jump" then
  1720.             send_command('wait 100;gs c -cd '..spell.name..': [Ready!!]')
  1721.         elseif spell.english == "Angon" then
  1722.             send_command('timers create "Angon Defense Down" 90 down')
  1723.         elseif spell.type == "WeaponSkill" then
  1724.             SkillchainPending = true
  1725.             SkillchainTimer = os.time()    -- sets SkillchainTimer variable to the current time of the operating system (in seconds)
  1726.         end
  1727.     end
  1728. end
  1729.  
  1730. function ChangeGear(GearSet)
  1731.     equipSet = GearSet
  1732.     equip(GearSet)
  1733. end
  1734.  
  1735. function LockGearSet(GearSet)
  1736.     LockedEquipSet = GearSet
  1737.     equip(GearSet)
  1738.     SetLocked = true
  1739. end
  1740.  
  1741. function UnlockGearSet()
  1742.     locked = false
  1743.     equip(equipSet)
  1744. end
  1745.  
  1746. function msg(str)
  1747.     send_command('@input /echo <----- ' .. str .. ' ----->')
  1748. end
  1749.  
  1750. ---End of Rules-------------------------------------------------------------------------------------------------------------------------------------------------------
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top