Azat82

whm

Oct 11th, 2014
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 21.82 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 = 'ON' -- Set Default Sublimation Kiting ON or OFF Here --
  14.     ElementalStaff = 'OFF' -- 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="Owleyes",
  27.             sub="Genbu's Shield",
  28.             ammo="Mana Ampulla",
  29.             head="Wivre Hairpin",
  30.             neck="Wiglen Gorget",
  31.             ear1="Colossus's Earring",
  32.             ear2="Ethereal Earring",
  33.             body="Gendewitha Bliaut",
  34.             hands="Serpentes Cuffs",
  35.             ring1="Sheltered Ring",
  36.             ring2="Paguroidea Ring",
  37.             back="Shadow Mantle",
  38.             waist="Slipor Sash",
  39.             legs="Nares Trews",
  40.             feet="Serpentes Sabots"}
  41.     sets.Idle.Movement = set_combine(sets.Idle.Refresh,{
  42.             neck="Twilight Torque",
  43.             ring1="Shadow Ring",
  44.             ring2="Dark Ring",
  45.             feet="Serpentes Sabots"})
  46.     sets.Resting = {
  47.             main="Boonwell Staff",
  48.             ammo="Clarus Stone",
  49.             head="Orvail Corona",
  50.             neck="Eidolon Pendant",
  51.             ear1="Loquac. Earring",
  52.             ear2="Relaxing Earring",
  53.             body="Chelona Blazer +1",
  54.             hands="Nares Cuffs",
  55.             ring1="Angha Ring",
  56.             ring2="Paguroidea Ring",
  57.             back="Felicitas Cape",
  58.             waist="Austerity Belt",
  59.             legs="Nisse Slacks",
  60.             feet="Chelona Boots"}
  61.  
  62.     -- PDT Set --
  63.     sets.PDT = {
  64.             sub="Genbu's Shield",
  65.             head="Gende. Caubeen",
  66.             neck="Twilight Torque",
  67.             body="Gendewitha Bliaut",
  68.             hands="Gendewitha Gages",
  69.             ring1="Jelly Ring",
  70.             ring2="Dark Ring",
  71.             back="Shadow Mantle",
  72.             waist="Slipor Sash",
  73.             legs="Gendewitha Spats",
  74.             feet="Gende. Galoshes"}
  75.  
  76.     -- Sublimation Set --
  77.     sets.Sublimation = {
  78.             main="Bolelabunga",
  79.             sub="Genbu's Shield",
  80.             ammo="Oreiad's Tathlum",
  81.             head="Wivre Hairpin",
  82.             neck="Dualism Collar",
  83.             ear1="Loquac. Earring",
  84.             ear2="Bloodgem Earring",
  85.             body="Gendewitha Bliaut",
  86.             hands="Serpentes Cuffs",
  87.             ring1="K'ayres Ring",
  88.             ring2="Meridian Ring",
  89.             back="Gigant Mantle",
  90.             waist="Forest Sash",
  91.             legs="Nares Trews",
  92.             feet="Serpentes Sabots"}
  93.  
  94.     sets.Precast = {}
  95.     -- Fastcast Set --
  96.     sets.Precast.FastCast = {
  97.             main="Winged Wand",
  98.             ammo="Impatiens",
  99.             head="Hyaline Hat",
  100.             neck="Orunmila's Torque",
  101.             ear1="Loquac. Earring",
  102.             body="Anhur Robe",
  103.             hands="Gendewitha Gages",
  104.             ring1="Prolix Ring",
  105.             back="Swith Cape +",
  106.             waist="Witful Belt",
  107.             legs="Orvail Pants +1",
  108.             feet="Chelona Boots"}
  109.  
  110.     -- Elemental Staves --
  111.     sets.Precast.Wind = {main='Vayuvata I'}
  112.     sets.Precast.Light = {main='Arka I'}
  113.  
  114.     sets.Precast.Stoneskin = set_combine(sets.Precast.FastCast,{head="Umuthi Hat",waist="Siegel Sash"})
  115.     sets.Precast['Enhancing Magic'] = set_combine(sets.Precast.FastCast,{waist="Siegel Sash"})
  116.     sets.Precast['Healing Magic'] = set_combine(sets.Precast.FastCast,{legs="Orsn. Pantaln. +2"})
  117.     sets.Precast.Impact = set_combine(sets.Precast.FastCast,{head=empty,body="Twilight Cloak"})
  118.    
  119.     -- Cure Precast Set --
  120.     sets.Precast.Cure = {
  121.             main="Winged Wand",
  122.             ammo="Impatiens",
  123.             head="Hyaline Hat",
  124.             neck="Orunmila's Torque",
  125.             ear1="Loquac. Earring",
  126.             body="Heka's Kalasiris",
  127.             hands="Gendewitha Gages",
  128.             ring1="Prolix Ring",
  129.             ring2="Veneficium Ring",
  130.             back="Pahtli Cape",
  131.             waist="Witful Belt",
  132.             legs="Orsn. Pantaln. +2",
  133.             feet="Chelona Boots"}
  134.  
  135.     -- Midcast Base Set --
  136.     sets.Midcast = {
  137.             main="Tamaxchi",
  138.             sub="Genbu's Shield",
  139.             ammo="Mana Ampulla",
  140.             head="Nahtirah Hat",
  141.             neck="Orunmila's Torque",
  142.             ear1="Loquac. Earring",
  143.             ear2="Novia Earring",
  144.             body="Gendewitha Bliaut",
  145.             hands="Dynasty Mitts",
  146.             ring1="Prolix Ring",
  147.             ring2="Veneficium Ring",
  148.             back="Swith Cape",
  149.             waist="Witful Belt",
  150.             legs="Artsieq Hose",
  151.             feet="Gende. Galoshes"}
  152.  
  153.     -- Haste Set --
  154.     sets.Midcast.Haste = set_combine(sets.Precast.FastCast,{
  155.             main="Winged Wand",
  156.             sub="Genbu's Shield",
  157.             ear2="Novia Earring",
  158.             body="Goliard Saio"})
  159.  
  160.     -- Cure Set --
  161.     sets.Midcast.Cure = {
  162.             body="Orison Bliaud +2",
  163.             main="Tamaxchi",
  164.             sub="Genbu's Shield",
  165.             ammo="Oreiad's Tathlum",
  166.             head="Orison Bliaud +2",
  167.             neck="Colossus's Torque",
  168.             ear1="Lifestorm Earring",
  169.             ear2="Novia Earring",
  170.             hands="Bokwus Gloves",
  171.             ring1="Sirona's Ring",
  172.             ring2="Ephedra Ring",
  173.             back="Mending Cape",
  174.             waist="Cascade Belt",
  175.             legs="Orsn. Pantaln. +2",
  176.             feet="Gende. Galoshes"}
  177.  
  178.     -- Cure Enmity Set --
  179.     sets.Midcast.Cure.Enmity = set_combine(sets.Midcast.Cure,{
  180.             neck="Lasaia Pendant",
  181.             body="Orison Bliaud +2",
  182.             ear2="Novia Earring",
  183.             ring2="Kuchekula Ring",
  184.             back="Mending Cape"})
  185.  
  186.     -- Curaga Set --
  187.     sets.Midcast.Curaga = {
  188.             main="Tamaxchi",
  189.             sub="Genbu's Shield",
  190.             ammo="Oreiad's Tathlum",
  191.             head="Gende. Caubeen",
  192.             neck="Colossus's Torque",
  193.             ear1="Lifestorm Earring",
  194.             ear2="Novia Earring",
  195.             body="Gendewitha Bliaut",
  196.             hands="Gendewitha Gages",
  197.             ring1="Aquasoul Ring",
  198.             ring2="Sirona's Ring",
  199.             back="Oretania's Cape",
  200.             waist="Cascade Belt",
  201.             legs="Orsn. Pantaln. +2",
  202.             feet="Gende. Galoshes"}
  203.  
  204.     -- Curaga Enmity Set --
  205.     sets.Midcast.Curaga.Enmity = set_combine(sets.Midcast.Curaga,{})
  206.  
  207.     sets.Midcast['Enhancing Magic'] = {
  208.             main="Kirin's Pole",
  209.             sub="Fulcio Grip",
  210.             ammo="Impatiens",
  211.             head="Umuthi Hat",
  212.             neck="Colossus's Torque",
  213.             body="Anhur Robe",
  214.             ring1="Prolix Ring",
  215.             back="Merciful Cape",
  216.             waist="Cascade Belt",
  217.             legs="Portent Pants",
  218.             feet="Orsn. Duckbills +2"}
  219.  
  220.     -- Barspells Set --
  221.     sets.Midcast.Bar = {
  222.             main="Kirin's Pole",
  223.             sub="Fulcio Grip",
  224.             ammo="Impatiens",
  225.             head="Orison Cap +2",
  226.             neck="Colossus's Torque",
  227.             ear1="Loquac. Earring",
  228.             body="Orison Bliaud +2",
  229.             hands="Orison Mitts +2",
  230.             ring1="Prolix Ring",
  231.             back="Merciful Cape",
  232.             waist="Cascade Belt",
  233.             legs="Cleric's Pantaloons",
  234.             feet="Orsn. Duckbills +2"}
  235.  
  236.     -- Regen Set --
  237.     sets.Midcast.Regen = set_combine(sets.Midcast.Haste,{
  238.             body="Cleric's Briault",
  239.             hands="Orison Mitts +2"})
  240.  
  241.     -- Stoneskin Set --
  242.     sets.Midcast.Stoneskin = set_combine(sets.Midcast.Haste,{})
  243.  
  244.     -- Na Set --
  245.     sets.Midcast.Na = set_combine(sets.Midcast.Haste,{head="Orison Cap +2",legs="Orsn. Pantaln. +2"})
  246.  
  247.     -- Cursna Set --
  248.     sets.Midcast.Cursna = set_combine(sets.Midcast.Haste,{
  249.             sub="Genbu's Shield",
  250.             ammo="Impatiens",
  251.             head="Hyaline Hat",
  252.             ear2="Beatific Earring",
  253.             body="Orison Bliaud +2",
  254.             ring1="Ephedra Ring",
  255.             ring2="Ephedra Ring",
  256.             back="Mending Cape",
  257.             waist="Witful Belt",
  258.             legs="Orsn. Pantaloons +2",
  259.             feet="Gende. Galoshes"})
  260.  
  261.     sets.Midcast['Divine Magic'] = {
  262.             main="Baqil Staff",
  263.             sub="Bugard Strap +1",
  264.             ammo="Kalboron Stone",
  265.             head="Kaabnax Hat",
  266.             neck="Stoicheion Medal",
  267.             ear1="Lifestorm Earring",
  268.             ear2="Psystorm Earring",
  269.             body="Gendewitha Bliaut",
  270.             hands="Otomi Gloves",
  271.             ring1="Strendu Ring",
  272.             ring2="Aquasoul Ring",
  273.             back="Altruistic Cape",
  274.             waist="Bishop's Sash",
  275.             legs="Orvail Pants +1",
  276.             feet="Gende. Galoshes"}
  277.  
  278.     sets.Midcast['Enfeebling Magic'] = set_combine(sets.Midcast['Divine Magic'],{ring2="Archon Ring"})
  279.  
  280.     sets.Midcast['Dark Magic'] = set_combine(sets.Midcast['Divine Magic'],{})
  281.  
  282.     sets.Midcast.Impact = {
  283.             main="Baqil Staff",
  284.             sub="Bugard Strap +1",
  285.             ammo="Kalboron Stone",
  286.             head=empty,
  287.             neck="Stoicheion Medal",
  288.             ear1="Lifestorm Earring",
  289.             ear2="Psystorm Earring",
  290.             body="Twilight Cloak",
  291.             hands="Otomi Gloves",
  292.             ring1="Strendu Ring",
  293.             ring2="Archon Ring",
  294.             back="Altruistic Cape",
  295.             waist="Bishop's Sash",
  296.             legs="Orvail Pants +1",
  297.             feet="Gende. Galoshes"}
  298.  
  299.     -- JA Sets --
  300.     sets.JA = {}
  301.     sets.JA.Benediction = {body="Clr. Briault +2"}
  302.     sets.JA.Martyr = {hands="Clr. Mitts +2"}
  303.     sets.JA.Devotion = {head="Clr. Cap +2"}
  304.  
  305.     -- Divine Caress Set --
  306.     sets['Divine Caress'] = {
  307.         hands="Orison Mitts +2",
  308.         back="Mending Cape"}
  309.  
  310.     -- Melee Set --
  311.     sets.Melee = set_combine(sets.Midcast.Haste,{})
  312.  
  313.     -- Lock Main Weapon --
  314.     sets.MainWeapon = {
  315.             main="Tamaxchi",
  316.             sub="Genbu's Shield"}
  317.  
  318.     -- WS Base Set --
  319.     sets.WS = {}
  320.     sets.WS['Hexa Strike'] = {}
  321.     sets.WS['Mystic Boon'] = {}
  322.     sets.WS.Dagan = {}
  323. end
  324.  
  325. function pretarget(spell,action)
  326.     if midaction() then
  327.         add_to_chat(123, '****** ['..spell.name..' CANCELED] ******')
  328.         canceled = true
  329.         return
  330.     elseif spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  331.         cancel_spell()
  332.         send_command('input /item "Echo Drops" <me>')
  333.     elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  334.         degrade_spell(spell,Cure_Spells)
  335.     elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  336.         degrade_spell(spell,Curaga_Spells)
  337.     elseif Na_Spells:contains(spell.english) then -- Auto Divine Caress --
  338.         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
  339.             cancel_spell()
  340.             send_command('DivineCaress;wait 1.7;input /ma "'..spell.english..'" '..spell.target.name)
  341.         end
  342.     elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
  343.         if spell.english == "Light Arts" and not buffactive['Addendum: White'] then
  344.             cancel_spell()
  345.             send_command('input /ja Addendum: White <me>')
  346.         elseif spell.english == "Manifestation" then
  347.             cancel_spell()
  348.             send_command('input /ja Accession <me>')
  349.         elseif spell.english == "Alacrity" then
  350.             cancel_spell()
  351.             send_command('input /ja Celerity <me>')
  352.         elseif spell.english == "Parsimony" then
  353.             cancel_spell()
  354.             send_command('input /ja Penury <me>')
  355.         end
  356.     elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
  357.         if spell.english == "Dark Arts" and not buffactive['Addendum: Black'] then
  358.             cancel_spell()
  359.             send_command('input /ja Addendum: Black <me>')
  360.         elseif spell.english == "Accession" then
  361.             cancel_spell()
  362.             send_command('input /ja Manifestation <me>')
  363.         elseif spell.english == "Celerity" then
  364.             cancel_spell()
  365.             send_command('input /ja Alacrity <me>')
  366.         elseif spell.english == "Penury" then
  367.             cancel_spell()
  368.             send_command('input /ja Parsimony <me>')
  369.         end
  370.     end
  371. end
  372.  
  373. function precast(spell,action)
  374.     if canceled then
  375.         return
  376.     elseif spell.action_type == 'Magic' then
  377.         if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
  378.             cancel_spell()
  379.             add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  380.             return
  381.         else
  382.             if string.find(spell.english,'Cur') and spell.english ~= "Cursna" then
  383.                 equip(sets.Precast.Cure)
  384.             elseif spell.english == "Stoneskin" then
  385.                 equip(sets.Precast[spell.english])
  386.             elseif spell.english == "Impact" then
  387.                 equip(set_combine(sets.Precast.FastCast,{head=empty,body="Twilight Cloak"}))
  388.             elseif string.find(spell.english,'Utsusemi') then
  389.                 if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  390.                     cancel_spell()
  391.                     add_to_chat(123, spell.name .. ' Canceled: [3+ Images]')
  392.                     return
  393.                 else
  394.                     equip(sets.Precast.FastCast)
  395.                 end
  396.             elseif sets.Precast[spell.skill] then
  397.                 equip(sets.Precast[spell.skill])
  398.             else
  399.                 equip(sets.Precast.FastCast)
  400.             end
  401.         end
  402.     elseif spell.type == "JobAbility" then
  403.         if sets.JA[spell.english] then
  404.             equip(sets.JA[spell.english])
  405.         end
  406.     elseif spell.type == "WeaponSkill" then
  407.         if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
  408.             cancel_spell()
  409.             add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  410.             return
  411.         else
  412.             if sets.WS[spell.english] then
  413.                 equip(sets.WS[spell.english])
  414.             end
  415.         end
  416.     elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  417.         cast_delay(0.2)
  418.         send_command('cancel Sneak')
  419.     end
  420.     if sets.Precast[spell.element] and not Na_Spells:contains(spell.english) and ElementalStaff == 'ON' then
  421.         equip(sets.Precast[spell.element])
  422.     end
  423.     if Main == 'ON' then
  424.         equip(sets.MainWeapon)
  425.     end
  426. end
  427.  
  428. function midcast(spell,action)
  429.     equipSet = {}
  430.     if spell.type:endswith('Magic') or spell.type == 'Ninjutsu' then
  431.         equipSet = sets.Midcast
  432.         if Na_Spells:contains(spell.english) then
  433.             equipSet = equipSet.Na
  434.             add_to_chat(158, '************* ['..spell.name..'] ************')
  435.             if DC then
  436.                 equipSet = set_combine(equipSet,sets['Divine Caress'])
  437.             end
  438.         elseif string.find(spell.english,'Cur') and spell.english ~= "Cursna" then
  439.             if string.find(spell.english,'Cure') then
  440.                 if Enmity == 'ON' then
  441.                     equipSet = equipSet.Cure.Enmity
  442.                 else
  443.                     equipSet = equipSet.Cure
  444.                 end
  445.             elseif string.find(spell.english,'Cura') then
  446.                 if Enmity == 'ON' then
  447.                     equipSet = equipSet.Curaga.Enmity
  448.                 else
  449.                     equipSet = equipSet.Curaga
  450.                 end
  451.             end
  452.             if world.day_element == spell.element or world.weather_element == spell.element then
  453.                 equipSet = set_combine(equipSet,{back="Twilight Cape",waist="Korin Obi"})
  454.             end
  455.         elseif spell.english == "Protectra V" then
  456.             equipSet = set_combine(equipSet,{feet="Piety Duckbills +1"})
  457.         elseif spell.english == "Shellra V" then
  458.             equipSet = set_combine(equipSet,{legs="Clr. Pantaln. +2"})
  459.         elseif spell.english == "Stoneskin" then
  460.             if buffactive.Stoneskin then
  461.                 send_command('@wait 2.8;cancel stoneskin')
  462.             end
  463.             equipSet = equipSet.Stoneskin
  464.         elseif spell.english == "Sneak" then
  465.             if spell.target.name == player.name and buffactive['Sneak'] then
  466.                 send_command('cancel sneak')
  467.             end
  468.             equipSet = equipSet.Haste
  469.         elseif string.find(spell.english,'Bar') then
  470.             equipSet = equipSet.Bar
  471.         elseif string.find(spell.english,'Regen') then
  472.             equipSet = equipSet.Regen
  473.         elseif string.find(spell.english,'Banish') then
  474.             equipSet = set_combine(equipSet,{hands="Clr. Mitts +2",ring1="Fenian Ring"})
  475.         elseif string.find(spell.english,'Reraise') then
  476.             equipSet = equipSet.Haste
  477.         elseif string.find(spell.english,'Utsusemi') then
  478.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  479.                 send_command('@wait 1.7;cancel Copy Image*')
  480.             end
  481.             equipSet = equipSet.Haste
  482.         elseif spell.english == 'Monomi: Ichi' then
  483.             if buffactive['Sneak'] then
  484.                 send_command('@wait 1.7;cancel sneak')
  485.             end
  486.             equipSet = equipSet.Haste
  487.         else
  488.             if equipSet[spell.english] then
  489.                 equipSet = equipSet[spell.english]
  490.             end
  491.             if equipSet[spell.skill] then
  492.                 equipSet = equipSet[spell.skill]
  493.             end
  494.             if equipSet[spell.type] then
  495.                 equipSet = equipSet[spell.type]
  496.             end
  497.         end
  498.     elseif equipSet[spell.english] then
  499.         equipSet = equipSet[spell.english]
  500.     end
  501.     equip(equipSet)
  502.     if Main == 'ON' then
  503.         equip(sets.MainWeapon)
  504.     end
  505. end
  506.  
  507. function aftercast(spell,action)
  508.     if canceled then
  509.         canceled = false
  510.         return
  511.     else
  512.         if not spell.interrupted then
  513.             if spell.type == "WeaponSkill" then
  514.                 send_command('wait 0.2;gs c TP')
  515.             elseif (spell.english == "Repose" or spell.english == "Sleep II") then -- Repose & Sleep II Countdown --
  516.                 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.]')
  517.             elseif (spell.english == "Sleep" or spell.english == "Sleepga") then -- Sleep & Sleepga Countdown --
  518.                 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.]')
  519.             elseif spell.english == "Banish III" then -- Banish III Countdown --
  520.                 send_command('wait 35;input /echo Banish Effect: [WEARING OFF IN 10 SEC.]')
  521.             end
  522.         end
  523.         status_change(player.status)
  524.     end
  525. end
  526.  
  527. function status_change(new,old)
  528.     if Armor == 'PDT' then
  529.         equip(sets.PDT)
  530.     elseif buffactive["Sublimation: Activated"] then
  531.         equip(sets.Sublimation)
  532.         if Kiting == 'ON' then
  533.             equip({feet="Herald's Gaiters"})
  534.         end
  535.     elseif new == 'Engaged' then
  536.         equip(sets.Melee)
  537.     elseif new == 'Idle' then
  538.         equip(sets.Idle[IdleArray[IdleIndex]])
  539.     elseif new == 'Resting' then
  540.         equip(sets.Resting)
  541.     end
  542.     if Main == 'ON' then
  543.         equip(sets.MainWeapon)
  544.     end
  545. end
  546.  
  547. function buff_change(buff,gain)
  548.     buff = string.lower(buff)
  549.     if buff == "aftermath: lv.3" then -- AM3 Timer --
  550.         if gain then
  551.             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.]')
  552.         else
  553.             send_command('timers delete "Aftermath: Lv.3"')
  554.             add_to_chat(123,'AM3: [OFF]')
  555.         end
  556.     elseif buff == 'divine caress' then
  557.         DC = gain
  558.     elseif buff == 'weakness' then -- Weakness Timer --
  559.         if gain then
  560.             send_command('timers create "Weakness" 300 up')
  561.         else
  562.             send_command('timers delete "Weakness"')
  563.         end
  564.     end
  565.     if not midaction() then
  566.         status_change(player.status)
  567.     end
  568. end
  569.  
  570. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  571. function self_command(command)
  572.     if command == 'C1' then -- Enmity Toggle --
  573.         if Enmity == 'ON' then
  574.             Enmity = 'OFF'
  575.             add_to_chat(123,'Enmity Set: [OFF]')
  576.         else
  577.             Enmity = 'ON'
  578.             add_to_chat(158,'Enmity Set: [ON]')
  579.         end
  580.         status_change(player.status)
  581.     elseif command == 'C2' then -- Follow Toggle --
  582.         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')
  583.     elseif command == 'C3' then -- Kiting Toggle --
  584.         if Kiting == 'ON' then
  585.             Kiting = 'OFF'
  586.             add_to_chat(123,'Kiting Set: [Unlocked]')
  587.         else
  588.             Kiting = 'ON'
  589.             add_to_chat(158,'Kiting Set: [Locked]')
  590.         end
  591.         status_change(player.status)
  592.     elseif command == 'C5' then -- Auto Update Gear Toggle --
  593.         status_change(player.status)
  594.         add_to_chat(158,'Auto Update Gear')
  595.     elseif command == 'C7' then
  596.         if Armor == 'PDT' then -- PDT Toggle --
  597.             Armor = 'None'
  598.             add_to_chat(123,'PDT Set: [Unlocked]')
  599.         else
  600.             Armor = 'PDT'
  601.             add_to_chat(158,'PDT Set: [Locked]')
  602.         end
  603.         status_change(player.status)
  604.     elseif command == 'C17' then -- Main Weapon Toggle --
  605.         if Main == 'ON' then
  606.             Main = 'OFF'
  607.             add_to_chat(123,'Main Weapon: [Unlocked]')
  608.         else
  609.             Main = 'ON'
  610.             add_to_chat(158,'Main Weapon: [Locked]')
  611.         end
  612.         status_change(player.status)
  613.     elseif command == 'C8' then -- Distance Toggle --
  614.         if player.target.distance then
  615.             target_distance = math.floor(player.target.distance*10)/10
  616.             add_to_chat(158,'Distance: '..target_distance)
  617.         else
  618.             add_to_chat(123,'No Target Selected')
  619.         end
  620.     elseif command == 'C6' then -- Idle Toggle
  621.         IdleIndex = (IdleIndex % #IdleArray) + 1
  622.         add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  623.         status_change(player.status)
  624.     elseif command == 'TP' then
  625.         add_to_chat(158,'TP Return: '..tostring(player.tp))
  626.     elseif command:match('^SC%d$') then
  627.         send_command('//' .. sc_map[command])
  628.     end
  629. end
  630.  
  631. function actualCost(originalCost)
  632.     if buffactive["Penury"] then
  633.         return originalCost*.5
  634.     elseif buffactive["Light Arts"] or buffactive["Addendum: White"] then
  635.         return originalCost*.9
  636.     elseif buffactive["Dark Arts"] or buffactive["Addendum: Black"] then
  637.         return originalCost*1.1
  638.     else
  639.         return originalCost
  640.     end
  641. end
  642.  
  643. function degrade_spell(spell,degrade_array)
  644.     spell_index = table.find(degrade_array,spell.name)
  645.     if spell_index > 1 then
  646.         new_spell = degrade_array[spell_index - 1]
  647.         change_spell(new_spell,spell.target.raw)
  648.         add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
  649.     end
  650. end
  651.  
  652. function change_spell(spell_name,target)
  653.     cancel_spell()
  654.     send_command('//'..spell_name..' '..target)
  655. end
  656.  
  657. function sub_job_change(newSubjob, oldSubjob)
  658.     select_default_macro_book()
  659. end
  660.  
  661. function set_macro_page(set,book)
  662.     if not tonumber(set) then
  663.         add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  664.         return
  665.     end
  666.     if set < 1 or set > 10 then
  667.         add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  668.         return
  669.     end
  670.  
  671.     if book then
  672.         if not tonumber(book) then
  673.             add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  674.             return
  675.         end
  676.         if book < 1 or book > 20 then
  677.             add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  678.             return
  679.         end
  680.         send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  681.     else
  682.         send_command('@input /macro set '..tostring(set))
  683.     end
  684. end
  685.  
  686. function select_default_macro_book()
  687.     -- Default macro set/book
  688.     if player.sub_job == 'SCH' then
  689.         set_macro_page(1, 1)
  690.     elseif player.sub_job == 'BLM' then
  691.         set_macro_page(1, 1)
  692.     elseif player.sub_job == 'RDM' then
  693.         set_macro_page(1, 1)
  694.     elseif player.sub_job == 'DNC' then
  695.         set_macro_page(1, 1)
  696.     elseif player.sub_job == 'NIN' then
  697.         set_macro_page(1, 1)
  698.     else
  699.         set_macro_page(1, 1)
  700.     end
  701. end
Advertisement
Add Comment
Please, Sign In to add comment