Advertisement
Arnan

COR (mule) Lua August 2018

Aug 21st, 2018
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 30.24 KB | None | 0 0
  1. function get_sets()
  2.     AccIndex = 1
  3.     AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For Shooting/QD/TP/WS. Default ACC Set Is LowACC. The First TP Set Of Your Main Weapon Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below --
  4.     IdleIndex = 1
  5.     IdleArray = {"Full","DT","Warp"} -- Default Idle Set Is Movement --
  6.     Armor = 'None'
  7.     define_roll_values()
  8.     warning = false
  9.     Lock_Main = 'OFF' -- Set Default Lock Main Weapon ON or OFF Here --
  10.     AutoGunWS = "Last Stand" -- Set Auto Gun WS Here --
  11.     AutoMode = 'OFF' -- Set Default Auto RA/WS ON or OFF Here --
  12.     Obi = 'ON' -- Turn Default Obi ON or OFF Here --
  13.     ammo_warning_limit = 10 -- Set Ammo Limit Check Here --
  14.     target_distance = 6 -- Set Default Distance Here --
  15.     send_command('input /macro book 1;wait .1;input /macro set 1') -- Change Default Macro Book Here --
  16.  
  17.     ACC_Shots = S{"Light Shot","Dark Shot"}
  18.  
  19.     -- Camulus's Mantle Augments --
  20.     MABWSMantle={ name="Camulus's Mantle", augments={'AGI+20','Mag. Acc+20 /Mag. Dmg.+20','AGI+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}}
  21.     STPMantle={ name="Camulus's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Store TP"+10','Phys. dmg. taken-10%',}}
  22.     MidShotMantle={ name="Camulus's Mantle", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','AGI+10','"Store TP"+10','Phys. dmg. taken-10%',}}
  23.     PreShotMantle={ name="Camulus's Mantle", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','AGI+10','"Snapshot"+10',}}
  24.     STRWSDMantle={ name="Camulus's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}}
  25.     AGIWSDMantle={ name="Camulus's Mantle", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','AGI+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}}
  26.  
  27.         --------------------
  28.         -- Key Binds Load --
  29.         --------------------
  30.        
  31.         -- Key Bind Toggles (The Same for all my job files) (Ctrl Key) --
  32.         send_command('bind ^A input //gs c acc')
  33.         send_command('bind ^D input //gs c pdt')
  34.         send_command('bind ^I input //gs c idle')
  35.  
  36.         -- COR Job Ability Key Binds (Alt Key) --
  37.         send_command('bind !7 input //ja Crooked Cards <me>')
  38.         send_command('bind !8 input //ja Snake Eye <me>')
  39.         send_command('bind !9 input //ja Fold <me>')
  40.         send_command('bind !0 input //ja Random Deal <me>')
  41.  
  42.         -- COR Phantom Roll Key Binds (Alt Key) --
  43.         send_command('bind !A input //ja Allies\' Roll <me>')
  44.         send_command('bind !B input //ja Bolter\'s Roll <me>')
  45.         send_command('bind !C input //ja Chaos Roll <me>')
  46.         send_command('bind !D input //ja Dancer\'s Roll <me>')
  47.         send_command('bind !E input //ja Evoker\s Roll <me>')
  48.         send_command('bind !F input //ja Fighter\'s Roll <me>')
  49.         send_command('bind !G input //ja Gallant\'s Roll <me>')
  50.         send_command('bind !H input //ja Hunter\'s Roll <me>')
  51.         send_command('bind !Q input //ja Warlock\'s Roll <me>')    
  52.         send_command('bind !R input //ja Rogue\'s Roll <me>')
  53.         send_command('bind !S input //ja Samurai Roll <me>')
  54.         send_command('bind !T input //ja Tactician\'s Roll <me>')
  55.         send_command('bind !W input //ja Wizard\'s Roll <me>')
  56.         send_command('bind !X input //ja Corsair\'s Roll <me>')
  57.        
  58.         -- COR Weapon Skill Key Binds --
  59.         send_command('bind F12 input /ws "Last Stand" <t>')
  60.         send_command('bind !F12 input /ws "Leaden Salute" <t>')
  61.         send_command('bind Delete input /ws "Savage Blade" <t>')
  62.  
  63.         ----------------------
  64.         -- Key Binds Unload --
  65.         ----------------------
  66.  
  67.         function file_unload()
  68.         -- Unbind Toggles --
  69.         send_command('unbind ^A')
  70.         send_command('unbind ^D')
  71.         send_command('unbind ^I')
  72.         -- Unbind COR JA's --
  73.         send_command('unbind !7')
  74.         send_command('unbind !8')
  75.         send_command('unbind !9')
  76.         send_command('unbind !0')
  77.         -- Unbind COR Rolls --
  78.         send_command('unbind !A')
  79.         send_command('unbind !B')
  80.         send_command('unbind !C')
  81.         send_command('unbind !D')
  82.         send_command('unbind !E')
  83.         send_command('unbind !F')
  84.         send_command('unbind !G')
  85.         send_command('unbind !H')
  86.         send_command('unbind !Q')
  87.         send_command('unbind !R')
  88.         send_command('unbind !S')
  89.         send_command('unbind !T')
  90.         send_command('unbind !W')
  91.         send_command('unbind !X')
  92.         -- Unload Weapon Skill Key Binds --
  93.         send_command('unbind F7')
  94.         send_command('unbind F12') 
  95.         send_command('unbind !F12')
  96.         send_command('unbind Delete')  
  97.         end
  98.    
  99.     -- Idle/Town Sets --
  100.     sets.Idle = {
  101.             ammo="Chrono Bullet",
  102.             head="Meghanada Visor +2",
  103.             neck="Bathy Choker +1",
  104.             ear1="Infused Earring",
  105.             ear2="Odnowa Earring +1",
  106.             body="Meg. Cuirie +2",
  107.             hands="Meg. Gloves +2",
  108.             ring1="Defending Ring",
  109.             ring2="Meghanada Ring",
  110.             back="Moonbeam Cape",
  111.             waist="Flume Belt",
  112.             legs="Carmine Cuisses +1",
  113.             feet="Meg. Jam. +2"}
  114.     sets.Idle.Full = set_combine(sets.Idle,{})
  115.     sets.Idle.DT = set_combine(sets.Idle,{})
  116.     sets.Idle.Warp = set_combine(sets.Idle,{
  117.             ring2="Warp Ring"})
  118.  
  119.     -- QD Sets --
  120.     sets.QD = {
  121.             ammo="Animikii Bullet",
  122.             head="Lak. Hat +1",
  123.             neck="Sanctity Necklace",
  124.             ear1="Gwati Earring",
  125.             ear2="Hecate's Earring",
  126.             body="Lanun Frac +3",
  127.             hands="Carmine Fin. Ga. +1",
  128.             ring1="Dingir Ring",
  129.             ring2="Arvina Ringlet +1",
  130.             back=MABWSMantle,
  131.             waist="Eschan Stone",
  132.             legs={ name="Herculean Trousers", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Magic burst dmg.+1%','Mag. Acc.+11','"Mag.Atk.Bns."+15',}},
  133.             feet="Chass. Bottes +1"}
  134.     sets.QD.MidACC = set_combine(sets.QD,{})
  135.     sets.QD.HighACC = set_combine(sets.QD.MidACC,{
  136.             ear2="Hermetic Earring",
  137.             body="Mummu Jacket +2",
  138.             hands="Mummu Wrists +2",
  139.             ring1="Kishar Ring",
  140.             legs="Mummu Kecks +2"})
  141.  
  142.     -- PDT/MDT Sets --
  143.     sets.PDT = {
  144.             ammo="Chrono Bullet",
  145.             head="Meghanada Visor +2",
  146.             neck="Twilight Torque",
  147.             ear1="Odnowa Earring",
  148.             ear2="Odnowa Earring +1",
  149.             body="Meg. Cuirie +2",
  150.             hands="Meg. Gloves +2",
  151.             ring1="Defending Ring",
  152.             ring2="Gelatinous Ring +1",
  153.             back="Moonbeam Cape",
  154.             waist="Flume Belt",
  155.             legs="Mummu Kecks +2",
  156.             feet="Meg. Jam. +2"}
  157.  
  158.     sets.MDT = set_combine(sets.PDT,{})
  159.  
  160.     -- Roll Set --
  161.     sets.Rolls = {
  162.             ammo="Chrono Bullet",
  163.             head="Lanun Tricorne +1",
  164.             neck="Regal Necklace",
  165.             hands="Chasseur's Gants +1",
  166.             ring2="Luzaf's Ring",
  167.             back="Camulus's Mantle"}
  168.  
  169.     -- Preshot --
  170.     sets.Preshot = {
  171.             ammo="Chrono Bullet",
  172.             head="Chass. Tricorne +1",
  173.             neck="Marked Gorget",
  174.             ear1="Enervating Earring",
  175.             ear2="Telos Earring",
  176.             body="Laksa. Frac +3",
  177.             hands="Carmine Fin. Ga. +1",
  178.             ring1="Hajduk Ring +1",
  179.             ring2="Hajduk Ring +1",
  180.             back=PreShotMantle,
  181.             waist="Impulse Belt",
  182.             legs="Adhemar Kecks",
  183.             feet="Meg. Jam. +2"}
  184.  
  185.     -- Shooting Base Set --
  186.     sets.Midshot = {
  187.             ammo="Chrono Bullet",
  188.             head="Meghanada Visor +2",
  189.             neck="Marked Gorget",
  190.             ear1="Enervating Earring",
  191.             ear2="Telos Earring",
  192.             body="Mummu Jacket +2",
  193.             hands={ name="Adhemar Wristbands", augments={'AGI+10','Rng.Acc.+15','Rng.Atk.+15',}},
  194.             ring1="Mummu Ring",
  195.             ring2="Hajduk Ring +1",
  196.             back=MidShotMantle,
  197.             waist="Kwahu Kachina Belt",
  198.             legs="Adhemar Kecks",
  199.             feet="Mummu Gamash. +2"}
  200.  
  201.     -- Melee Sets --
  202.     sets.Melee = {
  203.             ammo="Chrono Bullet",
  204.             head="Dampening Tam",
  205.             neck="Lissome Necklace",
  206.             ear1="Suppanomimi",
  207.             ear2="Cessance Earring",
  208.             body="Adhemar Jacket",
  209.             hands={ name="Adhemar Wristbands", augments={'DEX+10','AGI+10','Accuracy+15',}},
  210.             ring1="Petrov Ring",
  211.             ring2="Epona's Ring",
  212.             back=STPMantle,
  213.             waist="Windbuffet Belt +1",
  214.             legs="Samnuha Tights",
  215.             feet={ name="Herculean Boots", augments={'Accuracy+26','"Store TP"+4','DEX+2','Attack+13',}}}
  216.     sets.Melee.MidACC = set_combine(sets.Melee,{
  217.             head="Carmine Mask +1",
  218.             legs="Carmine Cuisses +1"})
  219.     sets.Melee.HighACC = set_combine(sets.Melee.MidACC,{
  220.             neck="Subtlety Spec.",
  221.             ear2="Telos Earring",
  222.             hands="Meg. Gloves +2",
  223.             ring1="Meghanada Ring",
  224.             waist="Hurch'lan Sash",
  225.             feet="Meg. Jam. +2"})
  226.  
  227.     -- WS Base Set (multi-attack) --
  228.     sets.WS = {
  229.             ammo="Chrono Bullet",
  230.             head="Dampening Tam",
  231.             neck="Fotia Gorget",
  232.             ear1="Moonshade Earring",
  233.             ear2="Brutal Earring",
  234.             body="Adhemar Jacket",
  235.             hands="Adhemar Wristbands",
  236.             ring1="Ifrit Ring",
  237.             ring2="Epona's Ring",
  238.             back=STRWSDMantle,
  239.             waist="Fotia Belt",
  240.             legs="Carmine Cuisses +1",
  241.             feet={ name="Herculean Boots", augments={'Accuracy+26','"Store TP"+4','DEX+2','Attack+13',}}}
  242.     sets.WS.MidACC = set_combine(sets.WS,{})
  243.     sets.WS.HighACC = set_combine(sets.WS.MidACC,{})
  244.    
  245.     -- MAB WS Set --
  246.     sets.WS.MABWS = {
  247.             ammo="Eminent Bullet",
  248.             head={ name="Herculean Helm", augments={'Weapon skill damage +3%','Accuracy+23','Accuracy+18 Attack+18','Mag. Acc.+1 "Mag.Atk.Bns."+1',}},
  249.             neck="Sanctity Necklace",
  250.             ear1="Moonshade Earring",
  251.             ear2="Friomisi Earring",
  252.             body="Lanun Frac +3",
  253.             hands="Carmine Fin. Ga. +1",
  254.             ring1="Dingir Ring",
  255.             ring2="Arvina Ringlet +1",
  256.             back=MABWSMantle,
  257.             waist="Eschan Stone",
  258.             legs={ name="Herculean Trousers", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','Magic burst dmg.+1%','Mag. Acc.+11','"Mag.Atk.Bns."+15',}},
  259.             feet="Lanun Bottes +3"}
  260.    
  261.     -- One-Hit WS Base Set --
  262.     sets.WS.OneHit = {
  263.             ammo="Chrono Bullet",
  264.             head={ name="Herculean Helm", augments={'Weapon skill damage +3%','Accuracy+23','Accuracy+18 Attack+18','Mag. Acc.+1 "Mag.Atk.Bns."+1',}},
  265.             neck="Caro Necklace",
  266.             ear1="Moonshade Earring",
  267.             ear2="Ishvara Earring",
  268.             body="Laksa. Frac +3",
  269.             hands="Meg. Gloves +2",
  270.             ring1="Ifrit Ring",
  271.             ring2="Ifrit Ring",
  272.             back=STRWSDMantle,
  273.             waist="Prosilio Belt",
  274.             legs={ name="Herculean Trousers", augments={'Accuracy+25','Weapon skill damage +3%','AGI+7',}},
  275.             feet="Lanun Bottes +3"}
  276.     sets.WS.OneHit.MidACC = set_combine(sets.WS.OneHit,{})
  277.     sets.WS.OneHit.HighACC = set_combine(sets.WS.OneHit.MidACC,{})
  278.  
  279.     -- Ranged WS Base Set --
  280.     sets.WS.Ranged = {
  281.             ammo="Chrono Bullet",
  282.             head="Meghanada Visor +2",
  283.             neck="Fotia Gorget",
  284.             ear1="Moonshade Earring",
  285.             ear2="Ishvara Earring",
  286.             body="Laksa. Frac +3",
  287.             hands="Meg. Gloves +2",
  288.             ring1="Dingir Ring",
  289.             ring2="Garuda Ring +1",
  290.             back=AGIWSDMantle,
  291.             waist="Fotia Belt",
  292.             legs="Meg. Chausses +2",
  293.             feet="Lanun Bottes +3"}
  294.     sets.WS.Ranged.MidACC = set_combine(sets.WS.Ranged,{})
  295.     sets.WS.Ranged.HighACC = set_combine(sets.WS.Ranged.MidACC,{})
  296.  
  297.     -- Sword WS Sets --
  298.    
  299.     -- Savage Blade Set --
  300.     sets.WS["Savage Blade"] = set_combine(sets.WS.OneHit,{
  301.             ring2="Rufescent Ring"})
  302.     sets.WS["Savage Blade"].MidACC = set_combine(sets.WS.OneHit.MidACC,{
  303.             ring2="Rufescent Ring"})
  304.     sets.WS["Savage Blade"].HighACC = set_combine(sets.WS.OneHit.HighACC,{
  305.             ring2="Rufescent Ring"})
  306.    
  307.     -- Requiescat Set --
  308.     sets.WS.Requiescat = set_combine(sets.WS,{
  309.             ring1="Rufescent Ring"})
  310.     sets.WS.Requiescat.MidACC = set_combine(sets.WS.MidACC,{
  311.             ring1="Rufescent Ring"})
  312.     sets.WS.Requiescat.HighACC = set_combine(sets.WS.HighACC,{
  313.             ring1="Rufescent Ring"})
  314.    
  315.     -- Dagger WS Sets --
  316.    
  317.     -- Evisceration Set --
  318.     sets.WS.Evisceration = set_combine(sets.WS,{})
  319.     sets.WS.Evisceration.MidACC = set_combine(sets.WS.MidACC,{})
  320.     sets.WS.Evisceration.HighACC = set_combine(sets.WS.HighACC,{})
  321.    
  322.     -- Exenterator Set --
  323.     sets.WS.Exenterator = set_combine(sets.WS,{})
  324.     sets.WS.Exenterator.MidACC = set_combine(sets.WS.MidACC,{})
  325.     sets.WS.Exenterator.HighACC = set_combine(sets.WS.HighACC,{})
  326.    
  327.     -- Marksmanship WS Sets --
  328.    
  329.     -- Hot Shot Sets --
  330.     sets.WS["Hot Shot"] = set_combine(sets.WS.Ranged,{})
  331.     sets.WS["Hot Shot"].MidACC = set_combine(sets.WS.Ranged.MidACC,{})
  332.     sets.WS["Hot Shot"].HighACC = set_combine(sets.WS.Ranged.HighACC,{})
  333.    
  334.     -- Split Shot Sets --
  335.     sets.WS["Split Shot"] = set_combine(sets.WS.Ranged,{})
  336.     sets.WS["Split Shot"].MidACC = set_combine(sets.WS.Ranged.MidACC,{})
  337.     sets.WS["Split Shot"].HighACC = set_combine(sets.WS.Ranged.HighACC,{})
  338.    
  339.     -- Sniper Shot Sets --
  340.     sets.WS["Sniper Shot"] = set_combine(sets.WS.Ranged,{})
  341.     sets.WS["Sniper Shot"].MidACC = set_combine(sets.WS.Ranged.MidACC,{})
  342.     sets.WS["Sniper Shot"].HighACC = set_combine(sets.WS.Ranged.HighACC,{})
  343.    
  344.     -- Slug Shot Sets --
  345.     sets.WS["Slug Shot"] = set_combine(sets.WS.Ranged,{})
  346.     sets.WS["Slug Shot"].MidACC = set_combine(sets.WS.Ranged.MidACC,{})
  347.     sets.WS["Slug Shot"].HighACC = set_combine(sets.WS.Ranged.HighACC,{})
  348.    
  349.     -- Detonator Sets --
  350.     sets.WS.Detonator = set_combine(sets.WS.Ranged,{})
  351.     sets.WS.Detonator.MidACC = set_combine(sets.WS.Ranged.MidACC,{})
  352.     sets.WS.Detonator.HighACC = set_combine(sets.WS.Ranged.HighACC,{})
  353.    
  354.     -- Numbing Shot Sets --
  355.     sets.WS["Numbing Shot"] = set_combine(sets.WS.Ranged,{})
  356.     sets.WS["Numbing Shot"].MidACC = set_combine(sets.WS.Ranged.MidACC,{})
  357.     sets.WS["Numbing Shot"].HighACC = set_combine(sets.WS.Ranged.HighACC,{})
  358.  
  359.     -- Last Stand Sets --
  360.     sets.WS["Last Stand"] = set_combine(sets.WS.Ranged,{})
  361.     sets.WS["Last Stand"].MidACC = set_combine(sets.WS.Ranged.MidACC,{})
  362.     sets.WS["Last Stand"].HighACC = set_combine(sets.WS.Ranged.HighACC,{})
  363.  
  364.     -- Wildfire Sets --
  365.     sets.WS.Wildfire = set_combine(sets.WS.MABWS,{})
  366.     sets.WS.Wildfire.MidACC = set_combine(sets.WS.MABWS,{})
  367.     sets.WS.Wildfire.HighACC = set_combine(sets.WS.MABWS,{})
  368.  
  369.     -- Leaden Salute Sets --
  370.     sets.WS['Leaden Salute'] = set_combine(sets.WS.MABWS,{
  371.             head="Pixie Hairpin +1",
  372.             ring2="Archon Ring"})
  373.     sets.WS['Leaden Salute'].MidACC = set_combine(sets.WS.MABWS,{
  374.             head="Pixie Hairpin +1",
  375.             ring2="Archon Ring"})
  376.     sets.WS['Leaden Salute'].HighAC = set_combine(sets.WS.MABWS,{
  377.             head="Pixie Hairpin +1",
  378.             ring2="Archon Ring"})
  379.  
  380.     -- Elemental Obi --
  381.     sets.Obi = {waist="Hachirin-no-obi"}
  382.     sets.Obi.Lightning = {waist="Hachirin-no-obi"}
  383.     sets.Obi.Water = {waist="Hachirin-no-obi"}
  384.     sets.Obi.Fire = {waist="Hachirin-no-obi"}
  385.     sets.Obi.Ice = {waist="Hachirin-no-obi"}
  386.     sets.Obi.Wind = {waist="Hachirin-no-obi"}
  387.     sets.Obi.Earth = {waist="Hachirin-no-obi"}
  388.     sets.Obi.Light = {waist="Hachirin-no-obi"}
  389.     sets.Obi.Dark = {waist="Hachirin-no-obi"}
  390.  
  391.     -- JA Sets --
  392.     sets.JA = {}
  393.     sets.JA["Random Deal"] = {body="Lanun Frac +3"}
  394.     sets.JA.Fold = {}
  395.     sets.JA["Snake Eye"] = {legs="Lanun Trews +1"}
  396.     sets.JA["Wild Card"] = {feet="Lanun Bottes +3"}
  397.     sets.JA["Double-Up"] = {
  398.             ammo="Chrono Bullet",
  399.             head="Lanun Tricorne +1",
  400.             neck="Regal Necklace",
  401.             hands="Chasseur's Gants +1",
  402.             ring2="Luzaf's Ring",
  403.             back="Camulus's Mantle"}
  404.  
  405.     -- Waltz Set --
  406.     sets.Waltz = {}
  407.  
  408.     sets.Precast = {}
  409.     --Fastcast Set --
  410.     sets.Precast.FastCast = {
  411.             ammo="Chrono Bullet",
  412.             head="Carmine Mask +1",
  413.             neck="Voltsurge Torque",
  414.             ear1="Loquac. Earring",
  415.             body="Taeon Tabard",
  416.             hands="Leyline Gloves",
  417.             ring1="Lebeche Ring",
  418.             ring2="Kishar Ring",
  419.             waist="Flume Belt",
  420.             legs="Carmine Cuisses +1"}
  421.  
  422.     sets.Midcast = {
  423.             ammo="Chrono Bullet",
  424.             head="Carmine Mask +1",
  425.             neck="Twilight Torque",
  426.             ear1="Loquac. Earring",
  427.             body="Taeon Tabard",
  428.             hands="Leyline Gloves",
  429.             ring1="Defending Ring",
  430.             ring2="Kishar Ring",
  431.             waist="Flume Belt",
  432.             legs="Carmine Cuisses +1"}
  433.            
  434.     -- Magic Haste Set --
  435.     sets.Midcast.Haste = set_combine(sets.PDT,{
  436.             ammo="Chrono Bullet",
  437.             head="Carmine Mask +1",
  438.             neck="Twilight Torque",
  439.             ear1="Loquac. Earring",
  440.             body="Taeon Tabard",
  441.             hands="Leyline Gloves",
  442.             ring1="Defending Ring",
  443.             ring2="Kishar Ring",
  444.             waist="Flume Belt",
  445.             legs="Carmine Cuisses +1"})
  446.  
  447.     -- Cure Set --
  448.     sets.Midcast.Cure = {}
  449. end
  450.  
  451. function pretarget(spell,action)    if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  452.         cancel_spell()
  453.         send_command('input /item "Echo Drops" <me>')
  454.     elseif spell.type == "CorsairRoll" and buffactive[spell.english] then -- Change Any Rolls To Double-Up When You Have A Roll Up --
  455.         cancel_spell()
  456.         send_command('doubleup')
  457.     elseif spell.english == "Seigan" and buffactive.Seigan then -- Change Seigan To Third Eye If Seigan Is On --
  458.         cancel_spell()
  459.         send_command('ThirdEye')
  460.     elseif spell.english == "Meditate" and player.tp > 2900 then -- Cancel Meditate If TP Is Above 2900 --
  461.         cancel_spell()
  462.         add_to_chat(123, spell.name .. ' Canceled: ' .. player.tp)
  463.     elseif spell.action_type == 'Ranged Attack' then
  464.         if spell.target.distance > 24.9 then -- Cancel Ranged Attack If You Are Out Of Range --
  465.             cancel_spell()
  466.             add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  467.             return
  468.         else
  469.             if AutoMode == 'ON' and not buffactive.amnesia then -- Auto WS/Triple Shot --
  470.                 if player.tp >= 1000 then
  471.                     cancel_spell()
  472.                     autoWS()
  473.                 elseif windower.ffxi.get_ability_recasts()[84] < 1 then
  474.                     cancel_spell()
  475.                     send_command('TripleShot')
  476.                 end
  477.             end
  478.         end
  479.     elseif spell.type == 'WeaponSkill' and player.status == 'Engaged' then
  480.         if spell.skill == 'Marksmanship' then
  481.             if spell.target.distance > 16+target_distance then
  482.                 cancel_spell()
  483.                 add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  484.                 return
  485.             end
  486.         else
  487.             if spell.target.distance > target_distance then
  488.                 cancel_spell()
  489.                 add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  490.                 return
  491.             end
  492.         end
  493.     end
  494. end
  495.  
  496.  -- detected a error in the user funcion precast: COR.lua:367: attempt to index field '?' (a nil value) --
  497.  
  498. function precast(spell,action)
  499.     if spell.action_type == 'Ranged Attack' or spell.type == "WeaponSkill" then
  500.         if player.equipment.ammo == "Animikii Bullet" then -- Cancel Ranged Attack or WS If You Have Animikii Bullet Equipped --
  501.             cancel_spell()
  502.             add_to_chat(123, spell.name .. ' Canceled: [Animikii Bullet Equipped!]')
  503.             return
  504.         else
  505.             local check_ammo
  506.             local check_ammo_count = 1
  507.             if spell.action_type == 'Ranged Attack' then
  508.                 check_ammo = player.equipment.ammo
  509.                 if player.equipment.ammo == 'empty' or player.inventory[check_ammo].count <= check_ammo_count then
  510.                     add_to_chat(123, spell.name..' Canceled: [Out of Ammo]')
  511.                     cancel_spell()
  512.                     return
  513.                 else
  514.                     equip(sets.Preshot,(buffactive["Triple Shot"] and {body="Chasseur's Frac +1"} or {}))
  515.                     if player.inventory[check_ammo].count <= ammo_warning_limit and player.inventory[check_ammo].count > 1 and not warning then
  516.                         add_to_chat(8, '***** [Low Ammo Warning!] *****')
  517.                         warning = true
  518.                     elseif player.inventory[check_ammo].count > ammo_warning_limit and warning then
  519.                         warning = false
  520.                     end
  521.                 end
  522.             elseif spell.type == "WeaponSkill" then
  523.                 if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  524.                     cancel_spell()
  525.                     add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  526.                     return
  527.                 else
  528.                     equipSet = sets.WS
  529.                     if equipSet[spell.english] then
  530.                         equipSet = equipSet[spell.english]
  531.                     end
  532.                     if equipSet[AccArray[AccIndex]] then
  533.                         equipSet = equipSet[AccArray[AccIndex]]
  534.                     end
  535.                     if buffactive['Reive Mark'] then -- Equip Ygnas's Resolve +1 During Reive --
  536.                         equipSet = set_combine(equipSet,{})
  537.                     end
  538.                     if spell.english == "Last Stand" and player.tp > 2750 or player.equipment.range == 'Fomalhaut' and player.tp > 2250 then
  539.                         equipSet = set_combine(equipSet,{ear1="Auster's Pearl"})
  540.                     elseif spell.english == "Leaden Salute" and player.tp > 2750 or player.equipment.range == 'Fomalhaut' and player.tp > 2250 then
  541.                         equipSet = set_combine(equipSet,{ear1="Hermetic Earring"})
  542.                     elseif spell.english == "Leaden Salute" and world.day == "Darksday" or world.weather_element == "Dark" then
  543.                         equipSet = set_combine(equipSet,{waist="Hachirin-no-Obi"})
  544.                     elseif spell.english == "Wildfire" and player.tp > 2750 or player.equipment.range == 'Fomalhaut' and player.tp > 2250 then
  545.                         equipSet = set_combine(equipSet,{ear1="Hermetic Earring"})     
  546.                     elseif spell.english == "Wildfire" and world.day == "Firesday" or world.weather_element == "Fire" then
  547.                         equipSet = set_combine(equipSet,{waist="Hachirin-no-Obi"})
  548.                     elseif spell.english == "Savage Blade" and player.tp > 2750 or player.equipment.range == 'Anarchy +2' and player.tp > 1750 then
  549.                         equipSet = set_combine(equipSet,{ear1="Flame Pearl"})
  550.                     end
  551.                     equip(equipSet)
  552.                 end
  553.             end
  554.         end
  555.     elseif spell.type == "JobAbility" then
  556.         if sets.JA[spell.english] then
  557.             equip(sets.JA[spell.english])
  558.         end
  559.     elseif spell.type == "CorsairRoll" or spell.english == "Double-Up" then
  560.         equip(sets.Rolls)
  561.         if spell.english == "Tactician's Roll" then -- Change Tactician's Roll Equipment Here --
  562.             equip({body="Chasseur's Frac +1"})
  563.         elseif spell.english == "Caster's Roll" then -- Change Caster's Roll Equipment Here --
  564.             equip({legs="Chas. Culottes +1"})
  565.         elseif spell.english == "Courser's Roll" then -- Change Courser's Roll Equipment Here --
  566.             equip({feet="Chass. Bottes +1"})
  567.         elseif spell.english == "Blitzer's Roll" then -- Change Blitzer's Roll Equipment Here --
  568.             equip({})
  569.         elseif spell.english == "Allies' Roll" then -- Change Allies' Roll Equipment Here --
  570.             equip({hands="Chasseur's Gants +1"})
  571.         end
  572.     elseif spell.type == "CorsairShot" then
  573.         equipSet = sets.QD
  574.         if ACC_Shots:contains(spell.english) then
  575.             equipSet = sets.QD.HighACC
  576.         else
  577.             if equipSet[AccArray[AccIndex]] then
  578.                 equipSet = equipSet[AccArray[AccIndex]]
  579.             end
  580.             if not ACC_Shots:contains(spell.english) and (world.day_element == spell.element or world.weather_element == spell.element) and sets.Obi[spell.element] and Obi == 'ON' then -- Use Obi Toggle To Unlock Elemental Obi --
  581.                 equipSet = set_combine(equipSet,sets.Obi[spell.element])
  582.             end
  583.         end
  584.         equip(equipSet)
  585.     elseif spell.action_type == 'Magic' then
  586.         if spell.english == 'Utsusemi: Ni' then
  587.             if buffactive['Copy Image (3)'] then
  588.                 cancel_spell()
  589.                 add_to_chat(123, spell.name .. ' Canceled: [3 Images]')
  590.                 return
  591.             else
  592.                 equip(sets.Precast.FastCast)
  593.             end
  594.         else
  595.             equip(sets.Precast.FastCast)
  596.         end
  597.     elseif spell.type == "Waltz" then
  598.         equip(sets.Waltz)
  599.     elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  600.         cast_delay(0.2)
  601.         send_command('cancel Sneak')
  602.     end
  603. end
  604.  
  605. function midcast(spell,action)
  606.     if spell.action_type == 'Ranged Attack' then
  607.         equipSet = sets.Midshot
  608.         if equipSet[player.equipment.range] then
  609.             equipSet = equipSet[player.equipment.range]
  610.         end
  611.         if equipSet[AccArray[AccIndex]] then
  612.             equipSet = equipSet[AccArray[AccIndex]]
  613.         end
  614.         if buffactive['Triple Shot'] then
  615.             equipSet = set_combine(equipSet,{body="Chasseur's Frac +1"})
  616.         end
  617.         equip(equipSet)
  618.     elseif spell.action_type == 'Magic' then
  619.         if spell.english:startswith('Cur') and spell.english ~= "Cursna" then
  620.             equip(sets.Midcast.Cure)
  621.         elseif spell.english == "Stoneskin" then
  622.             if buffactive.Stoneskin then
  623.                 send_command('@wait 2.8;cancel stoneskin')
  624.             end
  625.             equip(sets.Midcast.Stoneskin)
  626.         elseif spell.english == "Sneak" then
  627.             if spell.target.name == player.name and buffactive['Sneak'] then
  628.                 send_command('cancel sneak')
  629.             end
  630.             equip(sets.Midcast.Haste)
  631.         elseif spell.english:startswith('Utsusemi') then
  632.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)'] or buffactive['Copy Image (3)']) then
  633.                 send_command('@wait 1.7;cancel Copy Image*')
  634.             end
  635.             equip(sets.Midcast.Haste)
  636.         elseif spell.english == 'Monomi: Ichi' then
  637.             if buffactive['Sneak'] then
  638.                 send_command('@wait 1.7;cancel sneak')
  639.             end
  640.             equip(sets.Midcast.Haste)
  641.         else
  642.             equip(sets.Midcast.Haste)
  643.         end
  644.     end
  645. end
  646.  
  647. function aftercast(spell,action)
  648.     if spell.action_type == 'Ranged Attack' and AutoMode == 'ON' then
  649.         autoRA()
  650.     else
  651.         status_change(player.status)
  652.     end
  653.     if not spell.interrupted then
  654.         if spell.type == "WeaponSkill" then
  655.             send_command('wait 0.2;gs c TP')
  656.         elseif spell.type == 'CorsairRoll' then
  657.             display_roll_info(spell)
  658.         elseif spell.english == 'Light Shot' then -- Sleep Countdown --
  659.             send_command('wait 50;input /echo '..spell.name..' Effect: [WEARING OFF IN 10 SEC.];wait 10;input /echo '..spell.name..' Effect: [OFF]')
  660.         end
  661.     end
  662. end
  663.  
  664. function status_change(new,old)
  665.     if Armor == 'PDT' or buffactive.Terror or buffactive.Stun or buffactive.Petrification or buffactive.Sleep then
  666.         equip(sets.PDT)
  667.     elseif Armor == 'MDT' then
  668.         equip(sets.MDT)
  669.     elseif new == 'Engaged' then
  670.         equipSet = sets.Melee
  671.         if equipSet[AccArray[AccIndex]] then
  672.             equipSet = equipSet[AccArray[AccIndex]]
  673.         end
  674.         if buffactive['Reive Mark'] then -- Equip Ygnas's Resolve +1 During Reive --
  675.             equipSet = set_combine(equipSet,{})
  676.         end
  677.         equip(equipSet)
  678.     elseif new == 'Idle' then
  679.         equip(sets.Idle[IdleArray[IdleIndex]])
  680.     elseif new == 'Resting' then
  681.         equip(sets.Resting)
  682.     end
  683. end
  684.  
  685.  function buff_change(buff,gain,loss)
  686.     buff = string.lower(buff)
  687.     if gain then  
  688.         add_to_chat(158,'--- Gained: ['..buff..']')
  689.     elseif loss then
  690.         add_to_chat(123,'--- Lost: ['..buff..']')
  691.     end
  692.     if not midaction() then
  693.         status_change(player.status)
  694.     end
  695.  end
  696.  
  697. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  698. function self_command(command)
  699.     if command == 'acc' then -- Accuracy Level Toggle --
  700.         AccIndex = (AccIndex % #AccArray) + 1
  701.         status_change(player.status)
  702.         add_to_chat(155,'Accuracy Level: ' .. AccArray[AccIndex])
  703.     elseif command == 'update' then -- Auto Update Gear Toggle --
  704.         status_change(player.status)
  705.         add_to_chat(155,'Auto Update Gear')
  706.     elseif command == 'obi' then -- Obi Toggle --
  707.         if Obi == 'ON' then
  708.             Obi = 'OFF'
  709.             add_to_chat(123,'Obi: [OFF]')
  710.         else
  711.             Obi = 'ON'
  712.             add_to_chat(158,'Obi: [ON]')
  713.         end
  714.         status_change(player.status)
  715.     elseif command == 'pdt' then -- PDT Toggle --
  716.         if Armor == 'PDT' then
  717.             Armor = 'None'
  718.             add_to_chat(123,'PDT Set: [Unlocked]')
  719.         else
  720.             Armor = 'PDT'
  721.             add_to_chat(158,'PDT Set: [Locked]')
  722.         end
  723.         status_change(player.status)
  724.     elseif command == 'mdt' then -- MDT Toggle --
  725.         if Armor == 'MDT' then
  726.             Armor = 'None'
  727.             add_to_chat(123,'MDT Set: [Unlocked]')
  728.         else
  729.             Armor = 'MDT'
  730.             add_to_chat(158,'MDT Set: [Locked]')
  731.         end
  732.         status_change(player.status)
  733.     elseif command == 'mainlock' then -- Lock Main Weapon Toggle --
  734.         if Lock_Main == 'ON' then
  735.             Lock_Main = 'OFF'
  736.             add_to_chat(123,'Main Weapon: [Unlocked]')
  737.         else
  738.             Lock_Main = 'ON'
  739.             add_to_chat(158,'Main Weapon: [Locked]')
  740.         end
  741.         status_change(player.status)
  742.     elseif command == 'distance' then -- Distance Toggle --
  743.         if player.target.distance then
  744.             target_distance = math.floor(player.target.distance*10)/10
  745.             add_to_chat(155,'Distance: '..target_distance)
  746.         else
  747.             add_to_chat(123,'No Target Selected')
  748.         end
  749.     elseif command == 'idle' then -- Idle Toggle --
  750.         IdleIndex = (IdleIndex % #IdleArray) + 1
  751.         status_change(player.status)
  752.         add_to_chat(155,'Idle Set: ' .. IdleArray[IdleIndex])
  753.     elseif command == 'C2' then -- Auto RA/WS Toggle. *Don't Rely On This. It Isn't As Fast As Shooting Manually. It Is Mainly For AFK or When You Dualbox* --
  754.         if AutoMode == 'ON' then
  755.             AutoMode = 'OFF'
  756.             add_to_chat(123,'Auto Mode: [OFF]')
  757.         else
  758.             AutoMode = 'ON'
  759.             add_to_chat(158,'Auto Mode: [ON]')
  760.         end
  761.     elseif command == 'TP' then
  762.         add_to_chat(155,'TP Return: ['..tostring(player.tp)..']')
  763.     elseif command:match('^SC%d$') then
  764.         send_command('//' .. sc_map[command])
  765.     end
  766. end
  767.  
  768. function autoRA() -- Make Auto RA Delay Adjustment Here --
  769.     local delay = '2.2'
  770.     if spell.type == "WeaponSkill" then
  771.         delay = '2.25'
  772.     else
  773.         if buffactive["Courser's Roll"] then
  774.             delay = '0.7'
  775.         elseif buffactive[581] then -- Flurry II --
  776.             delay = '0.5'
  777.         else
  778.             delay = '1.05'
  779.         end
  780.     end
  781.     send_command('@wait '..delay..'; input /ra <t>')
  782. end
  783.  
  784. function autoWS()
  785.     send_command('input /ws "'..AutoGunWS..'" <t>')
  786. end
  787.  
  788. function define_roll_values()
  789.     rolls = {
  790.         CorsairsRoll    = {lucky=5, unlucky=9, bonus="Experience Points"},
  791.         NinjaRoll       = {lucky=4, unlucky=8, bonus="Evasion"},
  792.         HuntersRoll     = {lucky=4, unlucky=8, bonus="Accuracy"},
  793.         ChaosRoll       = {lucky=4, unlucky=8, bonus="Attack"},
  794.         MagussRoll      = {lucky=2, unlucky=6, bonus="Magic Defense"},
  795.         HealersRoll     = {lucky=3, unlucky=7, bonus="Cure Potency Received"},
  796.         PuppetRoll      = {lucky=4, unlucky=8, bonus="Pet Magic Accuracy/Attack"},
  797.         ChoralRoll      = {lucky=2, unlucky=6, bonus="Spell Interruption Rate"},
  798.         MonksRoll       = {lucky=3, unlucky=7, bonus="Subtle Blow"},
  799.         BeastRoll       = {lucky=4, unlucky=8, bonus="Pet Attack"},
  800.         SamuraiRoll     = {lucky=2, unlucky=6, bonus="Store TP"},
  801.         EvokersRoll     = {lucky=5, unlucky=9, bonus="Refresh"},
  802.         RoguesRoll      = {lucky=5, unlucky=9, bonus="Critical Hit Rate"},
  803.         WarlocksRoll    = {lucky=4, unlucky=8, bonus="Magic Accuracy"},
  804.         FightersRoll    = {lucky=5, unlucky=9, bonus="Double Attack Rate"},
  805.         DrachenRoll     = {lucky=3, unlucky=7, bonus="Pet Accuracy"},
  806.         GallantsRoll    = {lucky=3, unlucky=7, bonus="Defense"},
  807.         WizardsRoll     = {lucky=5, unlucky=9, bonus="Magic Attack"},
  808.         DancersRoll     = {lucky=3, unlucky=7, bonus="Regen"},
  809.         ScholarsRoll    = {lucky=2, unlucky=6, bonus="Conserve MP"},
  810.         BoltersRoll     = {lucky=3, unlucky=9, bonus="Movement Speed"},
  811.         CastersRoll     = {lucky=2, unlucky=7, bonus="Fast Cast"},
  812.         CoursersRoll    = {lucky=3, unlucky=9, bonus="Snapshot"},
  813.         BlitzersRoll    = {lucky=4, unlucky=9, bonus="Attack Delay"},
  814.         TacticiansRoll  = {lucky=5, unlucky=8, bonus="Regain"},
  815.         AlliessRoll     = {lucky=3, unlucky=10, bonus="Skillchain Damage"},
  816.         MisersRoll      = {lucky=5, unlucky=7, bonus="Save TP"},
  817.         CompanionsRoll  = {lucky=2, unlucky=10, bonus="Pet Regain and Regen"},
  818.         AvengersRoll    = {lucky=4, unlucky=8, bonus="Counter Rate"}
  819.         }
  820. end
  821.  
  822. function display_roll_info(spell)
  823.     rollinfo = rolls[(string.gsub((string.gsub(spell.english, "%'+", "")), "%s+", ""))]
  824.     if rollinfo then
  825.         add_to_chat(155, spell.english..' = '..rollinfo.bonus..'. Lucky Roll is '..
  826.         tostring(rollinfo.lucky)..', Unlucky Roll is '..tostring(rollinfo.unlucky)..'.')
  827.     end
  828. end
  829.  
  830. function find_player_in_alliance(name)
  831.     for i,v in ipairs(alliance) do
  832.         for k,p in ipairs(v) do
  833.             if p.name == name then
  834.                 return p
  835.             end
  836.         end
  837.     end
  838. end
  839.  
  840. function actualCost(originalCost)
  841.     if buffactive["Penury"] then
  842.         return originalCost*.5
  843.     elseif buffactive["Light Arts"] then
  844.         return originalCost*.9
  845.     else
  846.         return originalCost
  847.     end
  848. end
  849.  
  850. function degrade_spell(spell,degrade_array)
  851.     spell_index = table.find(degrade_array,spell.name)
  852.     if spell_index>1 then
  853.         new_spell = degrade_array[spell_index - 1]
  854.         change_spell(new_spell,spell.target.raw)
  855.         add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
  856.     end
  857. end
  858.  
  859. function change_spell(spell_name,target)
  860.     cancel_spell()
  861.     send_command('//'..spell_name..' '..target)
  862. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement