Advertisement
Arnan

COR (mule) Lua January 2018

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