Advertisement
Guest User

Shirai SMN Lua

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