Advertisement
Guest User

Shirai SMN Lua

a guest
Sep 21st, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 23.29 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 *Fixed Magic Sets & Added Precast Elemental Staff Toggle* --
  4.  
  5. function get_sets()
  6.     IdleIndex = 1
  7.     IdleArray = {"Movement","Refresh"} -- Default Idle Set Is Movement --
  8.     Armor = 'None'
  9.     Kiting = 'OFF' -- Set Default Avatar/Sublimation Kiting Set ON or OFF Here --
  10.     ElementalStaff = 'OFF' -- Set Default Precast Elemental Staff ON or OFF Here --
  11.     target_distance = 5 -- Set Default Distance Here --
  12.     select_default_macro_book() -- Change Default Macro Book At The End --
  13.  
  14.     Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
  15.     Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
  16.     sc_map = {SC1 = "Garuda", SC2 = "Ramuh", SC3 = "Fenrir"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
  17.  
  18.     Cities = S{
  19.             "Ru'lude Gardens","Upper Jeuno","Lower Jeuno","Port Jeuno",
  20.             "Port Windurst","Windurst Waters","Windurst Woods","Windurst Walls","Heavens Tower",
  21.             "Port San d'Oria","Northern San d'Oria","Southern San d'Oria",
  22.             "Port Bastok","Bastok Markets","Bastok Mines","Metalworks",
  23.             "Aht Urhgan Whitegate","Nashmau","Tavanazian Safehold",
  24.             "Selbina","Mhaura","Norg","Eastern Adoulin","Western Adoulin","Kazham"}
  25.  
  26.     Avatars = S{
  27.             "Ramuh","Garuda","Alexander","Fenrir","Titan","Shiva","Ifrit","Diabolos",
  28.             "Leviathan","Carbuncle","Odin"}
  29.  
  30.     -- Use The Following Spirit Spells Again To Trigger Auto Elemental Siphon --
  31.     Spirits = S{
  32.             "Fire Spirit","Ice Spirit","Air Spirit","Earth Spirit","Thunder Spirit",
  33.             "Water Spirit","Light Spirit","Dark Spirit"}
  34.  
  35.     SpiritPacts = S{
  36.             "FireSpirit","IceSpirit","AirSpirit","EarthSpirit","ThunderSpirit",
  37.             "WaterSpirit","LightSpirit","DarkSpirit"}
  38.  
  39.     MagicalRagePacts = S{
  40.             'Inferno','Earthen Fury','Tidal Wave','Aerial Blast','Diamond Dust','Judgement Bolt',
  41.             'Fire II','Stone II','Water II','Aero II','Blizzard II','Thunder II',
  42.             'Fire IV','Stone IV','Water IV','Aero IV','Blizzard IV','Thunder IV',
  43.             'Thunderspark','Burning Strike','Meteorite',
  44.             'Heavenly Strike','Geocrush','Grand Fall','Thunderstorm',
  45.             'Holy Mist','Searing Light','Howling Moon','Ruinous Omen','Lunar Bay','Night Terror'}
  46.            
  47.     MagicalRageFully = S{
  48.             'Wind Blade','Meteor Strike','Nether Blast','Flaming Crush'}
  49.            
  50.     Staticpacts = S{
  51.             'Earthen Ward','Aerial Armor','Soothing Ruby'}
  52.  
  53.     DebuffBloodPactWard = S{
  54.             'Diamond Storm','Sleepga','Slowga','Tidal Roar','Nightmare','Pavor Nocturnus',
  55.             'Ultimate Terror','Somnolence','Lunar Cry','Lunar Roar'}
  56.            
  57.     -- The Following BPs Can Be Triggered By Using The Avatar Spells Again --
  58.     -- Can Replace Whatever BPs You Like For Each Listed Avatars --
  59.     BloodPactWard = {
  60.             Garuda = "Fleet Wind", Ifrit = "Inferno Howl", Fenrir = "Ecliptic Growl",
  61.             Titan = "Earthen Armor", Leviathan = "Spring Water", Carbuncle = "Soothing Ruby",
  62.             Diabolos = "Noctoshield"}
  63.  
  64.     durations = {}
  65.     durations['Earthen Armor'] = 232
  66.     durations['Shining Ruby'] = 340
  67.     durations['Dream Shroud'] = 352
  68.     durations['Noctoshield'] = 352
  69.     durations['Inferno Howl'] = 232
  70.     durations['Hastega'] = 352
  71.     durations['Perfect Defense'] = 56
  72.  
  73.     timer_icons = {}
  74.     -- 00054 for stoneskin, or 00299 for Titan
  75.     timer_icons['Earthen Armor'] = 'spells/00299.png'
  76.     -- 00043 for protect, or 00296 for Carby
  77.     timer_icons['Shining Ruby'] = 'spells/00043.png'
  78.     -- 00304 for Diabolos
  79.     timer_icons['Dream Shroud'] = 'spells/00304.png'
  80.     -- 00106 for phalanx, or 00304 for Diabolos
  81.     timer_icons['Noctoshield'] = 'spells/00106.png'
  82.     -- 00100 for enfire, or 00298 for Ifrit
  83.     timer_icons['Inferno Howl'] = 'spells/00298.png'
  84.     -- 00358 for hastega, or 00301 for Garuda
  85.     timer_icons['Hastega'] = 'spells/00358.png'
  86.  
  87.     -- Idle Sets --
  88.     sets.Idle = {}
  89.     sets.Idle.Refresh = {
  90.             main="Bolelabunga",
  91.             sub="Genbu's Shield",
  92.             ammo="Seraphicaller",
  93.             head="Con. horn +1",
  94.             neck="Wiglen Gorget",
  95.             ear1="Gifted Earring",
  96.             ear2="Andoaa Earring",
  97.             body="Hagondes coat +1",
  98.             hands="Serpentes Cuffs",
  99.             ring1="Sheltered Ring",
  100.             ring2="Maquette Ring",
  101.             back="Shadow Mantle",
  102.             waist="Moepapa stone",
  103.             legs="Nares Trews",
  104.             feet="Serpentes Sabots"}
  105.     sets.Idle.Movement = set_combine(sets.Idle.Refresh,{
  106.             neck="Wiglen Gorget",
  107.             ring1="Sheltered Ring",
  108.             ring2="Dark Ring",
  109.             feet="Herald's Gaiters"})
  110.     sets.Resting = {
  111.             main="Boonwell Staff",
  112.             ammo="Clarus Stone",
  113.             head="Con. horn +1",
  114.             neck="Eidolon Pendant",
  115.             ear1="Relaxing Earring",
  116.             ear2="Magnetic Earring",
  117.             body="Chelona Blazer",
  118.             hands="Nares Cuffs",
  119.             ring1="Maquette Ring",
  120.             ring2="Paguroidea Ring",
  121.             back="Vita Cape",
  122.             waist="Austerity Belt",
  123.             legs="Nares Trews",
  124.             feet="Chelona Boots"}
  125.  
  126.     -- PDT Set --
  127.     sets.PDT = {}
  128.  
  129.     sets.Sublimation = {}
  130.  
  131.     sets.Precast = {}
  132.     -- Fastcast Set --
  133.     sets.Precast.FastCast = {
  134.             ammo="Impatiens",
  135.             head="Nahtirah Hat",
  136.             neck="Orunmila's Torque",
  137.             ear2="Loquac. Earring",
  138.             body="Marduk's Jubbah +1",
  139.             hands="Repartie gloves",
  140.             ring1="Prolix Ring",
  141.             ring2="Veneficium Ring",
  142.             back="Swith Cape",
  143.             waist="Witful Belt";
  144.             legs="Orvail Pants",
  145.             feet="Chelona Boots"}
  146.  
  147.     -- Precast BloodPact --
  148.     sets.Precast.BloodPact = {
  149.     head="Glyphic horn +1",
  150.     Body="Summoner's doublet +2",
  151.     hands="Summoner's bracers +2",
  152.     legs="Summoner's spats +2",
  153.     feet="Summoner's pigaches +2"}
  154.  
  155.     -- Elemental Staves --
  156.  
  157.  
  158.     sets.Precast['Enhancing Magic'] = set_combine(sets.Precast.FastCast,{waist="Siegel Sash"})
  159.  
  160.     -- Precast Cure Set --
  161.     sets.Precast.Cure = {
  162.             main="Arka IV",
  163.             sub="Vox Grip",
  164.             head="Nahtirah Hat",
  165.             neck="Ajari necklace",
  166.             ear2="Loquac. Earring",
  167.             body="Heka's Kalasiris",
  168.             hands="Serpetes cuffs",
  169.             ring1="Prolix Ring",
  170.             ring2="Veneficium Ring",
  171.             back="Swith cape",
  172.             waist="Witful Belt";
  173.             legs="Nares trews",
  174.             feet="Serpentes sabots"}
  175.  
  176.     -- Midcast Base Set --
  177.     sets.Midcast = {}
  178.  
  179.     -- Haste Set --
  180.     sets.Midcast.Haste = {}
  181.  
  182.     -- Cure Set --
  183.     sets.Midcast.Cure = {
  184.             main="Tamaxchi",
  185.             sub="Genbu's shield",
  186.             ammo="Impatiens",
  187.             head="Nahtirah Hat",
  188.             neck="Phalaina locket",
  189.             ear2="Loquac. Earring",
  190.             body="Heka's Kalasiris",
  191.             hands="Ayao's gages",
  192.             ring1="Prolix Ring",
  193.             ring2="Veneficium Ring",
  194.             back="Pahtli cape",
  195.             waist="Witful Belt";
  196.             legs="Nares trews",
  197.             feet="Chelona boots"}
  198.  
  199.     -- Curaga Set --
  200.     sets.Midcast.Curaga = {
  201.             main="Tamaxchi",
  202.             sub="Genbu's Shield",
  203.             ammo="Oreiad's Tathlum",
  204.             head="Nahtirah Hat",
  205.             neck="Nuna Gorget +1",
  206.             ear1="Novia Earring",
  207.             ear2="Loquac. Earring",
  208.             body="Heka's Kalasiris",
  209.             hands="Bokwus Gloves",
  210.             ring1="Aquasoul Ring",
  211.             ring2="Karka Ring",
  212.             back="Pahtli Cape",
  213.             waist="Pythia Sash +1",
  214.             legs="Hagondes Pants",
  215.             feet="Hagondes Sabots"}
  216.  
  217.     -- Enhancing Magic Set --
  218.     sets.Midcast['Enhancing Magic'] = {
  219.             main="Bolelabunga",
  220.             sub="Genbu's shield",
  221.             head="Umuthi hat",
  222.             neck="Enhancing Torque",
  223.             body="Anhur Robe",
  224.             hands="Ayao's Gages",
  225.             ring1="Prolix Ring",
  226.             ring2="Veneficium Ring",
  227.             waist="Siegel Sash",
  228.             legs="Portent Pants",
  229.             feet="Rubeus Boots"}
  230.  
  231.     -- Stoneskin Set --
  232.     sets.Midcast.Stoneskin = set_combine(sets.Midcast['Enhancing Magic'],{})
  233.  
  234.     -- Avatars Sets
  235.     sets.Avatars = {
  236.         main="Bahamut's staff",
  237.         sub="Vox Grip",
  238.         ammo="Seraphicaller",
  239.         head="Con. horn +1",
  240.         ear2="Domes. earring",         
  241.         neck="Caller's Pendant",
  242.         body="Hagondes coat +1",
  243.         hands="Adhara gages",
  244.         ring1="Evoker's Ring",
  245.         ring2="Dark Ring",
  246.         back='Samanisi cape',
  247.         waist="Moepapa stone",
  248.         legs="Nares Trews",
  249.         feet="Con. pigaches +1"}
  250.     sets.Avatars['Carbuncle'] = set_combine(sets.Avatars,{hands="Carbuncle Mitts"})
  251.     sets.Avatars['Diabolos'] = set_combine(sets.Avatars,{waist="Diabolos's Rope"})
  252.  
  253.     -- Avatar's Favor Set --
  254.     sets.Favor = set_combine(sets.Avatars,{
  255.         head="Caller's horn +2",
  256.         body="Caller's doublet +2",
  257.         hands="Summoner's bracers +2",
  258.         ear1="Andoaa earring",     
  259.         ring1="Evoker's Ring",
  260.         ring2="Fervor Ring",
  261.         legs="Ngen seraweels",
  262.         waist="cimmerian sash",
  263.         back="Conveyance cape"})
  264.  
  265.     -- Spirits Set --
  266.     sets.Spirits = set_combine(sets.Avatars,{
  267.             main="Tumafyrig",
  268.             head="Glyphic horn +1",
  269.             ear1="Andoaa earring",         
  270.             neck="Eidolon pendant",
  271.             body="Anhur robe",
  272.             hands="Nares cuffs",
  273.             ring2="Fervor ring",
  274.             back="Samanisi cape",
  275.             waist="Cimmerian sash",
  276.             legs="Summoner's spats +2"})
  277.     sets.Spirits['LightSpirit'] = set_combine(sets.Spirits,{back="Conveyance Cape",head='Con. Horn +1',hands='Smn. Bracers +2' })
  278.            
  279.     sets.Midcast.Pet = {}
  280.     -- Normal BloodPactWard/PD Set --
  281.     sets.Midcast.Pet.BloodPactWard = {
  282.             main="Tumafyrig",
  283.             ammo="Seraphicaller",
  284.             head="Con. horn +1",
  285.             ear1="Andoaa earring",         
  286.             neck="Caller's Pendant",
  287.             body="Anhur Robe",
  288.             hands="Smn. Bracers +2",
  289.             ring1="Evoker's Ring",
  290.             ring2="Fervor Ring",
  291.             back="Conveyance Cape",
  292.             waist="Cimmerian Sash",
  293.             legs="Ngen Seraweels",
  294.             feet="Nashira Crackows"}
  295.  
  296.     -- Magic Accuracy BloodPactWard Set --
  297.     sets.Midcast.Pet.BloodPactWard_MACC = set_combine(sets.Midcast.Pet.BloodPactWard,{
  298.             main="Tumafyrig",
  299.             legs="Smn. Spats +2",
  300.             feet="Caller's Pgch. +2"})
  301.  
  302.     -- Blood Boon BloodPactWard Set --
  303.     sets.Midcast.Pet.BloodBoon = set_combine(sets.Midcast.Pet.BloodPactWard,{
  304.             main="Soulscourge",
  305.             ear1="Gifted earring",
  306.             waist="Jaq'ij Sash",
  307.             legs="Caller's Spats +2",
  308.             feet="Shedir Crackows"})
  309.            
  310.     -- Physical BloodPactRage Set --
  311.     sets.Midcast.Pet.PhysicalBloodPactRage = {
  312.             main="Tumafyrig",
  313.             sub="Vox Grip",
  314.             ammo="Seraphicaller",
  315.             head="Con. horn +1",
  316.             neck="Sacrifice torque",
  317.             ear1="Esper Earring",
  318.             ear2="Domes. earring",
  319.             body="Caller's doublet +2",
  320.             hands="Smn. Bracers +2",
  321.             ring1="Evoker's Ring",
  322.             ring2="Fervor Ring",
  323.             back="Samanisi Cape",
  324.             waist="Cimmerian Sash",
  325.             legs="Ngen Seraweels",
  326.             feet="Con. pigaches +1"}
  327.  
  328.     -- Magical BloodPactRage Set --
  329.     sets.Midcast.Pet.MagicalBloodPactRage = set_combine(sets.Midcast.Pet.PhysicalBloodPactRage,{
  330.             main="Tumafyrig",
  331.             head= "Glyphic horn +1",
  332.             ear2="Andoaa earring",         
  333.             neck="Eidolon Pendant",
  334.             hands="Nares cuffs",
  335.             back="Argocham. Mantle",
  336.             legs="Caller's spats +2",
  337.             feet="Hagondes Sabots"})
  338.            
  339.     -- Magical BloodPactFully Set --
  340.     sets.Midcast.Pet.MagicalBloodPactFully = set_combine(sets.Midcast.Pet.PhysicalBloodPactRage,{
  341.             main="Tumafyrig",
  342.             head= "Glyphic horn +1",
  343.             neck="Eidolon Pendant",
  344.             hands="Nares cuffs",
  345.             back="Argocham. Mantle",
  346.             legs="Ngen Seraweels",
  347.             feet="Hagondes Sabots"})           
  348.  
  349.     -- Shock Squall Set --
  350.     sets.Midcast.Pet['Shock Squall'] = {
  351.             main="Tumafyrig",
  352.             sub="Vox Grip",
  353.             ammo="Seraphicaller",
  354.             head="Con. horn +1",
  355.             neck="Caller's Pendant",
  356.             ear1="Andoaa earring",         
  357.             ear2="Gifted Earring",
  358.             body="Anhur robe",
  359.             hands="Smn. Bracers +2",
  360.             ring1="Evoker's Ring",
  361.             ring2="Fervor Ring",
  362.             back="Samanisi Cape",
  363.             legs="Summoner's spats +2",
  364.             feet="Smn. Pigaches +2"}
  365.  
  366.     -- JA Sets --
  367.     sets.JA = {}
  368.     sets.JA['Mana Cede'] = {hands="Call. Bracers +2"}
  369.     sets.JA['Elemental Siphon'] = set_combine(sets.Midcast.Pet.BloodPactWard,{feet="Caller's Pgch. +2"})
  370.     sets.JA['Astral Flow'] = {head="Glyphic horn +1"}
  371.  
  372.     -- Melee Set --
  373.     sets.Melee = set_combine(sets.Midcast.Haste,{})
  374.  
  375.     -- WS Base Set --
  376.     sets.WS = {}
  377.     sets.WS.Shattersoul = {}
  378.     sets.WS.Myrkr = {}
  379.     sets.WS["Garland of Bliss"] = {}
  380. end
  381.  
  382. function pretarget(spell,action)
  383.     if (spell.type:endswith('Magic') or spell.type == "SummonerPact" or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
  384.         cancel_spell()
  385.         send_command('input /item "Echo Drops" <me>')
  386.     elseif spell.english:ifind("Cure") and player.mp<actualCost(spell.mp_cost) then
  387.         degrade_spell(spell,Cure_Spells)
  388.     elseif spell.english:ifind("Curaga") and player.mp<actualCost(spell.mp_cost) then
  389.         degrade_spell(spell,Curaga_Spells)
  390.     elseif spell.english == 'Shiva' and pet.isvalid then -- Change Shiva Spell To Sleepga When Shiva Is Present --
  391.         cancel_spell()
  392.         send_command('input /pet "Sleepga" <t>')
  393.     elseif spell.english == 'Ramuh' and pet.isvalid then -- Change Ramuh Spell To Shock Squall When Ramuh Is Present --
  394.         cancel_spell()
  395.         send_command('input /pet "Shock Squall" <t>')
  396.     elseif Avatars:contains(spell.english) and pet.isvalid then
  397.         cancel_spell()
  398.         send_command('input /pet "'..BloodPactWard[pet.name]..'" <me>;wait 5;Release')
  399.     elseif Spirits:contains(spell.english) and pet.isvalid then
  400.         cancel_spell()
  401.         send_command('ElementalSiphon;wait 1;Release')
  402.     elseif buffactive['Light Arts'] or buffactive['Addendum: White'] then
  403.         if spell.english == "Light Arts" and not buffactive['Addendum: White'] then
  404.             cancel_spell()
  405.             send_command('input /ja Addendum: White <me>')
  406.         elseif spell.english == "Manifestation" then
  407.             cancel_spell()
  408.             send_command('input /ja Accession <me>')
  409.         elseif spell.english == "Alacrity" then
  410.             cancel_spell()
  411.             send_command('input /ja Celerity <me>')
  412.         elseif spell.english == "Parsimony" then
  413.             cancel_spell()
  414.             send_command('input /ja Penury <me>')
  415.         end
  416.     elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
  417.         if spell.english == "Dark Arts" and not buffactive['Addendum: Black'] then
  418.             cancel_spell()
  419.             send_command('input /ja Addendum: Black <me>')
  420.         elseif spell.english == "Accession" then
  421.             cancel_spell()
  422.             send_command('input /ja Manifestation <me>')
  423.         elseif spell.english == "Celerity" then
  424.             cancel_spell()
  425.             send_command('input /ja Alacrity <me>')
  426.         elseif spell.english == "Penury" then
  427.             cancel_spell()
  428.             send_command('input /ja Parsimony <me>')
  429.         end
  430.     end
  431. end
  432.  
  433. function precast(spell,action)
  434.     if spell.type:endswith('Magic') or spell.type == "Ninjutsu" then
  435.         if buffactive.silence or spell.target.distance > 16+target_distance then -- Cancel Magic or Ninjutsu If You Are Silenced or Out of Range --
  436.             cancel_spell()
  437.             add_to_chat(123, spell.name..' Canceled: [Silenced or Out of Casting Range]')
  438.             return
  439.         else
  440.             if string.find(spell.english,'Cur') and spell.english ~= "Cursna" then
  441.                 equip(sets.Precast.Cure)
  442.             elseif string.find(spell.english,'Utsusemi') then
  443.                 if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
  444.                     cancel_spell()
  445.                     add_to_chat(123, spell.english .. ' Canceled: [3+ Images]')
  446.                     return
  447.                 else
  448.                     equip(sets.Precast.FastCast)
  449.                 end
  450.             elseif sets.Precast[spell.skill] then
  451.                 equip(sets.Precast[spell.skill])
  452.             else
  453.                 equip(sets.Precast.FastCast)
  454.             end
  455.         end
  456.     elseif spell.type == "SummonerPact" then
  457.         if (Avatars:contains(spell.english) or Spirits:contains(spell.english)) then
  458.             if Cities:contains(world.area) then
  459.                 cancel_spell()
  460.                 add_to_chat(123,'Unable To Summon Pacts In Town')
  461.                 return
  462.             else
  463.                 if buffactive.silence then -- Cancel SummoningMagic If You Are Silenced --
  464.                     cancel_spell()
  465.                     add_to_chat(123, spell.name..' Canceled: [Silenced]')
  466.                     return
  467.                 else
  468.                     equip(sets.Precast.FastCast)
  469.                 end
  470.             end
  471.         end
  472.     elseif spell.type == "WeaponSkill" then
  473.         if player.status ~= 'Engaged' then
  474.             cancel_spell()
  475.             add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
  476.             return
  477.         elseif sets.WS[spell.english] then
  478.             equip(sets.WS[spell.english])
  479.         end
  480.     elseif spell.type == "JobAbility" then
  481.         if sets.JA[spell.english] then
  482.             equip(sets.JA[spell.english])
  483.         end
  484.     elseif string.find(spell.type,'BloodPact') then
  485.         equip(sets.Precast.BloodPact)
  486.     elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
  487.         cast_delay(0.2)
  488.         send_command('cancel Sneak')
  489.     end
  490.     if sets.Precast[spell.element] and ElementalStaff == 'ON' then
  491.         equip(sets.Precast[spell.element])
  492.     end
  493. end
  494.  
  495. function midcast(spell,action)
  496.     equipSet = {}
  497.     if spell.type:endswith('Magic') or spell.type == 'Ninjutsu' then
  498.         equipSet = sets.Midcast
  499.         if equipSet[spell.english] then
  500.             equipSet = equipSet[spell.english]
  501.         elseif string.find(spell.english,'Cure') then
  502.             equipSet = equipSet.Cure
  503.         elseif string.find(spell.english,'Cura') then
  504.             equipSet = equipSet.Curaga
  505.         elseif spell.english == "Stoneskin" then
  506.             if buffactive.Stoneskin then
  507.                 send_command('@wait 2.8;cancel stoneskin')
  508.             end
  509.             equipSet = equipSet.Stoneskin
  510.         elseif spell.english == "Sneak" then
  511.             if spell.target.name == player.name and buffactive['Sneak'] then
  512.                 send_command('cancel sneak')
  513.             end
  514.             equipSet = equipSet.Haste
  515.         elseif string.find(spell.english,'Utsusemi') then
  516.             if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  517.                 send_command('@wait 1.7;cancel Copy Image*')
  518.             end
  519.             equipSet = equipSet.Haste
  520.         elseif spell.english == 'Monomi: Ichi' then
  521.             if buffactive['Sneak'] then
  522.                 send_command('@wait 1.7;cancel sneak')
  523.             end
  524.             equipSet = equipSet.Haste
  525.         elseif equipSet[spell.skill] then
  526.             equipSet = equipSet[spell.skill]
  527.         end
  528.     elseif equipSet[spell.english] then
  529.         equipSet = equipSet[spell.english]
  530.     end
  531.     equip(equipSet)
  532. end
  533.  
  534. function aftercast(spell,action)
  535.     if not string.find(spell.type,'BloodPact') and not Avatars:contains(spell.english) and not Spirits:contains(spell.english) then
  536.         status_change(player.status)
  537.     elseif spell.english == "Sleepga" and not spell.interrupted then -- Sleepga Countdown --
  538.         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.]')
  539.     end
  540. end
  541.  
  542. function status_change(new,old)
  543.     if Armor == 'PDT' then
  544.         equip(sets.PDT)
  545.     elseif pet.isvalid then
  546.         if SpiritPacts:contains(pet.name) then
  547.             equip(sets.Spirits)
  548.         elseif buffactive["Avatar's Favor"] then
  549.             equip(sets.Favor)
  550.         else
  551.             equip(sets.Avatars)
  552.             if sets.Avatars[pet.name] then
  553.                 equip(sets.Avatars[pet.name])
  554.             end
  555.         end
  556.         if Kiting == 'ON' then
  557.             equip({feet="Herald's Gaiters"})
  558.         end
  559.     elseif buffactive["Sublimation: Activated"] then
  560.         equip(sets.Sublimation)
  561.         if Kiting == 'ON' then
  562.             equip({feet="Herald's Gaiters"})
  563.         end
  564.     elseif new == 'Engaged' then
  565.         equip(sets.Melee)
  566.     elseif new == 'Idle' then
  567.         equip(sets.Idle[IdleArray[IdleIndex]])
  568.     elseif new == 'Resting' then
  569.         equip(sets.Resting)
  570.     end
  571. end
  572.  
  573. function buff_change(buff,gain)
  574.     buff = string.lower(buff)
  575.     if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
  576.         if gain then
  577.             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.]')
  578.         else
  579.             send_command('timers delete "Aftermath: Lv.3"')
  580.             add_to_chat(123,'AM3: [OFF]')
  581.         end
  582.     elseif buff == 'weakness' then -- Weakness Timer --
  583.         if gain then
  584.             send_command('timers create "Weakness" 300 up')
  585.         else
  586.             send_command('timers delete "Weakness"')
  587.         end
  588.     end
  589.     if not midaction() then
  590.         status_change(player.status)
  591.     end
  592. end
  593.  
  594. function pet_midcast(spell)
  595.     if spell.english == 'Perfect Defense' then
  596.         equip(sets.Midcast.Pet.BloodPactWard)
  597.     elseif spell.type == 'BloodPactWard' then
  598.         if DebuffBloodPactWard:contains(spell.english) then
  599.             equip(sets.Midcast.Pet.BloodPactWard_MACC)
  600.         elseif Staticpacts:contains(spell.english) then
  601.             equip(sets.Midcast.Pet.BloodBoon)      
  602.         elseif sets.Midcast.Pet[spell.english] then
  603.             equip(sets.Midcast.Pet[spell.english])
  604.         else
  605.             equip(sets.Midcast.Pet.BloodPactWard)
  606.         end
  607.     elseif spell.type == 'BloodPactRage' then
  608.         if MagicalRagePacts:contains(spell.english) then
  609.             equip(sets.Midcast.Pet.MagicalBloodPactRage)
  610.         elseif MagicalRageFully:contains(spell.english) then   
  611.             equip(sets.Midcast.Pet.MagicalBloodPactFully)  
  612.         else
  613.             equip(sets.Midcast.Pet.PhysicalBloodPactRage)
  614.         end
  615.     end
  616. end
  617.  
  618. function pet_aftercast(spell)
  619.     if not spell.interrupted then
  620.         -- Create custom timers for ward pacts.
  621.         if durations[spell.english] then
  622.             local timer_cmd = 'timers c "'..spell.english..'" '..tostring(durations[spell.english])..' down'
  623.  
  624.             if timer_icons[spell.english] then
  625.                 timer_cmd = timer_cmd..' '..timer_icons[spell.english]
  626.             end
  627.  
  628.             send_command(timer_cmd)
  629.         end
  630.     end
  631.     status_change(player.status)
  632. end
  633.  
  634. function pet_change(pet,gain)
  635.     status_change(player.status)
  636. end
  637.  
  638. -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
  639. function self_command(command)
  640.     if command == 'C1' then -- Kiting Toggle --
  641.         if Kiting == 'ON' then
  642.             Kiting = 'OFF'
  643.             add_to_chat(123,'Kiting Set: [Unlocked]')
  644.         else
  645.             Kiting = 'ON'
  646.             add_to_chat(158,'Kiting Set: [Locked]')
  647.         end
  648.         status_change(player.status)
  649.     elseif command == 'C5' then -- Auto Update Gear Toggle --
  650.         status_change(player.status)
  651.         add_to_chat(158,'Auto Update Gear')
  652.     elseif command == 'C7' then
  653.         if Armor == 'PDT' then -- PDT Toggle --
  654.             Armor = 'None'
  655.             add_to_chat(123,'PDT Set: [Unlocked]')
  656.         else
  657.             Armor = 'PDT'
  658.             add_to_chat(158,'PDT Set: [Locked]')
  659.         end
  660.         status_change(player.status)
  661.     elseif command == 'C8' then -- Distance Toggle --
  662.         if player.target.distance then
  663.             target_distance = math.floor(player.target.distance*10)/10
  664.             add_to_chat(158,'Distance: '..target_distance)
  665.         else
  666.             add_to_chat(123,'No Target Selected')
  667.         end
  668.     elseif command == 'C6' then -- Idle Toggle --
  669.         IdleIndex = (IdleIndex % #IdleArray) + 1
  670.         add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
  671.         status_change(player.status)
  672.     elseif command:match('^SC%d$') then
  673.         send_command('//' .. sc_map[command])
  674.     end
  675. end
  676.  
  677. function actualCost(originalCost)
  678.     if buffactive["Penury"] then
  679.         return originalCost*.5
  680.     elseif buffactive["Light Arts"] then
  681.         return originalCost*.9
  682.     else
  683.         return originalCost
  684.     end
  685. end
  686.  
  687. function degrade_spell(spell,degrade_array)
  688.     spell_index = table.find(degrade_array,spell.name)
  689.     if spell_index > 1 then
  690.         new_spell = degrade_array[spell_index - 1]
  691.         change_spell(new_spell,spell.target.raw)
  692.         add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
  693.     end
  694. end
  695.  
  696. function change_spell(spell_name,target)
  697.     cancel_spell()
  698.     send_command('//'..spell_name..' '..target)
  699. end
  700.  
  701. function sub_job_change(newSubjob, oldSubjob)
  702.     select_default_macro_book()
  703. end
  704.  
  705. function set_macro_page(set,book)
  706.     if not tonumber(set) then
  707.         add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  708.         return
  709.     end
  710.     if set < 1 or set > 10 then
  711.         add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  712.         return
  713.     end
  714.  
  715.     if book then
  716.         if not tonumber(book) then
  717.             add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  718.             return
  719.         end
  720.         if book < 1 or book > 20 then
  721.             add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  722.             return
  723.         end
  724.         send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  725.     else
  726.         send_command('@input /macro set '..tostring(set))
  727.     end
  728. end
  729.  
  730. function select_default_macro_book()
  731.     -- Default macro set/book
  732.     if player.sub_job == 'WHM' then
  733.         set_macro_page(1, 2)
  734.     elseif player.sub_job == 'RDM' then
  735.         set_macro_page(1, 2)
  736.     elseif player.sub_job == 'SCH' then
  737.         set_macro_page(1, 2)
  738.     else
  739.         set_macro_page(1, 2)
  740.     end
  741. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement