Guest User

Untitled

a guest
Jul 21st, 2014
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 25.48 KB | None | 0 0
  1. function get_sets()
  2.     AccIndex = 1
  3.     AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For Magic. Default ACC Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below --
  4.     IdleIndex = 1
  5.     IdleArray = {"Movement","Refresh"} -- Default Idle Set Is Movement --
  6.     MainLock = 0
  7.     Enmity = 'OFF' -- Set Default Enmity Set ON or OFF Here --
  8.     Armor = 'None'
  9.     StunIndex = 0
  10.     Obi = 'ON' -- Turn Default Obi ON or OFF Here --
  11.     target_distance = 5 -- Set Default Distance Here --
  12.     Enmity = 'OFF' -- Set Default Enmity Set ON or OFF Here --
  13.     select_default_macro_book() -- Change Default Macro Book at End --
  14.     send_command('exec binds.txt')
  15.     Non_Obi_Spells = S{
  16.             'Burn','Choke','Drown','Frost','Rasp','Shock','Impact','Anemohelix','Cryohelix',
  17.             'Geohelix','Hydrohelix','Ionohelix','Luminohelix','Noctohelix','Pyrohelix'}
  18.  
  19.     Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
  20.     Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
  21.     sc_map = {SC1 = "Composure", SC2 = "Stun", SC3 = "Chainspell"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
  22.  
  23.     -- Idle Sets --
  24.     sets.Idle = {}
  25.     sets.Idle.Refresh = {
  26.             main="Bolelabunga",
  27.             sub="Genbu's Shield",
  28.             ammo="Oreiad's Tathlum",
  29.             head="Viti. Chapeau +1",
  30.             neck="Twilight Torque",
  31.             ear1="Moonshade Earring",
  32.             ear2="Ethereal Earring",
  33.             body="Atrophy Tabard +1",
  34.             hands="Serpentes Cuffs",
  35.             ring1="Sangoma Ring",
  36.             ring2="Shadow Ring",
  37.             back="Umbra Cape",
  38.             waist="Fucho-no-obi",
  39.             legs="Nares Trews",
  40.             feet="Serpentes Sabots"}
  41.     sets.Idle.Movement = set_combine(sets.Idle.Refresh,{
  42.             legs="Blood Cuisses"})
  43.     sets.Resting = set_combine(sets.Idle.Movement,{})
  44.  
  45.     -- PDT Set --
  46.     sets.PDT = {}
  47.  
  48.     sets.Sublimation = {}
  49.  
  50.     sets.Precast = {}
  51.  
  52.     -- Fastcast Set --
  53.     sets.Precast.FastCast = {
  54.             ammo="Impatiens",
  55.             head="Atro. Chapeau +1",
  56.             neck="Orunmila's Torque",
  57.             ear2="Loquac. Earring",
  58.             ear1="Estq. Earring",
  59.             body="Viti. Tabard +1",
  60.             hands="Gendewitha Gages",
  61.             ring1="Prolix Ring",
  62.             ring2="Veneficium Ring",
  63.             back="Swith Cape",
  64.             waist="Witful Belt",
  65.             legs="Artesieq Hose",
  66.             feet="Chelona Boots +1"}
  67.  
  68.     --[[ Elemental Staves --
  69.     sets.Precast.Thunder = {main='Apamajas I'}
  70.     sets.Precast.Water = {main='Haoma I'}
  71.     sets.Precast.Fire = {main='Atar I'}
  72.     sets.Precast.Ice = {main='Vourukasha I'}
  73.     sets.Precast.Wind = {main='Vayuvata I'}
  74.     sets.Precast.Earth = {main='Vishrava I'}
  75.     sets.Precast.Light = {main='Arka I'}
  76.     sets.Precast.Dark = {main='Xsaeta I'}]]--
  77.  
  78.     -- Precast Enhancing Magic --
  79.     sets.Precast['Enhancing Magic'] = set_combine(sets.Precast.FastCast,{waist="Siegel Sash"})
  80.  
  81.     -- Precast Cure Set --
  82.     sets.Precast.Cure = set_combine(sets.Precast.FastCast,{})
  83.  
  84.     -- Midcast Base Set --
  85.     sets.Midcast = {}
  86.  
  87.     -- Haste Set --
  88.     sets.Midcast.Haste = {}
  89.  
  90.     -- Cure Set --
  91.     sets.Midcast.Cure = {
  92.             main="Tamaxchi",
  93.             sub="Sors Shield",
  94.             ammo="Oreiad's Tathlum",
  95.             head="Gende. Caubeen +1",
  96.             neck="Colossus's Torque",
  97.             ear1="Beatific Earring",
  98.             ear2="Roundel Earring",
  99.             body="Viti. Tabard +1",
  100.             hands="Lurid MItts",
  101.             ring1="Sirona's Ring",
  102.             ring2="Haoma's Ring",
  103.             back="Pahtli Cape",
  104.             waist="Bishop's Sash",
  105.             legs="Atrophy Tights +1",
  106.             feet="Vitivation Boots +1"}
  107.            
  108.     sets.Midcast.Cure.Enmity = set_combine(sets.Midcast.Cure,{
  109.             range="Failnaught",
  110.             neck="Lasaia Pendant",
  111.             ear1="Novia Earring",
  112.             hands="Hagondes Cuffs +1"})
  113.  
  114.     -- Curaga Set --
  115.     sets.Midcast.Curaga = set_combine(sets.Midcast.Cure.Enmity,{})
  116.  
  117.     -- Enhancing Magic --
  118.     sets.Midcast.Duration_Self = set_combine(sets.Midcast.Haste,{
  119.             hands="Atrophy Gloves +1",
  120.             back="Estoqueur's Cape",
  121.             feet="Estq. Houseaux +2"})
  122.    
  123.     sets.Midcast.Duration_Others = set_combine(sets.Midcast.Haste,{
  124.             head="Estq. Chappel +2",
  125.             body="Estq. Sayon +2",
  126.             hands="Atrophy Gloves +1",
  127.             back="Estoqueur's Cape",
  128.             legs="Estqr. Fuseau +2",
  129.             feet="Estq. Houseaux +2"})
  130.    
  131.     sets.Midcast['Enhancing Magic'] = {
  132.             head="Umuthi Cap",
  133.             neck="Colossus's Torque",
  134.             body="Viti. Tabard +1",
  135.             ear1="Andoaa Earring",
  136.             hands="Atrophy Gloves +1",
  137.             back="Estoqueur's Cape",
  138.             legs="Atrophy Tights +1",
  139.             --legs="Shedir Seraweels",
  140.             feet="Estq. Houseaux +2"}
  141.  
  142.     -- Stoneskin --
  143.     sets.Midcast.Stoneskin = {
  144.             neck="Stone Gorget",
  145.             ear1="Earthcry Earring",
  146.             hands="Stone Mufflers",
  147.             back="Estoqueur's Cape",
  148.             waist="Siegel Sash",
  149.             legs="Shedir Seraweels",
  150.             feet="Estq. Houseaux +2"}
  151.    
  152.     -- Regen --
  153.     sets.Midcast.Regen_Self = set_combine(sets.Midcast.Haste,{
  154.             main="Bolelabunga",
  155.             hands="Atrophy Gloves +1",
  156.             back="Estoqueur's Cape",
  157.             feet="Estq. Houseaux +2"})
  158.     sets.Midcast.Regen_Others = set_combine(sets.Midcast.Haste,{
  159.             main="Bolelabunga",
  160.             head="Estq. Chappel +2",
  161.             body="Estq. Sayon +2",
  162.             hands="Atrophy Gloves +1",
  163.             back="Estoqueur's Cape",
  164.             legs="Estqr. Fuseau +2",
  165.             feet="Estq. Houseaux +2"})
  166.            
  167.     -- Refresh --
  168.     sets.Midcast.Refresh_Self = set_combine(sets.Midcast.Haste,{
  169.             hands="Atrophy Gloves +1",
  170.             back="Estoqueur's Cape",
  171.             legs="Estqr. Fuseau +2",
  172.             feet="Estq. Houseaux +2"})
  173.     sets.Midcast.Refresh_Others = set_combine(sets.Midcast.Haste,{
  174.             head="Estq. Chappel +2",
  175.             body="Estq. Sayon +2",
  176.             hands="Atrophy Gloves +1",
  177.             back="Estoqueur's Cape",
  178.             legs="Estqr. Fuseau +2",
  179.             feet="Estq. Houseaux +2"})
  180.  
  181.     -- Cursna --
  182.     sets.Midcast.Cursna = set_combine(sets.Midcast.Haste,{
  183.             neck="Colossus's Torque",
  184.             ear2="Beatific Earring",
  185.             body="Viti. Tabard +1",
  186.             hands="Lurid MItts",
  187.             ring1="Haoma's Ring",
  188.             ring2="Haoma's Ring",
  189.             back="Altruistic Cape",
  190.             legs="Atrophy Tights +1",
  191.             feet="Gende. Galoshes"})
  192.  
  193.     -- Stun Sets --
  194.     sets.Midcast.Stun = {}
  195.     sets.Midcast.Stun.MidACC = set_combine(sets.Midcast.Stun,{})
  196.     sets.Midcast.Stun.HighACC = set_combine(sets.Midcast.Stun.MidACC,{})
  197.  
  198.     -- Dark Magic Sets --
  199.     sets.Midcast['Dark Magic'] = {
  200.         main="Ngqoqwanb",
  201.         sub="Mephitis Grip",
  202.         head="Atro. Cheapeau +1",
  203.         neck="Weike Torque",
  204.         ear1="Lifestorm Earring",
  205.         ear2="Psystorm Earring",
  206.         body="Atrophy Tabard +1",
  207.         hands="Gendewitha Gages",
  208.         ring1="Sangoma Ring",
  209.         ring2="Perception Ring",
  210.         back="Ogapepo Cape",
  211.         waist="Fucho-no-obi",
  212.         legs="Artsieq Hose"}
  213.     sets.Midcast['Dark Magic'].MidACC = set_combine(sets.Midcast['Dark Magic'],{})
  214.     sets.Midcast['Dark Magic'].HighACC = set_combine(sets.Midcast['Dark Magic'].MidACC,{})
  215.  
  216.     -- Elemental Sets --
  217.    
  218.     --High ATK/Low ACC
  219.     sets.Midcast['Elemental Magic'] = {
  220.             --main="Lehbrailg +2",
  221.             main="Ngqoqwanb",
  222.             --sub="Zuuxowu Grip",
  223.             sub="Mephitis Grip",
  224.             ammo="Dosis Tathlum",
  225.             --head="Hagondes Hat +1",
  226.             head="Atro. Chapeau +1",
  227.             --neck="Eddy Necklace",
  228.             neck="Imbodla Necklace",
  229.             ear1="Friomisi Earring",
  230.             --ear2="Crematio Earring",
  231.             ear2="Hecate's Earring",
  232.             body="Atrophy Tabard +1",
  233.             --hands="Hagondes Cuffs +1",
  234.             hands="Atrophy Gloves +1",
  235.             --ring1="Shiva Ring +1",
  236.             ring1="Shiva Ring",
  237.             --ring2="Shiva Ring +1",
  238.             ring2="Shiva Ring",
  239.             back="Toro Cape",
  240.             waist="Sekhmet Corset",
  241.             legs="Hagondes Pants +1",
  242.             feet="Umbani Boots"}
  243.    
  244.     --Mid ATK/Mid ACC
  245.     sets.Midcast['Elemental Magic'].MidACC = set_combine(sets.Midcast['Elemental Magic'],{
  246.             sub="Mephitis Grip",
  247.             ammo="Aureole",
  248.             head="Atro. Chapeau +1",
  249.             neck="Imbodla Necklace",
  250.             ear1="Lifestorm Earring",
  251.             ear2="Psystorm Earring",
  252.             --body="Artesiaq Jubbah",
  253.             ring1="Sangoma Ring",
  254.             waist="Tengu-no-Obi",
  255.             feet="Vitivation Boots +1"})
  256.    
  257.     --Low ATK/High ACC
  258.     sets.Midcast['Elemental Magic'].HighACC = set_combine(sets.Midcast['Elemental Magic'].MidACC,{})
  259.  
  260.     -- Enfeebling Sets --
  261.     sets.Midcast.MND = {
  262.             --main="Twebuliij",
  263.             main="Ngqoqwanb",
  264.             sub="Mephitis Grip",
  265.             ammo="Oreiad's Tathlum",
  266.             head="Viti. Chapeau +1",
  267.             neck="Imbodla Necklace",
  268.             ear1="Lifestorm Earring",
  269.             ear2="Psystorm Earring",
  270.             --body="Ischemia Chasu.",
  271.             body="Atrophy Tabard +1",
  272.             --hands="Lurid Mitts",
  273.             hands="Atrophy Gloves +1",
  274.             --ring1="Levia. Ring +1",
  275.             ring1="Sangoma Ring",
  276.             --ring2="Levia. Ring +1",
  277.             ring2="Aquasoul Ring",
  278.             back="Refraction Cape",
  279.             waist="Ovate Rope",
  280.             --legs="Mes'yohi Slacks",
  281.             legs="Artsieq Hose",
  282.             --feet="Uk'uxkaj Boots",
  283.             feet="Vitivation Boots +1"}
  284.     sets.Midcast.MND_MidACC =  set_combine(sets.Midcast.MND,{
  285.             range="Aureole",
  286.             --head="Artsieq Hat",
  287.             neck="Weike Torque",
  288.             --hands="Hagondes Cuffs +1",
  289.             ring1="Sangoma Ring",
  290.             ring2="Perception Ring",
  291.             --back="Ogapepo Cape +1",
  292.             back="Ogapepo Cape",           
  293.             --legs="Mes'yohi Slacks",
  294.             legs="Artsieq Hose",
  295.             --feet="Artsieq Boots",
  296.             feet="Vitivation Boots +1"
  297.             })
  298.     sets.Midcast.MND_HighACC = set_combine(sets.Midcast.MND_MidACC,{})
  299.    
  300.     sets.Midcast.INT = {
  301.             --main="Twebuliij",
  302.             main="Ngqoqwanb",
  303.             sub="Mephitis Grip",
  304.             ammo="Ombre Tathlum",
  305.             --head="Kaabnax Hat",
  306.             head="Viti. Chapeau +1",
  307.             neck="Imbodla Necklace",
  308.             ear1="Lifestorm Earring",
  309.             ear2="Psystorm Earring",
  310.             --body="Ischemia Chasu.",
  311.             body="Atrophy Tabard +1",
  312.             --hands="Lurid Mitts",
  313.             hands="Atrophy Gloves +1",
  314.             --ring1="Shiva Ring +1",
  315.             ring1="Shiva Ring",
  316.             --ring2="Shiva Ring +1",
  317.             ring2="Shiva Ring",
  318.             back="Refraction Cape",
  319.             waist="Wanion Belt",
  320.             --legs="Mes'yohi Slacks",
  321.             legs="Atrophy Tights +1",
  322.             --feet="Uk'uxkaj Boots"
  323.             feet="Vitivation Boots +1"}
  324.     sets.Midcast.INT_MidACC =  set_combine(sets.Midcast.INT,{
  325.             range="Aureole",
  326.             --head="Artsieq Hat",
  327.             neck="Weike Torque",
  328.             --hands="Hagondes Cuffs +1",
  329.             ring1="Sangoma Ring",
  330.             ring2="Shiva Ring",
  331.             --back="Ogapego Cape +1",
  332.             back="Ogapego Cape",
  333.             waist="Ovate Rope",
  334.             --legs="Mes'yohi Slacks",
  335.             legs="Artsieq Hose",
  336.             feet="Vitivation Boots +1"
  337.             })
  338.     sets.Midcast.INT_HighACC = set_combine(sets.Midcast.INT_MidACC,{})
  339.  
  340.     -- Impact --
  341.     sets.Midcast.Impact = {}
  342.  
  343.     -- Elemental Obi/Twilight Cape --
  344.     sets.Obi = {}
  345.     sets.Obi.Thunder = {back="Twilight Cape",waist='Rairin Obi'}
  346.     sets.Obi.Water = {back="Twilight Cape",waist='Suirin Obi'}
  347.     sets.Obi.Fire = {back="Twilight Cape",waist='Karin Obi'}
  348.     sets.Obi.Ice = {back="Twilight Cape",waist='Hyorin Obi'}
  349.     sets.Obi.Wind = {back="Twilight Cape",waist='Furin Obi'}
  350.     sets.Obi.Earth = {back="Twilight Cape",waist='Dorin Obi'}
  351.     sets.Obi.Light = {back="Twilight Cape",waist='Korin Obi'}
  352.     sets.Obi.Dark = {back="Twilight Cape",waist='Anrin Obi'}
  353.  
  354.     -- JA Sets --
  355.     sets.JA = {}
  356.     sets.JA.Chainspell = {body="Viti. Tabard +2"}
  357.     sets.JA.Saboteur = {hands="Estq. Ganthrt. +2"}
  358.  
  359.     -- Melee Set --
  360.     sets.Melee = set_combine(sets.Idle.Movement,{})
  361.  
  362.     -- WS Base Set --
  363.     sets.WS = {}
  364.     sets.WS["Chant du Cygne"] = {}
  365.     sets.WS.Requiescat = {}
  366.     sets.WS["Knights of Round"] = {}
  367.     sets.WS.Exenterator = {}
  368.     sets.WS.Evisceration = {}
  369. end
  370.  
  371. function pretarget(spell,action)
  372.     if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  373.         cancel_spell()
  374.         send_command('input /item "Echo Drops" <me>')
  375.     elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  376.         degrade_spell(spell,Cure_Spells)
  377.     elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  378.         degrade_spell(spell,Curaga_Spells)
  379.     elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
  380.         if spell.english == "Light Arts" and not buffactive['Addendum: White'] then
  381.             cancel_spell()
  382.             send_command('input /ja Addendum: White <me>')
  383.         elseif spell.english == "Manifestation" then
  384.             cancel_spell()
  385.             send_command('input /ja Accession <me>')
  386.         elseif spell.english == "Alacrity" then
  387.             cancel_spell()
  388.             send_command('input /ja Celerity <me>')
  389.         elseif spell.english == "Parsimony" then
  390.             cancel_spell()
  391.             send_command('input /ja Penury <me>')
  392.         end
  393.     elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
  394.         if spell.english == "Dark Arts" and not buffactive['Addendum: Black'] then
  395.             cancel_spell()
  396.             send_command('input /ja Addendum: Black <me>')
  397.         elseif spell.english == "Accession" then
  398.             cancel_spell()
  399.             send_command('input /ja Manifestation <me>')
  400.         elseif spell.english == "Celerity" then
  401.             cancel_spell()
  402.             send_command('input /ja Alacrity <me>')
  403.         elseif spell.english == "Penury" then
  404.             cancel_spell()
  405.             send_command('input /ja Parsimony <me>')
  406.         end
  407.     end
  408. end
  409.  
  410. function precast(spell,action)
  411.     if spell.type:endswith('Magic') or spell.type == "Ninjutsu" then
  412.         if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
  413.             cancel_spell()
  414.             add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  415.             return
  416.         else
  417.             if string.find(spell.english,'Cur') and spell.english ~= "Cursna" then
  418.                 equip(sets.Precast.Cure)
  419.             elseif spell.english == "Stun" then
  420.                 --------------------------- MAYBE REMOVE THIS --------------------------
  421.                 if buffactive.Composure then -- Cancel Composure When You Cast Stun --
  422.                     cast_delay(0.2)
  423.                     send_command('cancel Composure')
  424.                 end
  425.                 equip(sets.Precast.FastCast)
  426.             elseif spell.english == "Impact" then
  427.                 equip(set_combine(sets.Precast.FastCast,{body="Twilight Cloak"}))
  428.             elseif string.find(spell.english,'Utsusemi') then
  429.                 if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  430.                     cancel_spell()
  431.                     add_to_chat(123, spell.english .. ' Canceled: [3+ Images]')
  432.                     return
  433.                 else
  434.                     equip(sets.Precast.FastCast)
  435.                 end
  436.             elseif sets.Precast[spell.skill] then
  437.                 equip(sets.Precast[spell.skill])
  438.             else
  439.                 equip(sets.Precast.FastCast)
  440.             end
  441.         end
  442.     elseif spell.type == "WeaponSkill" then
  443.         if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  444.             cancel_spell()
  445.             add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  446.             return
  447.         else
  448.             if sets.WS[spell.english] then
  449.                 equip(sets.WS[spell.english])
  450.             end
  451.         end
  452.     elseif spell.type == "JobAbility" then
  453.         if sets.JA[spell.english] then
  454.             equip(sets.JA[spell.english])
  455.         end
  456.     elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  457.         cast_delay(0.2)
  458.         send_command('cancel Sneak')
  459.     end
  460.     --no need for this if capped fast cast precast set
  461.     --[[if sets.Precast[spell.element] then
  462.         equip(sets.Precast[spell.element])
  463.     end]]--
  464.     if StunIndex == 1 then
  465.         equip(sets.Midcast.Stun)
  466.     end
  467. end
  468.  
  469. function midcast(spell,action)
  470.     equipSet = {}
  471.     if spell.type:endswith('Magic') or spell.type == 'Ninjutsu' then
  472.         equipSet = sets.Midcast
  473.         if string.find(spell.english,'Cure') and Enmity == 'ON' then
  474.             equipSet = equipSet.Cure.Enmity
  475.         elseif string.find(spell.english,'Cure') and Enmity == 'OFF' then
  476.             equipSet = equipSet.Cure
  477.         elseif string.find(spell.english,'Cura') then
  478.             equipSet = equipSet.Curaga
  479.         -- Duration and Potency for Regen --
  480.         elseif string.find(spell.english,'Regen') then
  481.             if buffactive["Composure"] then
  482.                 if spell.target.type == 'SELF' then
  483.                     equipSet = equipSet.Regen_Self
  484.                 else
  485.                     equipSet = equipSet.Regen_Others
  486.                 end
  487.             elseif not buffactive["Composure"] then
  488.                 equipSet = equipSet.Regen_Self
  489.             end
  490.         -- Duration for Buffs --
  491.         elseif string.find(spell.english,'Haste') or string.find(spell.english,'Flurry') or string.find(spell.english,'Sneak') or string.find(spell.english,'Invisible') or string.find(spell.english,'Deodorize') then
  492.             if buffactive.Composure then
  493.                 if spell.target.type == 'SELF' then
  494.                     equipSet = equipSet.Duration_Self
  495.                 else
  496.                     equipSet = equipSet.Duration_Others
  497.                 end
  498.             elseif not buffactive.Composure then
  499.                 equipSet = equipSet.Duration_Self
  500.             end
  501.         -- Duration for Refresh --
  502.         elseif string.find(spell.english,'Refresh') then
  503.             if buffactive.Composure then
  504.                 if spell.target.type == 'SELF' then
  505.                     equipSet = equipSet.Refresh_Self
  506.                 else
  507.                     equipSet = equipSet.Refresh_Others
  508.                 end
  509.             elseif not buffactive.Composure then
  510.                 equipSet = equipSet.Refresh_Self
  511.             end
  512.         elseif spell.english == "Stoneskin" then
  513.             if buffactive.Stoneskin then
  514.                 send_command('@wait 2.8;cancel stoneskin')
  515.             end
  516.             equipSet = equipSet.Stoneskin
  517.         elseif spell.english == "Sneak" then
  518.             if spell.target.name == player.name and buffactive['Sneak'] then
  519.                 send_command('cancel sneak')
  520.             end
  521.             equipSet = equipSet.Haste
  522.         elseif spell.english == "Phalanx II" then -- Aug'd Dls. Gloves +2 For Phalanx II --
  523.             equipSet = set_combine(equipSet,{hands="Viti. Gloves +1"})
  524.         elseif spell.skill == "Enfeebling Magic" then
  525.             if spell.type == "WhiteMagic" then
  526.                 if AccIndex == 1 then
  527.                     equipSet = equipSet.MND
  528.                 elseif AccIndex == 2 then
  529.                     equipSet = equipSet.MND_MidACC
  530.                 elseif AccIndex == 3 then
  531.                     equipSet = equipSet.MND_MidACC
  532.                 end
  533.             else
  534.                 if AccIndex == 1 then
  535.                     equipSet = equipSet.INT
  536.                 elseif AccIndex == 2 then
  537.                     equipSet = equipSet.INT_MidACC
  538.                 elseif AccIndex == 3 then
  539.                     equipSet = equipSet.INT_MidACC
  540.                 end
  541.             end
  542.         elseif spell.english == "Dia III" or spell.english == "Slow II" then -- Aug'd Dls. Chapeau +2 For Dia III or Slow II --
  543.             equipSet = set_combine(equipSet,{head="Viti. Chapeau +1"})
  544.         elseif spell.english == "Paralyze II" then -- Aug'd Dls. Boots +2 For Paralyze II --
  545.             equipSet = set_combine(equipSet,{feet="Vitivation Boots +1"})
  546.         elseif spell.english == "Blind II" or spell.english == "Bio III" then -- Aug'd Dls. Tights +2 For Blind II or Bio III --
  547.             equipSet = set_combine(equipSet,{legs="Viti. Tights +1"})
  548.         elseif spell.skill == "Enfeebling Magic" and buffactive.Saboteur then -- Wear Estoqueur's Gantherots +2 for Saboteur enfeebles --
  549.             equipSet = set_combine(equipSet,{hands="Estq. Ganthrt. +2"})
  550.         elseif string.find(spell.english,'Banish') then
  551.             equipSet = set_combine(equipSet.Haste,{ring1="Fenian Ring"})
  552.         elseif string.find(spell.english,'Utsusemi') then
  553.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  554.                 send_command('@wait 1.7; cancel Copy Image*')
  555.             end
  556.             equipSet = equipSet.Haste
  557.         elseif spell.english == 'Monomi: Ichi' then
  558.             if buffactive['Sneak'] then
  559.                 send_command('@wait 1.7;cancel sneak')
  560.             end
  561.             equipSet = equipSet.Haste
  562.         else
  563.             if equipSet[spell.english] then
  564.                 equipSet = equipSet[spell.english]
  565.             end
  566.             if equipSet[spell.skill] then
  567.                 equipSet = equipSet[spell.skill]
  568.             end
  569.             if equipSet[AccArray[AccIndex]] then
  570.                 equipSet = equipSet[AccArray[AccIndex]]
  571.             end
  572.             if equipSet[spell.type] then
  573.                 equipSet = equipSet[spell.type]
  574.             end
  575.             if (spell.skill == 'Elemental Magic' or string.find(spell.english,'Cur') or string.find(spell.english,'Bio') or string.find(spell.english,'Dia') or spell.english == 'Aspir' or spell.english == 'Drain') and not Non_Obi_Spells:contains(spell.english) and (world.day_element == spell.element or world.weather_element == spell.element) and sets.Obi[spell.element] and Obi == 'ON' and spell.english ~= "Cursna" then -- Use Obi Toggle To Equip Normal Waist Gear --
  576.                 equipSet = set_combine(equipSet,sets.Obi[spell.element])
  577.             end
  578.         end
  579.     elseif equipSet[spell.english] then
  580.         equipSet = equipSet[spell.english]
  581.     end
  582.     equip(equipSet)
  583.     if StunIndex == 1 then
  584.         equip(sets.Midcast.Stun)
  585.     end
  586. end
  587.  
  588. function aftercast(spell,action)
  589.     if not spell.interrupted then
  590.         if spell.english == "Sleep II" then -- Sleep II Countdown --
  591.             send_command('wait 60;input /echo Sleep Effect: [WEARING OFF IN 30 SEC.];wait 15;input /echo Sleep Effect: [WEARING OFF IN 15 SEC.];wait 10;input /echo Sleep Effect: [WEARING OFF IN 5 SEC.]')
  592.         elseif spell.english == "Sleep" or spell.english == "Sleepga" then -- Sleep & Sleepga Countdown --
  593.             send_command('wait 30;input /echo Sleep Effect: [WEARING OFF IN 30 SEC.];wait 15;input /echo Sleep Effect: [WEARING OFF IN 15 SEC.];wait 10;input /echo Sleep Effect: [WEARING OFF IN 5 SEC.]')
  594.         --[[elseif spell.english == "Banish II" then -- Banish II Countdown --
  595.             send_command('wait 20;input /echo Banish Effect: [WEARING OFF IN 10 SEC.]')]]--
  596.         end
  597.     end
  598.     status_change(player.status)
  599. end
  600.  
  601. function status_change(new,old)
  602.     if Armor == 'PDT' then
  603.         equip(sets.PDT)
  604.     elseif buffactive["Sublimation: Activated"] then
  605.         --equip(sets.Sublimation)
  606.     elseif new == 'Engaged' then
  607.         equip(sets.Melee)
  608.     elseif new == 'Idle' then
  609.         equip(sets.Idle[IdleArray[IdleIndex]])
  610.     elseif new == 'Resting' then
  611.         equip(sets.Resting)
  612.     end
  613.     if StunIndex == 1 then
  614.         equip(sets.Midcast.Stun)
  615.     end
  616. end
  617.  
  618. function buff_change(buff,gain)
  619.     buff = string.lower(buff)
  620.     if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
  621.         if gain then
  622.             send_command('timers create "Aftermath: Lv.3" 180 down;wait 120;input /echo Aftermath: Lv.3 [WEARING OFF IN 60 SEC.];wait 30;input /echo Aftermath: Lv.3 [WEARING OFF IN 30 SEC.];wait 20;input /echo Aftermath: Lv.3 [WEARING OFF IN 10 SEC.]')
  623.         else
  624.             send_command('timers delete "Aftermath: Lv.3"')
  625.             add_to_chat(123,'AM3: [OFF]')
  626.         end
  627.     elseif buff == 'weakness' then -- Weakness Timer --
  628.         if gain then
  629.             send_command('timers create "Weakness" 300 up')
  630.         else
  631.             send_command('timers delete "Weakness"')
  632.         end
  633.     end
  634.     --[[if not midaction() then
  635.         status_change(player.status)
  636.     end]]--
  637.     status_change(player.status)
  638. end
  639.  
  640. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  641. function self_command(command)
  642.     if command == 'C1' then -- Magic Accuracy Toggle --
  643.         AccIndex = (AccIndex % #AccArray) + 1
  644.         add_to_chat(158,'Magic Accuracy Level: ' .. AccArray[AccIndex])
  645.         status_change(player.status)
  646.     elseif command == 'C5' then -- Auto Update Gear Toggle --
  647.         status_change(player.status)
  648.         add_to_chat(158,'Auto Update Gear')
  649.     elseif command == 'C2' then -- Stun Toggle --
  650.         if StunIndex == 1 then
  651.             StunIndex = 0
  652.             add_to_chat(123,'Stun Set: [Unlocked]')
  653.         else
  654.             StunIndex = 1
  655.             add_to_chat(158,'Stun Set: [Locked]')
  656.         end
  657.         status_change(player.status)
  658.     elseif command == 'C3' then -- Obi Toggle --
  659.         if Obi == 'ON' then
  660.             Obi = 'OFF'
  661.             add_to_chat(123,'Obi: [OFF]')
  662.         else
  663.             Obi = 'ON'
  664.             add_to_chat(158,'Obi: [ON]')
  665.         end
  666.         status_change(player.status)
  667.     elseif command == 'C7' then -- PDT Toggle --
  668.         if Armor == 'PDT' then
  669.             Armor = 'None'
  670.             add_to_chat(123,'PDT Set: [Unlocked]')
  671.         else
  672.             Armor = 'PDT'
  673.             add_to_chat(158,'PDT Set: [Locked]')
  674.         end
  675.         status_change(player.status)
  676.     elseif command == 'C8' then -- Distance Toggle --
  677.         if player.target.distance then
  678.             target_distance = math.floor(player.target.distance*10)/10
  679.             add_to_chat(158,'Distance: '..target_distance)
  680.         else
  681.             add_to_chat(123,'No Target Selected')
  682.         end
  683.     elseif command == 'C6' then -- Idle Toggle --
  684.         IdleIndex = (IdleIndex % #IdleArray) + 1
  685.         add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  686.         status_change(player.status)
  687.     elseif command == 'C42' then -- Weapons Lock Toggle --
  688.         if MainLock == 0 then
  689.             MainLock = 1
  690.             send_command('gs disable main')
  691.             send_command('gs disable sub')
  692.             send_command('gs disable ammo')
  693.             send_command('gs disable range')
  694.             add_to_chat(158,'Weapon Lock: ON')
  695.         else
  696.             MainLock = 0
  697.             send_command('gs enable main')
  698.             send_command('gs enable sub')
  699.             send_command('gs enable ammo')
  700.             send_command('gs enable range')
  701.             add_to_chat(123,'Weapon Lock: OFF')
  702.         end
  703.     elseif command == 'C43' then
  704.         if Enmity == 'ON' then
  705.             Enmity = 'OFF'
  706.             add_to_chat(123,'Enmity Cure Set: '..Enmity)
  707.         else
  708.             Enmity = 'ON'
  709.             add_to_chat(158,'Enmity Cure Set: '..Enmity)
  710.         end
  711.     elseif command:match('^SC%d$') then
  712.         send_command('//' .. sc_map[command])
  713.     end
  714. end
  715.  
  716. function actualCost(originalCost)
  717.     if buffactive["Penury"] then
  718.         return originalCost*.5
  719.     elseif buffactive["Light Arts"] then
  720.         return originalCost*.9
  721.     else
  722.         return originalCost
  723.     end
  724. end
  725.  
  726. function degrade_spell(spell,degrade_array)
  727.     spell_index = table.find(degrade_array,spell.name)
  728.     if spell_index > 1 then
  729.         new_spell = degrade_array[spell_index - 1]
  730.         change_spell(new_spell,spell.target.raw)
  731.         add_to_chat(8,spell.name..' Canceled: [Current MP = ' .. player.mp .. ' | ' .. player.mpp .. '%] Using '..new_spell..' instead.')
  732.     end
  733. end
  734.  
  735. function change_spell(spell_name,target)
  736.     cancel_spell()
  737.     send_command('//'..spell_name..' '..target)
  738. end
  739.  
  740. function sub_job_change(newSubjob, oldSubjob)
  741.     select_default_macro_book()
  742. end
  743.  
  744. function set_macro_page(set,book)
  745.     if not tonumber(set) then
  746.         add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  747.         return
  748.     end
  749.     if set < 1 or set > 10 then
  750.         add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  751.         return
  752.     end
  753.  
  754.     if book then
  755.         if not tonumber(book) then
  756.             add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  757.             return
  758.         end
  759.         if book < 1 or book > 20 then
  760.             add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  761.             return
  762.         end
  763.         send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  764.     else
  765.         send_command('@input /macro set '..tostring(set))
  766.     end
  767. end
  768.  
  769. function select_default_macro_book()
  770.     -- Default macro set/book
  771.     if player.sub_job == 'WHM' then
  772.         set_macro_page(1, 2)
  773.     elseif player.sub_job == 'BLM' then
  774.         set_macro_page(1, 2)
  775.     elseif player.sub_job == 'SCH' then
  776.         set_macro_page(1, 2)
  777.     elseif player.sub_job == 'DNC' then
  778.         set_macro_page(1, 2)
  779.     elseif player.sub_job == 'WAR' then
  780.         set_macro_page(1, 2)
  781.     elseif player.sub_job == 'NIN' then
  782.         set_macro_page(1, 2)
  783.     else
  784.         set_macro_page(1, 2)
  785.     end
  786. end
Advertisement
Add Comment
Please, Sign In to add comment