KLoOoSH

My WHM gearswap

Dec 1st, 2014
1,044
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 24.22 KB | None | 0 0
  1. -- *** Credit goes to Flippant for helping me with Gearswap *** --
  2. -- ** I Use Some Of Motenten's Functions ** --
  3. -- Last Updated: 05/05/14 12:00 AM ** --
  4.  
  5. function get_sets()
  6.     IdleIndex = 1
  7.     IdleArray = {"Movement","Refresh"} -- Default Idle Set Is Movement --
  8.     Armor = 'None'
  9.     canceled = false
  10.     DC = false
  11.     Main = 'OFF' -- Set Default Main Weapon ON or OFF Here --
  12.     Enmity = 'OFF' -- Set Default Enmity Set ON or OFF Here --
  13.     Kiting = 'OFF' -- Set Default Sublimation Kiting ON or OFF Here --
  14.     ElementalStaff = 'ON' -- Set Default Precast Elemental Staff 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.     Cure_Spells = {"Cure","Cure II","Cure III","Cure IV","Cure V","Cure VI"} -- Cure Degradation --
  19.     Curaga_Spells = {"Curaga","Curaga II","Curaga III","Curaga IV","Curaga V"} -- Curaga Degradation --
  20.     Na_Spells = S{"Paralyna","Cursna","Silena","Poisona","Blindna","Viruna","Stona","Erase"} -- For Yagrush --
  21.     sc_map = {SC1 = "LightArts", SC2 = "Celerity", SC3 = "Accession"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
  22.  
  23.     sets.Idle = {}
  24.     -- Idle Sets --
  25.     sets.Idle.Refresh = {
  26.             main="Bolelabunga",
  27.             sub="Genbu's Shield",
  28.             ammo="Impatiens",
  29.             neck="Twilight torque",
  30.             ear1="Moonshade earring",
  31.             ear2="Novia earring",
  32.             body="Respite cloak",
  33.             hands="Serpentes Cuffs",
  34.             ring1="Defending ring",
  35.             ring2="Warp ring",
  36.             back="Mecistopins mantle",
  37.             waist="Fucho-no-obi",
  38.             legs="Assiduity Pants +1",
  39.             feet="Serpentes Sabots"}
  40.     sets.Idle.Movement = set_combine(sets.Idle.Refresh,{
  41.             ammo="Impatiens",
  42.             head="Gende. Caubeen +1",
  43.             neck="Orunmila's Torque",
  44.             ear1="Moonshade earring",
  45.             ear2="Novia earring",
  46.             body="Eirene's manteel",
  47.             hands="Piety mitts +1",
  48.             ring1="Defending Ring",
  49.             ring2="Kuchekula ring",
  50.             back="Mending Cape",
  51.             waist="Witful Belt",
  52.             legs="Assiduity Pants +1",
  53.             feet="Piety Duckbills +1"})
  54.     sets.Resting = {
  55.             main="Boonwell Staff",
  56.             ammo="Clarus Stone",
  57.             head="Orvail Corona",
  58.             neck="Eidolon Pendant",
  59.             ear1="Loquac. Earring",
  60.             ear2="Relaxing Earring",
  61.             body="Chelona Blazer +1",
  62.             hands="Nares Cuffs",
  63.             ring1="Angha Ring",
  64.             ring2="Paguroidea Ring",
  65.             back="Felicitas Cape",
  66.             waist="Witful Belt",
  67.             legs="Nisse Slacks",
  68.             feet="Chelona Boots +1"}
  69.  
  70.     -- PDT Set 46%  46/50--
  71.     sets.PDT = {
  72.             main="Bolelabunga",
  73.             sub="Genbu's Shield",
  74.             head="Gende. Caubeen +1",
  75.             neck="Twilight Torque",
  76.             body="Gendewitha Bliaut",
  77.             hands="Gende. Gages +1",
  78.             ring1="Defending Ring",
  79.             ring2="Patricius Ring",
  80.             back="Shadow mantle",
  81.             waist="Slipor Sash",
  82.             legs="Artsieq Hose",
  83.             feet="Gendewitha galoshes +1"}
  84.  
  85.     -- Sublimation Set --
  86.     sets.Sublimation = {}
  87.  
  88.     sets.Precast = {}
  89.     -- Fastcast Set 57% FC 5% Quick  57/80 --
  90.     sets.Precast.FastCast = {
  91.             sub="Genbu's Shield",
  92.             ammo="Incantor Stone",
  93.             head="Nahtirah Hat",
  94.             neck="Orunmila's Torque",
  95.             ear1="Loquac. Earring",
  96.             body="Marduk's Jubbah +1",
  97.             hands="Gende. Gages +1",
  98.             ring1="Prolix Ring",
  99.             ring2="Veneficium Ring",
  100.             back="Swith Cape",
  101.             waist="Witful Belt",
  102.             legs="Artsieq Hose",
  103.             feet="Regal pumps +1"}
  104.  
  105.     -- Elemental Staves --
  106.     sets.Precast.Wind = {main='Yagrush'}
  107.     sets.Precast.Light = {main='Yagrush'}
  108.  
  109.     sets.Precast.Stoneskin = set_combine(sets.Precast.FastCast,{head="Umuthi Hat",waist="Siegel Sash"})
  110.     sets.Precast['Enhancing Magic'] = set_combine(sets.Precast.FastCast,{main="Yagrush",waist="Siegel Sash"})
  111.     sets.Precast['Healing Magic'] = set_combine(sets.Precast.FastCast,{main="Yagrush",legs="Orsn. Pantaln. +2"})
  112.  
  113.     -- Cure Precast Set 72%PC/FC21%/Quick5%  93/80--
  114.     sets.Precast.Cure = {
  115.             sub="Genbu's Shield",
  116.             ammo="Incantor Stone",
  117.             head="Piety cap +1",
  118.             neck="Aceso's choker",
  119.             ear1="Nourishing earring +1",
  120.             ear2="Nourishing earring",
  121.             body="Heka's Kalasiris",
  122.             hands="Gende. Gages +1",
  123.             ring1="Prolix Ring",
  124.             ring2="Veneficium Ring",
  125.             back="Pahtli Cape",
  126.             waist="Witful Belt",
  127.             legs="Orsn. Pantaln. +2",
  128.             feet="Regal pumps +1"}
  129.  
  130.     -- Midcast Base Set --
  131.     sets.Midcast = {
  132.             main="Bolelabunga",
  133.             sub="Genbu's Shield",
  134.             ammo="Impatiens",
  135.             neck="Orunmila's Torque",
  136.             ear1="Loquac. Earring",
  137.             ear2="Novia Earring",
  138.             body="Respite cloak",
  139.             hands="Serpentes Cuffs",
  140.             ring1="Prolix Ring",
  141.             ring2="Veneficium Ring",
  142.             back="Swith Cape",
  143.             waist="Witful Belt",
  144.             legs="Artsieq Hose",
  145.             feet="Serpentes Sabots"}
  146.  
  147.     -- Haste Set --
  148.     sets.Midcast.Haste = set_combine(sets.Precast.FastCast,{
  149.             main="Beneficus",
  150.             sub="Genbu's Shield",
  151.             ammo="Impatiens",
  152.             head="Umuthi Hat",
  153.             neck="Colossus's Torque",
  154.             ear2="Andoaa Earring",
  155.             body="Manasa chasuble",
  156.             hands="Dynasty Mitts",
  157.             ring1="Prolix Ring",
  158.             ring2="Veneficium Ring",
  159.             back="Merciful cape",
  160.             waist="Olympus Sash",
  161.             legs="Piety Pantaln. +1",
  162.             feet="Orsn. Duckbills +2"})
  163.  
  164.     -- Cure Set 61%CP/HMS +63 --
  165.     sets.Midcast.Cure = {
  166.             main="Tamaxchi",
  167.             sub="Genbu's Shield",
  168.             ammo="Impatiens",
  169.             head="Gende. Caubeen +1",
  170.             neck="Colossus's torque",
  171.             ear1="Nourishing earring +1",
  172.             ear2="Nourishing earring",
  173.             body="Heka's Kalasiris",
  174.             hands="Theo. Mitts +1",
  175.             ring1="Ephedra Ring",
  176.             ring2="Haoma's Ring",
  177.             back="Tempered Cape +1",
  178.             waist="Bishop's sash",
  179.             legs="Orsn. Pantaln. +2",
  180.             feet="Regal pumps +1"}
  181.  
  182.     -- Cure Enmity CP52%/50%  Enm60%/??% HMS+43 Set --
  183.     sets.Midcast.Cure.Enmity = set_combine(sets.Midcast.Cure,{
  184.             ammo="Impatiens",
  185.             head="Gende. Caubeen +1",
  186.             neck="Colossus's torque",
  187.             ear1="Nourishing earring +1",
  188.             ear2="Novia earring",
  189.             body="Eirene's manteel",
  190.             hands="Theo. Mitts +1",
  191.             ring1="Kuchekula Ring",
  192.             ring2="Haoma's Ring",
  193.             back="Vates Cape +1",
  194.             waist="Bishop's sash",
  195.             legs="Orsn. Pantaln. +2",
  196.             feet="Piety Duckbills +1"})
  197.  
  198.     -- Curaga Set --
  199.     sets.Midcast.Curaga = {
  200.             main="Tamaxchi",
  201.             sub="Genbu's Shield",
  202.             ammo="Impatiens",
  203.             head="Gende. Caubeen +1",
  204.             neck="Colossus's torque",
  205.             ear1="Nourishing earring +1",
  206.             ear2="Nourishing earring",
  207.             body="Heka's Kalasiris",
  208.             hands="Theo. Mitts +1",
  209.             ring1="Ephedra Ring",
  210.             ring2="Haoma's Ring",
  211.             back="Tempered Cape +1",
  212.             waist="Bishop's sash",
  213.             legs="Orsn. Pantaln. +2",
  214.             feet="Regal pumps +1"}
  215.  
  216.     -- Curaga Enmity Set --
  217.     sets.Midcast.Curaga.Enmity = set_combine(sets.Midcast.Curaga,{
  218.             ammo="Impatiens",
  219.             head="Gende. Caubeen +1",
  220.             neck="Colossus's torque",
  221.             ear1="Nourishing earring +1",
  222.             ear2="Novia earring",
  223.             body="Eirene's manteel",
  224.             hands="Theo. Mitts +1",
  225.             ring1="Kuchekula Ring",
  226.             ring2="Haoma's Ring",
  227.             back="Vates Cape +1",
  228.             waist="Bishop's sash",
  229.             legs="Orsn. Pantaln. +2",
  230.             feet="Piety Duckbills +1"})
  231.  
  232.     -- Enhancing Magic Skill = +122 --
  233.     sets.Midcast['Enhancing Magic'] = {
  234.             main="Beneficus",
  235.             sub="Genbu's Shield",
  236.             ammo="Impatiens",
  237.             head="Umuthi Hat",
  238.             neck="Colossus's Torque",
  239.             ear2="Andoaa Earring",
  240.             body="Manasa chasuble",
  241.             hands="Dynasty Mitts",
  242.             ring1="Prolix Ring",
  243.             ring2="Veneficium Ring",
  244.             back="Merciful cape",
  245.             waist="Olympus Sash",
  246.             legs="Piety Pantaln. +1",
  247.             feet="Orsn. Duckbills +2"}
  248.  
  249.     -- Barspells Set --
  250.     sets.Midcast.Bar = {
  251.             main="Beneficus",
  252.             sub="Genbu's Shield",
  253.             ammo="Impatiens",
  254.             head="Umuthi Hat",
  255.             neck="Colossus's Torque",
  256.             ear2="Andoaa Earring",
  257.             body="Orison Bliaud +2",
  258.             hands="Dynasty Mitts",
  259.             ring1="Prolix Ring",
  260.             ring2="Veneficium Ring",
  261.             back="Merciful cape",
  262.             waist="Olympus Sash",
  263.             legs="Piety Pantaln. +1",
  264.             feet="Orsn. Duckbills +2"}
  265.  
  266.     -- Regen Set --
  267.     sets.Midcast.Regen = set_combine(sets.Midcast.Haste,{
  268.             main="Bolelabunga",
  269.             body="Piety Briault +1",
  270.             hands="Orison Mitts +2",
  271.             legs="Theo. Pant. +1"})
  272.  
  273.     -- Stoneskin Set --
  274.     sets.Midcast.Stoneskin = set_combine(sets.Midcast.Haste,{
  275.             main="Bolelabunga",
  276.             sub="Genbu's Shield",
  277.             ammo="Impatiens",
  278.             head="Umuthi Hat",
  279.             neck="Colossus's Torque",
  280.             ear1="Nourishing earring +1",
  281.             ear2="Andoaa Earring",
  282.             body="Manasa chasuble",
  283.             hands="Dynasty Mitts",
  284.             ring1="Prolix Ring",
  285.             ring2="Veneficium Ring",
  286.             back="Merciful cape",
  287.             waist="Olympus Sash",
  288.             legs="Piety Pantaln. +1",
  289.             feet="Orsn. Duckbills +2"})
  290.  
  291.     -- Na Set --
  292.     sets.Midcast.Na = set_combine(sets.Midcast.Haste,{main="Yagrush",legs="Orsn. Pantaln. +2",hands="Orison Mitts +2",
  293.         back="Mending Cape"})
  294.  
  295.     -- Cursna Set --
  296.     sets.Midcast.Cursna = set_combine(sets.Midcast.Haste,{
  297.             main="Yagrush",
  298.             sub="Genbu's Shield",
  299.             ammo="Impatiens",
  300.             head="Nahtirah Hat",
  301.             neck="Malison Medallion",
  302.             ear2="Beatific Earring",
  303.             body="Orison Bliaud +2",
  304.             hands="Hieros mittens",
  305.             ring1="Ephedra ring",
  306.             ring2="Haoma's Ring",
  307.             back="Mending Cape",
  308.             waist="Bishop's Sash",
  309.             legs="Theo. Pant. +1",
  310.             feet="Gendewitha galoshes +1"})
  311.  
  312.     sets.Midcast['Divine Magic'] = {
  313.             main="Bolelabunga",
  314.             sub="Genbu's Shield",
  315.             ammo="Oreida's Tathlum",
  316.             head="Nahtirah Hat",
  317.             neck="Orunmila's Torque",
  318.             ear1="Lifestorm Earring",
  319.             ear2="Psystorm Earring",
  320.             body="Ischemia chasuble",
  321.             hands="Gendewitha Gages",
  322.             ring1="Maquette Ring",
  323.             ring2="Sangoma Ring",
  324.             back="Kumbira Cape",
  325.             waist="Bishop's Sash",
  326.             legs="Theo. Pant. +1",
  327.             feet="Bokwus Boots"}
  328.  
  329.     sets.Midcast['Enfeebling Magic'] = set_combine(sets.Midcast['Divine Magic'],{
  330.             legs="Mes'yohi Slacks",
  331.             feet="Piety Duckbills +1"})
  332.  
  333.     sets.Midcast['Dark Magic'] = set_combine(sets.Midcast['Divine Magic'],{})
  334.  
  335.     sets.Midcast.Impact = {}
  336.  
  337.     -- JA Sets --
  338.     sets.JA = {}
  339.     sets.JA.Benediction = {body="Piety briault +1"}
  340.     sets.JA.Martyr = {hands="Piety mitts +1"}
  341.     sets.JA.Devotion = {head="Piety cap +1"}
  342.  
  343.     -- Divine Caress Set --
  344.     sets['Divine Caress'] = {
  345.         main="Yagrush",
  346.         hands="Orison Mitts +2",
  347.         back="Mending Cape"}
  348.  
  349.     -- Melee Set --
  350.     sets.Melee = set_combine(sets.Midcast.Haste,{
  351.             main="Yagrush",
  352.             sub="",
  353.             ammo="Impatiens",
  354.             head="Theia's hairpin +1",
  355.             neck="Iqabi necklace",
  356.             ear1="Dudgeon earring",
  357.             ear2="Heartseeker earring",
  358.             body="Ischemia chasuble",
  359.             hands="Bokwus gloves",
  360.             ring1="Defending ring",
  361.             ring2="Patricius Ring",
  362.             back="Kayapa cape",
  363.             waist="Witful Belt",
  364.             legs="Orsn. Pantaln. +2",
  365.             feet="Battlecast gaiters"})
  366.  
  367.     -- Lock Main Weapon --
  368.     sets.MainWeapon = {
  369.             main="Yagrush",
  370.             ring1="Capacity Ring",
  371.             ring2="Karieyh Ring",
  372.             sub="Genbu's Shield"}
  373.  
  374.     -- WS Base Set --
  375.     sets.WS = {}
  376.     sets.WS['Realmrazer'] = {
  377.             ammo="Impatiens",
  378.             head="Nahtirah hat",
  379.             neck="Iqabi necklace",
  380.             ear1="Lifestorm earring",
  381.             ear2="Heartseeker earring",
  382.             body="Ischemia chasuble",
  383.             hands="Theo. Mitts +1",
  384.             ring1="Ifrit ring",
  385.             ring2="Karieyh Ring",
  386.             back="Pahtli cape",
  387.             waist="Witful Belt",
  388.             legs="Piety Pantaln. +1",
  389.             feet="Piety Duckbills +1"}
  390.     sets.WS['Mystic Boon'] = {
  391.             ammo="Impatiens",
  392.             head="Nahtirah hat",
  393.             neck="Iqabi necklace",
  394.             ear1="Lifestorm earring",
  395.             ear2="Heartseeker earring",
  396.             body="Ischemia chasuble",
  397.             hands="Theo. Mitts +1",
  398.             ring1="Ifrit ring",
  399.             ring2="Karieyh Ring",
  400.             back="Pahtli cape",
  401.             waist="Witful Belt",
  402.             legs="Piety Pantaln. +1",
  403.             feet="Piety Duckbills +1"}
  404.     sets.WS.Dagan = {}
  405. end
  406.  
  407. function pretarget(spell,action)
  408.     if midaction() then
  409.         add_to_chat(123, '****** ['..spell.name..' CANCELED] ******')
  410.         canceled = true
  411.         return
  412.     elseif spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  413.         cancel_spell()
  414.         send_command('input /item "Echo Drops" <me>')
  415.     elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  416.         degrade_spell(spell,Cure_Spells)
  417.     elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  418.         degrade_spell(spell,Curaga_Spells)
  419.     elseif Na_Spells:contains(spell.english) then -- Auto Divine Caress --
  420.         if windower.ffxi.get_ability_recasts()[32] < 1 and (spell.target.type == 'PLAYER' or spell.target.name == player.name) and not buffactive.amnesia and not buffactive.charm and spell.english ~= "Erase" then
  421.             cancel_spell()
  422.             send_command('DivineCaress;wait 1.7;input /ma "'..spell.english..'" '..spell.target.name)
  423.         end
  424.     elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
  425.         if spell.english == "Light Arts" and not buffactive['Addendum: White'] then
  426.             cancel_spell()
  427.             send_command('input /ja Addendum: White <me>')
  428.         elseif spell.english == "Manifestation" then
  429.             cancel_spell()
  430.             send_command('input /ja Accession <me>')
  431.         elseif spell.english == "Alacrity" then
  432.             cancel_spell()
  433.             send_command('input /ja Celerity <me>')
  434.         elseif spell.english == "Parsimony" then
  435.             cancel_spell()
  436.             send_command('input /ja Penury <me>')
  437.         end
  438.     elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
  439.         if spell.english == "Dark Arts" and not buffactive['Addendum: Black'] then
  440.             cancel_spell()
  441.             send_command('input /ja Addendum: Black <me>')
  442.         elseif spell.english == "Accession" then
  443.             cancel_spell()
  444.             send_command('input /ja Manifestation <me>')
  445.         elseif spell.english == "Celerity" then
  446.             cancel_spell()
  447.             send_command('input /ja Alacrity <me>')
  448.         elseif spell.english == "Penury" then
  449.             cancel_spell()
  450.             send_command('input /ja Parsimony <me>')
  451.         end
  452.     end
  453. end
  454.  
  455. function precast(spell,action)
  456.     if canceled then
  457.         return
  458.     elseif spell.action_type == 'Magic' then
  459.         if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
  460.             cancel_spell()
  461.             add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  462.             return
  463.         else
  464.             if string.find(spell.english,'Cur') and spell.english ~= "Cursna" then
  465.                 equip(sets.Precast.Cure)
  466.             elseif spell.english == "Stoneskin" then
  467.                 equip(sets.Precast[spell.english])
  468.             elseif spell.english == "Impact" then
  469.                 equip(set_combine(sets.Precast.FastCast,{body="Twilight Cloak"}))
  470.             elseif string.find(spell.english,'Utsusemi') then
  471.                 if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  472.                     cancel_spell()
  473.                     add_to_chat(123, spell.name .. ' Canceled: [3+ Images]')
  474.                     return
  475.                 else
  476.                     equip(sets.Precast.FastCast)
  477.                 end
  478.             elseif sets.Precast[spell.skill] then
  479.                 equip(sets.Precast[spell.skill])
  480.             else
  481.                 equip(sets.Precast.FastCast)
  482.             end
  483.         end
  484.     elseif spell.type == "JobAbility" then
  485.         if sets.JA[spell.english] then
  486.             equip(sets.JA[spell.english])
  487.         end
  488.     elseif spell.type == "WeaponSkill" then
  489.         if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  490.             cancel_spell()
  491.             add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  492.             return
  493.         else
  494.             if sets.WS[spell.english] then
  495.                 equip(sets.WS[spell.english])
  496.             end
  497.         end
  498.     elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  499.         cast_delay(0.2)
  500.         send_command('cancel Sneak')
  501.     end
  502.     if sets.Precast[spell.element] and not Na_Spells:contains(spell.english) and ElementalStaff == 'ON' then
  503.         equip(sets.Precast[spell.element])
  504.     end
  505.     if Main == 'ON' then
  506.         equip(sets.MainWeapon)
  507.     end
  508. end
  509.  
  510. function midcast(spell,action)
  511.     equipSet = {}
  512.     if spell.type:endswith('Magic') or spell.type == 'Ninjutsu' then
  513.         equipSet = sets.Midcast
  514.         if Na_Spells:contains(spell.english) then
  515.             equipSet = equipSet.Na
  516.             add_to_chat(158, '************* ['..spell.name..'] ************')
  517.             if DC then
  518.                 equipSet = set_combine(equipSet,sets['Divine Caress'])
  519.             end
  520.         if spell.english == "Cursna" then
  521.                 equipSet = set_combine(equipSet,sets.Midcast.Cursna)
  522.             end
  523.         elseif string.find(spell.english,'Cur') and spell.english ~= "Cursna" then
  524.             if string.find(spell.english,'Cure') then
  525.                 if Enmity == 'ON' then
  526.                     equipSet = equipSet.Cure.Enmity
  527.                 else
  528.                     equipSet = equipSet.Cure
  529.                 end
  530.             elseif string.find(spell.english,'Cura') then
  531.                 if Enmity == 'ON' then
  532.                     equipSet = equipSet.Curaga.Enmity
  533.                 else
  534.                     equipSet = equipSet.Curaga
  535.                 end
  536.             end
  537.             if world.day_element == spell.element or world.weather_element == spell.element then
  538.                 equipSet = set_combine(equipSet,{back="Twilight Cape",waist="Korin Obi"})
  539.             end
  540.         elseif spell.english == "Protectra V" then
  541.             equipSet = set_combine(equipSet,{feet="Piety Duckbills +1"})
  542.         elseif spell.english == "Shellra V" then
  543.             equipSet = set_combine(equipSet,{legs="Clr. Pantaln. +2"})
  544.         elseif spell.english == "Stoneskin" then
  545.             if buffactive.Stoneskin then
  546.                 send_command('@wait 2.8;cancel stoneskin')
  547.             end
  548.             equipSet = equipSet.Stoneskin
  549.         elseif spell.english == "Sneak" then
  550.             if spell.target.name == player.name and buffactive['Sneak'] then
  551.                 send_command('cancel sneak')
  552.             end
  553.             equipSet = equipSet.Haste
  554.         elseif string.find(spell.english,'Bar') then
  555.             equipSet = equipSet.Bar
  556.         elseif string.find(spell.english,'Regen') then
  557.             equipSet = equipSet.Regen
  558.         elseif string.find(spell.english,'Banish') then
  559.             equipSet = set_combine(equipSet,{hands="Clr. Mitts +2",ring1="Fenian Ring"})
  560.         elseif string.find(spell.english,'Reraise') then
  561.             equipSet = equipSet.Haste
  562.         elseif string.find(spell.english,'Utsusemi') then
  563.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  564.                 send_command('@wait 1.7;cancel Copy Image*')
  565.             end
  566.             equipSet = equipSet.Haste
  567.         elseif spell.english == 'Monomi: Ichi' then
  568.             if buffactive['Sneak'] then
  569.                 send_command('@wait 1.7;cancel sneak')
  570.             end
  571.             equipSet = equipSet.Haste
  572.         else
  573.             if equipSet[spell.english] then
  574.                 equipSet = equipSet[spell.english]
  575.             end
  576.             if equipSet[spell.skill] then
  577.                 equipSet = equipSet[spell.skill]
  578.             end
  579.             if equipSet[spell.type] then
  580.                 equipSet = equipSet[spell.type]
  581.             end
  582.         end
  583.     elseif equipSet[spell.english] then
  584.         equipSet = equipSet[spell.english]
  585.     end
  586.     equip(equipSet)
  587.     if Main == 'ON' then
  588.         equip(sets.MainWeapon)
  589.     end
  590. end
  591.  
  592. function aftercast(spell,action)
  593.     if canceled then
  594.         canceled = false
  595.         return
  596.     else
  597.         if not spell.interrupted then
  598.             if spell.type == "WeaponSkill" then
  599.                 send_command('wait 0.2;gs c TP')
  600.             elseif (spell.english == "Repose" or spell.english == "Sleep II") then -- Repose & Sleep II Countdown --
  601.                 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.]')
  602.             elseif (spell.english == "Sleep" or spell.english == "Sleepga") then -- Sleep & Sleepga Countdown --
  603.                 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.]')
  604.             elseif spell.english == "Banish III" then -- Banish III Countdown --
  605.                 send_command('wait 35;input /echo Banish Effect: [WEARING OFF IN 10 SEC.]')
  606.             end
  607.         end
  608.         status_change(player.status)
  609.     end
  610. end
  611.  
  612. function status_change(new,old)
  613.     if Armor == 'PDT' then
  614.         equip(sets.PDT)
  615.     elseif buffactive[""] then
  616.         equip(sets.Sublimation)
  617.         if Kiting == 'ON' then
  618.             equip({feet=""})
  619.         end
  620.     elseif new == 'Engaged' then
  621.         equip(sets.Melee)
  622.     elseif new == 'Idle' then
  623.         equip(sets.Idle[IdleArray[IdleIndex]])
  624.     elseif new == 'Resting' then
  625.         equip(sets.Resting)
  626.     end
  627.     if Main == 'ON' then
  628.         equip(sets.MainWeapon)
  629.     end
  630. end
  631.  
  632. function buff_change(buff,gain)
  633.     buff = string.lower(buff)
  634.     if buff == "aftermath: lv.3" then -- AM3 Timer --
  635.         if gain then
  636.             send_command('timers create "Aftermath: Lv.3" 180 down AM3.png;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.]')
  637.         else
  638.             send_command('timers delete "Aftermath: Lv.3"')
  639.             add_to_chat(123,'AM3: [OFF]')
  640.         end
  641.     elseif buff == 'divine caress' then
  642.         DC = gain
  643.     elseif buff == 'weakness' then -- Weakness Timer --
  644.         if gain then
  645.             send_command('timers create "Weakness" 300 up')
  646.         else
  647.             send_command('timers delete "Weakness"')
  648.         end
  649.     end
  650.     if not midaction() then
  651.         status_change(player.status)
  652.     end
  653. end
  654.  
  655. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  656. function self_command(command)
  657.     if command == 'c5' then -- Enmity Toggle --
  658.         if Enmity == 'ON' then
  659.             Enmity = 'OFF'
  660.             add_to_chat(123,'Enmity Set: [OFF]')
  661.         else
  662.             Enmity = 'ON'
  663.             add_to_chat(158,'Enmity Set: [ON]')
  664.         end
  665.         status_change(player.status)
  666.     elseif command == 'C77' then -- Follow Toggle --
  667.         send_command('input /ta Bokura;input /lockon;wait .3;setkey numpad8 down;wait .3;setkey numpad7 down;wait .3;setkey numpad7 up;wait .3;setkey numpad8 up')
  668.     elseif command == 'C17' then -- Kiting Toggle --
  669.         if Kiting == 'ON' then
  670.             Kiting = 'OFF'
  671.             add_to_chat(123,'Kiting Set: [Unlocked]')
  672.         else
  673.             Kiting = 'ON'
  674.             add_to_chat(158,'Kiting Set: [Locked]')
  675.         end
  676.         status_change(player.status)
  677.     elseif command == 'C55' then -- Auto Update Gear Toggle --
  678.         status_change(player.status)
  679.         add_to_chat(158,'Auto Update Gear')
  680.     elseif command == 'c2' then
  681.         if Armor == 'PDT' then -- PDT Toggle --
  682.             Armor = 'None'
  683.             add_to_chat(123,'PDT Set: [Unlocked]')
  684.         else
  685.             Armor = 'PDT'
  686.             add_to_chat(158,'PDT Set: [Locked]')
  687.         end
  688.         status_change(player.status)
  689.     elseif command == 'c3' then -- Main Weapon Toggle --
  690.         if Main == 'ON' then
  691.             Main = 'OFF'
  692.             add_to_chat(123,'Main Weapon: [Unlocked]')
  693.         else
  694.             Main = 'ON'
  695.             add_to_chat(158,'Main Weapon: [Locked]')
  696.         end
  697.         status_change(player.status)
  698.     elseif command == 'c4' then -- Distance Toggle --
  699.         if player.target.distance then
  700.             target_distance = math.floor(player.target.distance*10)/10
  701.             add_to_chat(158,'Distance: '..target_distance)
  702.         else
  703.             add_to_chat(123,'No Target Selected')
  704.         end
  705.     elseif command == 'c1' then -- Idle Toggle
  706.         IdleIndex = (IdleIndex % #IdleArray) + 1
  707.         add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  708.         status_change(player.status)
  709.     elseif command == 'TP' then
  710.         add_to_chat(158,'TP Return: '..tostring(player.tp))
  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"] or buffactive["Addendum: White"] then
  720.         return originalCost*.9
  721.     elseif buffactive["Dark Arts"] or buffactive["Addendum: Black"] then
  722.         return originalCost*1.1
  723.     else
  724.         return originalCost
  725.     end
  726. end
  727.  
  728. function degrade_spell(spell,degrade_array)
  729.     spell_index = table.find(degrade_array,spell.name)
  730.     if spell_index > 1 then
  731.         new_spell = degrade_array[spell_index - 1]
  732.         change_spell(new_spell,spell.target.raw)
  733.         add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
  734.     end
  735. end
  736.  
  737. function change_spell(spell_name,target)
  738.     cancel_spell()
  739.     send_command('//'..spell_name..' '..target)
  740. end
  741.  
  742. function sub_job_change(newSubjob, oldSubjob)
  743.     select_default_macro_book()
  744. end
  745.  
  746. function set_macro_page(set,book)
  747.     if not tonumber(set) then
  748.         add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  749.         return
  750.     end
  751.     if set < 1 or set > 10 then
  752.         add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  753.         return
  754.     end
  755.  
  756.     if book then
  757.         if not tonumber(book) then
  758.             add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  759.             return
  760.         end
  761.         if book < 1 or book > 20 then
  762.             add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  763.             return
  764.         end
  765.         send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  766.     else
  767.         send_command('@input /macro set '..tostring(set))
  768.     end
  769. end
  770.  
  771. function select_default_macro_book()
  772.     -- Default macro set/book
  773.     if player.sub_job == 'SCH' then
  774.         set_macro_page(1, 1)
  775.     elseif player.sub_job == 'BLM' then
  776.         set_macro_page(1, 1)
  777.     elseif player.sub_job == 'RDM' then
  778.         set_macro_page(1, 1)
  779.     elseif player.sub_job == 'DNC' then
  780.         set_macro_page(1, 1)
  781.     elseif player.sub_job == 'NIN' then
  782.         set_macro_page(1, 1)
  783.     else
  784.         set_macro_page(1, 18)
  785.     end
  786. end
Advertisement
Add Comment
Please, Sign In to add comment