Advertisement
Guest User

BRD GS

a guest
Jun 19th, 2014
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- *** Credit goes to Flippant for helping me with Gearswap *** --
  2. -- ** I Use Byrth & Motenten's Functions ** --
  3. -- Last Updated: 05/05/14 12:00 AM *Added Terpander Toggle* --
  4.  
  5. function get_sets()
  6.     AccIndex = 1
  7.     AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For TP/WS. First Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below --
  8.     IdleIndex = 1
  9.     IdleArray = {"Movement","PDT"} -- Default Idle Set Is Movement --
  10.     timer_reg = {}
  11.     pianissimo_cycle = false
  12.     Terpander = 'OFF' -- Set Default Terpander ON or OFF Here --
  13.     ElementalStaff = 'OFF' -- Set Default Precast Elemental Staff ON or OFF Here --
  14.     Main = 'OFF' -- Set Default Main Weapon ON or OFF Here --
  15.     target_distance = 5 -- Set Default Distance Here --
  16.     select_default_macro_book() -- Change Default Macro Book At The End --
  17.  
  18.     -- Terpander Trigger Songs --
  19.     TerpaSongs = S{"Army's Paeon","Army's Paeon II","Shining Fantasia","Herb Pastoral","Goblin Gavotte"}
  20.  
  21.     Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
  22.     Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
  23.     sc_map = {SC1 = "ChocoboMazurka", SC2 = "HerbPastoral", SC3 = "GoblinGavotte"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
  24.  
  25.     sets.Idle = {}
  26.     -- Idle Sets --
  27.     sets.Idle.Movement = {
  28.             main="Legato Dagger",
  29.             sub="Genbu's Shield",
  30.             range="Eminent Flute",
  31.             head="Gende. Caubeen",
  32.             neck="Twilight Torque",
  33.             ear1="Loquac. Earring",
  34.             ear2="Aoidos' Earring",
  35.             body="Artsieq Jubbah",
  36.             hands="Serpentes Cuffs",
  37.             ring1="Balrahn's Ring",
  38.             ring2="Tamas Ring",
  39.             back="Rhapsode's Cape",
  40.             waist="Witful Belt",
  41.             legs="Nares Trews",
  42.             feet="Serpentes Sabots"}
  43.     sets.Idle.PDT = set_combine(sets.Idle.Movement,{})
  44.     sets.Resting = set_combine(sets.Idle.Movement,{})
  45.  
  46.     sets.Precast = {}
  47.     -- Song Precast Set --
  48.     sets.Precast.SongCast = {
  49.             main="Legato Dagger",
  50.             sub="Genbu's Shield",
  51.             range=empty,
  52.             ammo="Impatiens",
  53.             head="Aoidos' Calot +2",
  54.             neck="Aoidos' Matinee",
  55.             ear1="Loquac. Earring",
  56.             ear2="Aoidos' Earring",
  57.             body="Hedera Cotehardie",
  58.             hands="Gende. Gages +1",
  59.             ring1="Prolix Ring",
  60.             ring2="Tamas Ring",
  61.             back="Swith Cape",
  62.             waist="Witful Belt",
  63.             legs="Gendewitha Spats",
  64.             feet="Bokwus Boots"}
  65.  
  66.     -- Elemental Staves --
  67.     sets.Precast.Thunder = {}
  68.     sets.Precast.Water = {}
  69.     sets.Precast.Fire = {}
  70.     sets.Precast.Ice = {}
  71.     sets.Precast.Wind = {}
  72.     sets.Precast.Earth = {}
  73.     sets.Precast.Light = {}
  74.     sets.Precast.Dark = {}
  75.  
  76.     -- Precast Terpander Set --
  77.     sets.Precast.Terpander = {
  78.             main="Legato Dagger",
  79.             sub="Genbu's Shield",
  80.             range="Terpander",
  81.             ammo=empty,
  82.             head="Aoidos' Calot +2",
  83.             neck="Aoidos' Matinee",
  84.             ear1="Loquac. Earring",
  85.             ear2="Aoidos' Earring",
  86.             body="Hedera Cotehardie",
  87.             hands="Gende. Gages +1",
  88.             ring1="Prolix Ring",
  89.             ring2="Tamas Ring",
  90.             back="Swith Cape",
  91.             waist="Witful Belt",
  92.             legs="Gendewitha Spats",
  93.             feet="Bokwus Boots"}
  94.  
  95.     -- Fastcast Set --
  96.     sets.Precast.FastCast = {
  97.             main="Ngqoqwanb",
  98.             sub="Arbuda Grip",
  99.             ammo="Impatiens",
  100.             head="Nahtirah Hat",
  101.             ear1="Loquac. Earring",
  102.             ear2="Aoidos' Earring",
  103.             body="Hedera Cotehardie",
  104.             hands="Gende. Gages +1",
  105.             ring1="Prolix Ring",
  106.             ring2="Tamas Ring",
  107.             back="Swith Cape",
  108.             waist="Witful Belt",
  109.             legs="Artsieq Hose",
  110.             feet="Chelona Boots"}
  111.  
  112.     -- Cure Precast Set --
  113.     sets.Precast.Cure = {
  114.             main="Arka IV",
  115.             sub="Arbuda Grip",
  116.             ammo="Impatiens",
  117.             head="Nahtirah Hat",
  118.             ear1="Loquac. Earring",
  119.             body="Hedera Cotehardie",
  120.             hands="Gende. Gages +1",
  121.             ring1="Prolix Ring",
  122.             ring2="Tamas Ring",
  123.             back="Pahtli Cape",
  124.             waist="Witful Belt";
  125.             legs="Artsieq Hose",
  126.             feet="Chelona Boots"}
  127.  
  128.     -- Midcast Base Set --
  129.     sets.Midcast = {
  130.             head="Nahtirah Hat",
  131.             ear1="Loquac. Earring",
  132.             body="Hedera Cotehardie",
  133.             hands="Otomi Gloves",
  134.             ring1="Prolix Ring",
  135.             ring2="Tamas Ring",
  136.             back="Swith Cape",
  137.             waist="Witful Belt",
  138.             legs="Artsieq Hose",
  139.             feet="Bokwus Boots"}
  140.    
  141.     -- Song Debuff Set --
  142.     sets.Midcast.Wind = {
  143.             main="Ngqoqwanb",
  144.             sub="Mephitis Grip",
  145.             range="Eminent Flute",
  146.             ammo=empty,
  147.             head="Buremte Hat",
  148.             neck="Weike Torque",
  149.             ear1="Psystorm Earring",
  150.             ear2="Lifestorm Earring",
  151.             body="Ischemia Chasu.",
  152.             ring1="Balrahn's Ring",
  153.             ring2="Perception Ring",
  154.             back="Rhapsode's Cape",
  155.             waist="Demonry Sash",
  156.             legs="Aoidos' Rhing. +2",
  157.             feet="Bokwus Boots"}
  158.  
  159.     -- Song Buff Set --
  160.     sets.Midcast.WindBuff = {
  161.             main="Legato Dagger",
  162.             sub="Genbu's Shield",
  163.             range="Eminet Flute",
  164.             ammo=empty,
  165.             head="Aoidos' Calot +2",
  166.             neck="Aoidos' Matinee",
  167.             ear1="Loquac. Earring",
  168.             ear2="Aoidos' Earring",
  169.             body="Aoidos' Hngrln. +2",
  170.             hands="Ad. Mnchtte. +2",
  171.             ring1="Prolix Ring",
  172.             ring2="Tamas Ring",
  173.             back="Rhapsode's Cape",
  174.             waist="Witful Belt",
  175.             legs="Aoidos' Rhing. +2",
  176.             feet="Aoidos' Cothrn. +2"}
  177.  
  178.     sets.Midcast.March = {hands="Ad. Mnchtte. +2"}
  179.     sets.Midcast.Minuet = {body="Aoidos' Hngrln. +2"}
  180.     sets.Midcast.Madrigal = {head="Aoidos' Calot +2"}
  181.     sets.Midcast.Ballad = {legs="Aoidos' Rhing. +2"}
  182.     sets.Midcast.Scherzo = {feet="Aoidos' Cothrn. +2"}
  183.     sets.Midcast.Mazurka = {head="Nahtirah Hat"}
  184.     sets.Midcast.Paeon = {head="Brioso Roundlet"}
  185.     sets.Midcast.Finale = {}
  186.     sets.Midcast.Lullaby = {}
  187.  
  188.     -- Cure Set --
  189.     sets.Midcast.Cure = {
  190.             main="Arka IV",
  191.             sub="Curatio Grip",
  192.             head="Gende. Caubeen",
  193.             neck="Colossus's Torque",
  194.             ear1="Healing Earring",
  195.             ear2="Beatific Earring",
  196.             body="Gende. Bilaut +1",
  197.             hands="Bokwus Gloves",
  198.             ring1="Sirona's Ring",
  199.             ring2="Haoma's Ring",
  200.             back="Tempered Cape",
  201.             waist="Bishop's Sash",
  202.             legs="Artsieq Hose",
  203.             feet="Manabyss Pigaches"}
  204.  
  205.     -- Curaga Set --
  206.     sets.Midcast.Curaga = set_combine(sets.Midcast.Cure,{})
  207.  
  208.     -- Haste Set --
  209.     sets.Midcast.Haste = set_combine(sets.Precast.FastCast,{
  210.             hands="Otomi Gloves",
  211.             feet="Manabyss Pigaches"})
  212.  
  213.     -- Cursna Set --
  214.     sets.Midcast.Cursna = set_combine(sets.Midcast.Haste,{
  215.             neck="Malison Medallion",
  216.             ear1="Healing Earring",
  217.             ear2="Beatific Earring",
  218.             hands="Ayao's Gages",
  219.             ring1="Haoma's Ring",
  220.             ring2="Ephedra Ring",
  221.             back="Tempered Cape",
  222.             waist="Bishop's Sash"})
  223.  
  224.     -- Stoneskin Set --
  225.     sets.Midcast.Stoneskin = set_combine(sets.Midcast.Haste)
  226.  
  227.     -- JA Sets --
  228.     sets.JA = {}
  229.     sets.JA.Nightingale = {feet="Bihu Slippers"}
  230.     sets.JA.Troubadour = {body="Bihu Justaucorps"}
  231.     sets.JA["Soul Voice"] = {legs="Bihu Cannions"}
  232.  
  233.     -- Melee Sets --
  234.     sets.Melee = {}
  235.     sets.Melee.MidACC = set_combine(sets.Melee,{})
  236.     sets.Melee.HighACC = set_combine(sets.Melee.MidACC,{})
  237.  
  238.     -- WS Base Set --
  239.     sets.WS = {}
  240.  
  241.     sets.WS.Exenterator = {}
  242.     sets.WS.Exenterator.MidACC = set_combine(sets.WS.Exenterator,{})
  243.     sets.WS.Exenterator.HighACC = set_combine(sets.WS.Exenterator.MidACC,{})
  244.  
  245.     sets.WS.Evisceration = {}
  246.     sets.WS.Evisceration.MidACC = set_combine(sets.WS.Evisceration,{})
  247.     sets.WS.Evisceration.HighACC = set_combine(sets.WS.Evisceration.MidACC,{})
  248.  
  249.     sets.WS["Mercy Stroke"] = {}
  250.     sets.WS["Mercy Stroke"].MidACC = set_combine(sets.WS["Mercy Stroke"],{})
  251.     sets.WS["Mercy Stroke"].HighACC = set_combine(sets.WS["Mercy Stroke"].MidACC,{})
  252.  
  253.     sets.WS["Rudra's Storm"] = {}
  254.     sets.WS["Rudra's Storm"].MidACC = set_combine(sets.WS["Rudra's Storm"],{})
  255.     sets.WS["Rudra's Storm"].HighACC = set_combine(sets.WS["Rudra's Storm"].MidACC,{})
  256.  
  257.     sets.WS["Mordant Rime"] = {}
  258.  
  259.     -- Lock Main Weapon --
  260.     sets.MainWeapon = {
  261.             main="Legato Dagger",
  262.             sub="Genbu's Shield"}
  263. end
  264.  
  265. function pretarget(spell,action)
  266.     if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  267.         cancel_spell()
  268.         send_command('input /item "Echo Drops" <me>')
  269.     elseif spell.type == "BardSong" and spell.target.name == player.name and buffactive.Pianissimo then -- Change Target From <me> To <t> When Pianissimo Is Active --
  270.         change_target('<t>')
  271.     elseif spell.type == 'BardSong' and spell.target.type and spell.target.type == 'PLAYER' and not buffactive.Pianissimo and not spell.target.charmed and not pianissimo_cycle then -- Auto Pianoissimo When You Cast A Song On A Player --
  272.         cancel_spell()
  273.         pianissimo_cycle = true
  274.         send_command('input /ja "Pianissimo" <me>;wait 1.5;input /ma "'..spell.name..'" '..spell.target.name..';')
  275.         return
  276.     elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  277.         degrade_spell(spell,Cure_Spells)
  278.     elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  279.         degrade_spell(spell,Curaga_Spells)
  280.     end
  281.     if spell.name ~= 'Pianissimo' then
  282.         pianissimo_cycle = false
  283.     end
  284. end
  285.  
  286. function precast(spell,action)
  287.     if spell.action_type == 'Magic' then
  288.         if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu or BardSong If You Are Silenced or Out of Range --
  289.             cancel_spell()
  290.             add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  291.             return
  292.         else
  293.             if spell.type == 'BardSong' then
  294.                 if buffactive.Nightingale then
  295.                     equip_song_gear(spell)
  296.                     return
  297.                 else
  298.                     equip_song_gear(spell)
  299.                     equip(sets.Precast.SongCast)
  300.                 end
  301.             elseif string.find(spell.english,'Cur') and spell.english ~= "Cursna" then
  302.                 equip(sets.Precast.Cure)
  303.             elseif string.find(spell.english,'Utsusemi') then
  304.                 if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  305.                     cancel_spell()
  306.                     add_to_chat(123, spell.english .. ' Canceled: [3+ Images]')
  307.                     return
  308.                 else
  309.                     equip(sets.Precast.FastCast)
  310.                 end
  311.             else
  312.                 equip(sets.Precast.FastCast)
  313.             end
  314.         end
  315.     elseif spell.type == "WeaponSkill" then
  316.         if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  317.             cancel_spell()
  318.             add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  319.             return
  320.         else
  321.             equipSet = sets.WS
  322.             if equipSet[spell.english] then
  323.                 equipSet = equipSet[spell.english]
  324.             end
  325.             if equipSet[AccArray[AccIndex]] then
  326.                 equipSet = equipSet[AccArray[AccIndex]]
  327.             end
  328.             if spell.english == "Evisceration" and player.tp > 299 then
  329.                 equipSet = set_combine(equipSet,{ear1="Jupiter's Pearl"})
  330.             end
  331.             equip(equipSet)
  332.         end
  333.     elseif spell.type == "JobAbility" then
  334.         if sets.JA[spell.english] then
  335.             equip(sets.JA[spell.english])
  336.         end
  337.     elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  338.         cast_delay(0.2)
  339.         send_command('cancel Sneak')
  340.     end
  341.     if sets.Precast[spell.element] and not buffactive.Nightingale and ElementalStaff == 'ON' then
  342.         equip(sets.Precast[spell.element])
  343.     end
  344.     if Main == 'ON' then
  345.         equip(sets.MainWeapon)
  346.     end
  347. end
  348.  
  349. function midcast(spell,action)
  350.     equipSet = {}
  351.     if spell.action_type == 'Magic' then
  352.         equipSet = sets.Midcast
  353.         if equipSet[spell.english] then
  354.             equipSet = equipSet[spell.english]
  355.         elseif string.find(spell.english,'Cure') then
  356.             equipSet = equipSet.Cure
  357.         elseif string.find(spell.english,'Cura') then
  358.             equipSet = equipSet.Curaga
  359.         elseif spell.english == "Stoneskin" then
  360.             if buffactive.Stoneskin then
  361.                 send_command('@wait 2.8;cancel stoneskin')
  362.             end
  363.             equipSet = equipSet.Stoneskin
  364.         elseif spell.english == "Sneak" then
  365.             if spell.target.name == player.name and buffactive['Sneak'] then
  366.                 send_command('cancel sneak')
  367.             end
  368.             equipSet = equipSet.Haste
  369.         elseif string.find(spell.english,'Utsusemi') then
  370.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  371.                 send_command('@wait 1.7;cancel Copy Image*')
  372.             end
  373.             equipSet = equipSet.Haste
  374.         elseif spell.english == 'Monomi: Ichi' then
  375.             if buffactive['Sneak'] then
  376.                 send_command('@wait 1.7;cancel sneak')
  377.             end
  378.             equipSet = equipSet.Haste
  379.         end
  380.     elseif spell.type == 'BardSong' then
  381.             equip_song_gear(spell)
  382.     end
  383.     equip(equipSet)
  384.     if Main == 'ON' then
  385.         equip(sets.MainWeapon)
  386.     end
  387. end
  388.  
  389. function aftercast(spell,action)
  390.     if spell.type and spell.type == 'BardSong' and spell.target and spell.target.name == player.name and not spell.interrupted then
  391.         local t = os.time()
  392.  
  393.         local tempreg = {}
  394.         for i,v in pairs(timer_reg) do
  395.             if v < t then tempreg[i] = true end
  396.         end
  397.         for i,v in pairs(tempreg) do
  398.             timer_reg[i] = nil
  399.         end
  400.        
  401.         local dur = calculate_duration(spell.name)
  402.         if timer_reg[spell.name] then
  403.             if (timer_reg[spell.name] - t) <= 120 then
  404.                 send_command('timers delete "'..spell.name..'"')
  405.                 timer_reg[spell.name] = t + dur
  406.                 send_command('timers create "'..spell.name..'" '..dur..' down')
  407.             end
  408.         else
  409.             local maxsongs = 2
  410.             if player.equipment.range == 'Terpander' then
  411.                 maxsongs = maxsongs+1
  412.             end
  413.             if buffactive['Clarion Call'] then
  414.                 maxsongs = maxsongs+1
  415.             end
  416.             if maxsongs < table.length(timer_reg) then
  417.                 maxsongs = table.length(timer_reg)
  418.             end
  419.            
  420.             if table.length(timer_reg) < maxsongs then
  421.                 timer_reg[spell.name] = t+dur
  422.                 send_command('timers create "'..spell.name..'" '..dur..' down')
  423.             else
  424.                 local rep,repsong
  425.                 for i,v in pairs(timer_reg) do
  426.                     if t+dur > v then
  427.                         if not rep or rep > v then
  428.                             rep = v
  429.                             repsong = i
  430.                         end
  431.                     end
  432.                 end
  433.                 if repsong then
  434.                     timer_reg[repsong] = nil
  435.                     send_command('timers delete "'..repsong..'"')
  436.                     timer_reg[spell.name] = t+dur
  437.                     send_command('timers create "'..spell.name..'" '..dur..' down')
  438.                 end
  439.             end
  440.         end
  441.     end
  442.     status_change(player.status)
  443. end
  444.  
  445. function status_change(new,old)
  446.     if new == 'Engaged' then
  447.         equipSet = sets.Melee
  448.         if equipSet[AccArray[AccIndex]] then
  449.             equipSet = equipSet[AccArray[AccIndex]]
  450.         end
  451.         equip(equipSet)
  452.     elseif new == 'Idle' then
  453.         equip(sets.Idle[IdleArray[IdleIndex]])
  454.     elseif new == 'Resting' then
  455.         equip(sets.Resting)
  456.     end
  457.     if Main == 'ON' then
  458.         equip(sets.MainWeapon)
  459.     end
  460. end
  461.  
  462. function buff_change(buff,gain)
  463.     buff = string.lower(buff)
  464.     if buff == "aftermath: lv.3" then -- AM3 Timer --
  465.         if gain then
  466.             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.]')
  467.         else
  468.             send_command('timers delete "Aftermath: Lv.3"')
  469.             add_to_chat(123,'AM3: [OFF]')
  470.         end
  471.     elseif buff == 'weakness' then -- Weakness Timer --
  472.         if gain then
  473.             send_command('timers create "Weakness" 300 up')
  474.         else
  475.             send_command('timers delete "Weakness"')
  476.         end
  477.     end
  478.     if not midaction() then
  479.         status_change(player.status)
  480.     end
  481. end
  482.  
  483. --Macros--
  484. send_command('bind f9 gs c C1') --March II--
  485. send_command('bind f8 gs c C2') --March I--
  486. send_command('bind f7 gs c C3') --ATK V--
  487. send_command('bind f6 gs c C5') --ATK IV--
  488. send_command('bind f5 gs c C18') --3rd Song--
  489.  
  490. function file_unload()
  491.     if binds_on_unload then
  492.         binds_on_unload()
  493.     end
  494.  
  495.     send_command('unbind f9')
  496.     send_command('unbind f8')
  497.     send_command('unbind f7')
  498.     send_command('unbind f6')
  499.     send_command('unbind f5')
  500. end
  501.  
  502. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  503. function self_command(command)
  504.     if command == 'C1' then
  505.         send_command('input /ma "Victory March" <me>')
  506.         add_to_chat(158,'Melee Speed II: [Victory March]')
  507.     elseif command == 'C2' then
  508.         send_command('input /ma "Advancing March" <me>')
  509.         add_to_chat(158,'Melee Speed: [Advancing March]')
  510.     elseif command == 'C3' then
  511.         send_command('input /ma "Valor Minuet V" <me>')
  512.         add_to_chat(158,'Melee Attack: [Valor Minuet V]')
  513.     elseif command == 'C5' then
  514.         send_command('input /ma "Valor Minuet IV" <me>')
  515.         add_to_chat(158,'Melee Attack: [Valor Minuet IV]')
  516.     elseif command == 'C7' then
  517.         send_command('input /ma "Hunter\'s Prelude" <me>')
  518.         add_to_chat(158,'Ranged Accuracy: [Hunter\'s Prelude]')
  519.     elseif command == 'C15' then
  520.         send_command('input /ma "Archer\'s Prelude" <me>')
  521.         add_to_chat(158,'Ranged Accuracy II: [Archer\'s Prelude]')
  522.     elseif command == 'C9' then
  523.         send_command('input /ma "Blade Madrigal" <me>')
  524.         add_to_chat(158,'Melee Accuracy II: [Blade Madrigal]')
  525.     elseif command == 'C10' then
  526.         send_command('input /ma "Sword Madrigal" <me>')
  527.         add_to_chat(158,'Melee Accuracy: [Sword Madrigal]')
  528.     elseif command == 'C12' then
  529.         send_command('input /ma "Valor Minuet III" <me>')
  530.         add_to_chat(158,'Melee Attack: [Valor Minuet III]')
  531.     elseif command == 'C8' then -- Distance Toggle --
  532.         if player.target.distance then
  533.             target_distance = math.floor(player.target.distance*10)/10
  534.             add_to_chat(158,'Distance: '..target_distance)
  535.         else
  536.             add_to_chat(123,'No Target Selected')
  537.         end
  538.     elseif command == 'C16' then -- Main Weapon Toggle --
  539.         if Main == 'ON' then
  540.             Main = 'OFF'
  541.             add_to_chat(123,'Main Weapon: [Unlocked]')
  542.         else
  543.             Main = 'ON'
  544.             add_to_chat(158,'Main Weapon: [Locked]')
  545.         end
  546.         status_change(player.status)
  547.     elseif command == 'C18' then -- Terpander Toggle --
  548.         if Terpander == 'ON' then
  549.             Terpander = 'OFF'
  550.             add_to_chat(123,'Terpander: [OFF]')
  551.         else
  552.             Terpander = 'ON'
  553.             add_to_chat(158,'Terpander: [ON]')
  554.         end
  555.         status_change(player.status)
  556.     elseif command == 'C17' then -- Accuracy Level Toggle --
  557.         AccIndex = (AccIndex % #AccArray) + 1
  558.         status_change(player.status)
  559.         add_to_chat(158,'Accuracy Level: ' .. AccArray[AccIndex])
  560.     elseif command == 'C6' then -- Idle Toggle --
  561.         IdleIndex = (IdleIndex % #IdleArray) + 1
  562.         add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  563.         status_change(player.status)
  564.     elseif command:match('^SC%d$') then
  565.         send_command('//' .. sc_map[command])
  566.     end
  567. end
  568.  
  569. function equip_song_gear(spell)
  570.     if Terpander == 'ON' then
  571.         equip(sets.Precast.Terpander)
  572.     else
  573.         if TerpaSongs:contains(spell.english) then
  574.             equip(sets.Precast.Terpander)
  575.             add_to_chat(158,'Terpander: [ON]')
  576.         else
  577.             if spell.target.type == 'MONSTER' then
  578.                 equip(sets.Midcast.Wind)
  579.                 if string.find(spell.english,'Finale') then equip(sets.Midcast.Finale) end
  580.                 if string.find(spell.english,'Lullaby') then equip(sets.Midcast.Lullaby) end
  581.             else
  582.                 equip(sets.Midcast.WindBuff)
  583.                 if string.find(spell.english,'March') then equip(sets.Midcast.March) end
  584.                 if string.find(spell.english,'Minuet') then equip(sets.Midcast.Minuet) end
  585.                 if string.find(spell.english,'Madrigal') then equip(sets.Midcast.Madrigal) end
  586.                 if string.find(spell.english,'Ballad') then equip(sets.Midcast.Ballad) end
  587.                 if string.find(spell.english,'Scherzo') then equip(sets.Midcast.Scherzo) end
  588.                 if string.find(spell.english,'Mazurka') then equip(sets.Midcast.Mazurka) end
  589.                 if string.find(spell.english,'Paeon') then equip(sets.Midcast.Paeon) end
  590.             end
  591.         end
  592.     end
  593. end
  594.  
  595. function calculate_duration(name)
  596.     local mult = 1
  597.     if player.equipment.main == "Legato Dagger" then mult = mult + 0.1 end
  598.     if player.equipment.range == 'Daurdabla' then mult = mult + 0.3 end
  599.     if player.equipment.range == "Eminent Flute" then mult = mult + 0.2 end
  600.     if player.equipment.neck == "Aoidos' Matinee" then mult = mult + 0.1 end
  601.     if player.equipment.body == "Aoidos' Hngrln. +2" then mult = mult + 0.1 end
  602.     if player.equipment.legs == "Mdk. Shalwar +1" then mult = mult + 0.1 end
  603.     if player.equipment.feet == "Brioso Slippers" then mult = mult + 0.1 end
  604.  
  605.     if string.find(name,'Paeon') and player.equipment.head == 'Brioso Roundlet' then mult = mult + 0.1 end
  606.     if string.find(name,'March') and player.equipment.hands == 'Ad. Mnchtte. +2' then mult = mult + 0.1 end
  607.     if string.find(name,'Minuet') and player.equipment.body == "Aoidos' Hngrln. +2" then mult = mult + 0.1 end
  608.     if string.find(name,'Madrigal') and player.equipment.head == "Aoidos' Calot +2" then mult = mult + 0.1 end
  609.     if string.find(name,'Ballad') and player.equipment.legs == "Aoidos' Rhing. +2" then mult = mult + 0.1 end
  610.     if string.find(name,'Scherzo') and player.equipment.feet == "Aoidos' Cothrn. +2" then mult = mult + 0.1 end
  611.  
  612.     if buffactive.Troubadour then
  613.         mult = mult*2
  614.     end
  615.     if string.find(name,'Scherzo') then
  616.         if buffactive['Soul Voice'] then
  617.             mult = mult*2
  618.         elseif buffactive['Marcato'] then
  619.             mult = mult*1.5
  620.         end
  621.     end
  622.  
  623.     mult = mult - 0.05
  624.  
  625.     local totalDuration = mult*120
  626.  
  627.     return totalDuration
  628. end
  629.  
  630. function actualCost(originalCost)
  631.     if buffactive["Penury"] then
  632.         return originalCost*.5
  633.     elseif buffactive["Light Arts"] then
  634.         return originalCost*.9
  635.     else
  636.         return originalCost
  637.     end
  638. end
  639.  
  640. function degrade_spell(spell,degrade_array)
  641.     spell_index = table.find(degrade_array,spell.name)
  642.     if spell_index>1 then
  643.         new_spell = degrade_array[spell_index - 1]
  644.         change_spell(new_spell,spell.target.raw)
  645.         add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
  646.     end
  647. end
  648.  
  649. function change_spell(spell_name,target)
  650.     cancel_spell()
  651.     send_command('//'..spell_name..' '..target)
  652. end
  653.  
  654. function sub_job_change(newSubjob, oldSubjob)
  655.     select_default_macro_book()
  656. end
  657.  
  658. function set_macro_page(set,book)
  659.     if not tonumber(set) then
  660.         add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  661.         return
  662.     end
  663.     if set < 1 or set > 10 then
  664.         add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  665.         return
  666.     end
  667.  
  668.     if book then
  669.         if not tonumber(book) then
  670.             add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  671.             return
  672.         end
  673.         if book < 1 or book > 20 then
  674.             add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  675.             return
  676.         end
  677.         send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  678.     else
  679.         send_command('@input /macro set '..tostring(set))
  680.     end
  681. end
  682.  
  683. function select_default_macro_book()
  684.     -- Default macro set/book
  685.     if player.sub_job == 'WHM' then
  686.         set_macro_page(1, 10)
  687.     elseif player.sub_job == 'BLM' then
  688.         set_macro_page(1, 10)
  689.     elseif player.sub_job == 'DNC' then
  690.         set_macro_page(1, 10)
  691.     elseif player.sub_job == 'NIN' then
  692.         set_macro_page(1, 10)
  693.     elseif player.sub_job == 'WAR' then
  694.         set_macro_page(1, 10)
  695.     else
  696.         set_macro_page(1, 10)
  697.     end
  698. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement