Pergatory

Pergatory's SMN Gearswap

Jan 27th, 2017 (edited)
14,254
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Summoner Gearswap Lua by Pergatory - http://pastebin.com/u/pergatory
  2. -- IdleMode determines the set used after casting. You change it with "/console gs c <IdleMode>"
  3. -- The modes are:
  4. -- Refresh: Uses the most refresh available.
  5. -- DT: A mix of refresh, PDT, and MDT to help when you can't avoid AOE.
  6. -- PetDT: Sacrifice refresh to reduce avatar's damage taken. WARNING: Selenian Cap drops you below 119, use with caution!
  7. -- DD: When melee mode is on and you're engaged, uses TP gear. Otherwise, avatar melee gear.
  8. -- Favor: Uses Beckoner's Horn +1 and max smn skill to boost the favor effect.
  9. -- Zendik: Favor build with the Zendik Robe added in, for Shiva's Favor in manaburn parties. (Shut up, it sounded like a good idea at the time)
  10.  
  11. -- Additional Bindings:
  12. -- F9 - Toggles between a subset of IdleModes (Refresh > DT > PetDT)
  13. -- F10 - Toggles MeleeMode (When enabled, equips Nirvana and Elan+1, then disables those 2 slots from swapping)
  14. --       NOTE: If you don't already have the Nirvana & Elan+1 equipped, YOU WILL LOSE TP
  15.  
  16. -- Additional Commands:
  17. -- /console gs c AccMode - Toggles high-accuracy sets to be used where appropriate.
  18. -- /console gs c ImpactMode - Toggles between using normal magic BP set for Fenrir's Impact or a custom high-skill set for debuffs.
  19. -- /console gs c ForceIlvl - I have this set up to override a few specific slots where I normally use non-ilvl pieces.
  20. -- /console gs c TH - Treasure Hunter toggle. By default, this is only used for Dia, Dia II, and Diaga.
  21. -- /console gs c LagMode - Used to help BPs land in the right gear in high-lag situations.
  22. --                          Sets a timer to swap gear 0.5s after the BP is used rather than waiting for server response.
  23.  
  24. function file_unload()
  25.     send_command('unbind f9')
  26.     send_command('unbind ^f9')
  27.     send_command('unbind f10')
  28.     send_command('unbind ^f10')
  29. end
  30.  
  31. function get_sets()
  32.     send_command('bind f9 gs c ToggleIdle') -- F9 = Cycle through commonly used idle modes
  33.     send_command('bind ^f9 gs c ForceIlvl') -- Ctrl+F9 = Toggle ForceIlvl
  34.     send_command('bind f10 gs c MeleeMode') -- F10 = Toggle Melee Mode
  35.     send_command('bind ^f10 gs c TH') -- Ctrl+F10 = Treasure Hunter toggle
  36.  
  37.     -- Set your merits here. This is used in deciding between Enticer's Pants or Apogee Slacks +1.
  38.     -- To change in-game, "/console gs c MeteorStrike3" will change Meteor Strike to 3/5 merits.
  39.     -- The damage difference is very minor unless you're over 2400 TP.
  40.     -- It's ok to just always use Enticer's Pants and ignore this section.
  41.     MeteorStrike = 1
  42.     HeavenlyStrike = 1
  43.     WindBlade = 1
  44.     Geocrush = 1
  45.     Thunderstorm = 5
  46.     GrandFall = 1
  47.  
  48.     StartLockStyle = '85'
  49.     IdleMode = 'Refresh'
  50.     AccMode = false
  51.     ImpactDebuff = false
  52.     MeleeMode = false
  53.     TreasureHunter = false
  54.     THSpells = S{"Dia","Dia II","Diaga"} -- If you want Treasure Hunter gear to swap for a spell/ability, add it here.
  55.     ForceIlvl = false
  56.     LagMode = false -- Default LagMode. If you have a lot of lag issues, change to "true".
  57.     AutoRemedy = false -- Auto Remedy when using an ability while Paralyzed.
  58.     AutoEcho = false -- Auto Echo Drop when using an ability while Silenced.
  59.     SacTorque = true -- If you have Sacrifice Torque, this will auto-equip it when slept in order to wake up.
  60.  
  61.     -- ===================================================================================================================
  62.     --      Sets
  63.     -- ===================================================================================================================
  64.  
  65.     -- Base Damage Taken Set - Mainly used when IdleMode is "DT"
  66.     sets.DT_Base = {
  67.         main="Nirvana",
  68.         sub="Khonsu",
  69.         head="Convoker's Horn +3",
  70.         neck="Loricate Torque +1",
  71.         ear1="Genmei Earring",
  72.         ear2="Etiolation Earring",
  73.         body="Udug Jacket",
  74.         hands={ name="Merlinic Dastanas", augments={'Pet: Crit.hit rate +2','"Mag.Atk.Bns."+25','"Refresh"+2','Mag. Acc.+10 "Mag.Atk.Bns."+10',}},
  75.         ring1="Vocane Ring +1",
  76.         ring2="Defending Ring",
  77.         back={ name="Campestres's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},
  78.         waist="Regal Belt",
  79.         legs="Assiduity Pants +1",
  80.         feet={ name="Merlinic Crackows", augments={'DEX+10','Phys. dmg. taken -2%','"Refresh"+2','Accuracy+3 Attack+3',}}
  81.     }
  82.  
  83.     -- Treasure Hunter set. Don't put anything in here except TH+ gear.
  84.     -- It overwrites slots in other sets when TH toggle is on (Ctrl+F10).
  85.     sets.TH = {
  86.         head="Volte Cap",
  87.         waist="Chaac Belt",
  88.         hands="Volte Bracers",
  89.         feet="Volte Boots"
  90.     }
  91.  
  92.     sets.precast = {}
  93.  
  94.     -- Fast Cast
  95.     sets.precast.FC = {
  96.         main={ name="Grioavolr", augments={'"Fast Cast"+6','INT+2','"Mag.Atk.Bns."+17',}}, -- +10
  97.         sub="Clerisy Strap +1", -- +3
  98.         --ammo="Sapience Orb",
  99.         head="Amalric Coif +1", -- +11
  100.         neck="Orunmila's Torque", -- +5
  101.         ear1="Malignance Earring", -- +4
  102.         ear2="Loquacious Earring", -- +2
  103.         hands={ name="Telchine Gloves", augments={'Mag. Evasion+25','"Fast Cast"+5','Enh. Mag. eff. dur. +10',}},
  104.         body="Inyanga Jubbah +2", -- +14
  105.         ring1="Lebeche Ring",
  106.         ring2="Kishar Ring", -- +4
  107.         back={ name="Campestres's Cape", augments={'Pet: M.Acc.+20 Pet: M.Dmg.+20','Eva.+20 /Mag. Eva.+20','Pet: Mag. Acc.+10','"Fast Cast"+10',}},
  108.         waist="Witful Belt", -- +3
  109.         legs={ name="Merlinic Shalwar", augments={'"Fast Cast"+6','CHR+6','Mag. Acc.+14','"Mag.Atk.Bns."+14',}},
  110.         feet="Regal Pumps +1" -- +5~7
  111.     }
  112.  
  113.     sets.precast["Dispelga"] = set_combine(sets.precast.FC, {
  114.         main="Daybreak",
  115.         sub="Ammurapi Shield"
  116.     })
  117.  
  118.     sets.midcast = {}
  119.  
  120.     -- BP Timer Gear
  121.     -- Use BP Recast Reduction here, along with Avatar's Favor gear.
  122.     -- Avatar's Favor skill tiers are 512 / 575 / 670.
  123.     sets.midcast.BP = {
  124.         main={ name="Espiritus", augments={'Summoning magic skill +15','Pet: Mag. Acc.+30','Pet: Damage taken -4%',}},
  125.         sub="Vox Grip",
  126.         ammo="Sancus Sachet +1",
  127.         head="Beckoner's Horn +1", -- Always use Beckoner's Horn here. If you don't have it, quit SMN in shame until you make it.
  128.         neck="Incanter's Torque",
  129.         ear1="Cath Palug Earring",
  130.         ear2="Lodurr Earring",
  131.         body="Baayami Robe +1",
  132.         hands="Baayami Cuffs +1",
  133.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  134.         ring2="Evoker's Ring",
  135.         back={ name="Conveyance Cape", augments={'Summoning magic skill +5','Pet: Enmity+12','Blood Pact Dmg.+2',}},
  136.         waist="Kobo Obi",
  137.         legs="Baayami Slops +1",
  138.         feet="Baayami Sabots +1"
  139.     }
  140.  
  141.     -- Elemental Siphon sets. Zodiac Ring is affected by day, Chatoyant Staff by weather, and Twilight Cape by both.
  142.     sets.midcast.Siphon = {
  143.         main={ name="Espiritus", augments={'Summoning magic skill +15','Pet: Mag. Acc.+30','Pet: Damage taken -4%',}},
  144.         sub="Vox Grip",
  145.         ammo="Esper Stone +1",
  146.         head="Baayami Hat +1",
  147.         neck="Incanter's Torque",
  148.         ear1="Cath Palug Earring",
  149.         ear2="Lodurr Earring",
  150.         body="Baayami Robe +1",
  151.         hands="Baayami Cuffs +1",
  152.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  153.         ring2="Evoker's Ring",
  154.         back={ name="Conveyance Cape", augments={'Summoning magic skill +5','Pet: Enmity+12','Blood Pact Dmg.+2',}},
  155.         waist="Kobo Obi",
  156.         legs="Baayami Slops +1",
  157.         feet="Beck. Pigaches +1"
  158.     }
  159.  
  160.     sets.midcast.SiphonZodiac = set_combine(sets.midcast.Siphon, { ring1="Zodiac Ring" })
  161.  
  162.     sets.midcast.SiphonWeather = set_combine(sets.midcast.Siphon, { main="Chatoyant Staff" })
  163.    
  164.     sets.midcast.SiphonWeatherZodiac = set_combine(sets.midcast.SiphonZodiac, { main="Chatoyant Staff" })
  165.  
  166.     -- Summoning Midcast, cap spell interruption if possible (Baayami Robe gives 100, need 2 more)
  167.     -- PDT isn't a bad idea either, so don't overwrite a lot from the DT set it inherits from.
  168.     sets.midcast.Summon = set_combine(sets.DT_Base, {
  169.         body="Baayami Robe +1",
  170.         waist="Rumination Sash"
  171.     })
  172.  
  173.     -- If you ever lock your weapon, keep that in mind when building cure potency set.
  174.     sets.midcast.Cure = {
  175.         main="Nirvana",
  176.         sub="Achaq Grip",
  177.         head={ name="Vanya Hood", augments={'MP+50','"Cure" potency +7%','Enmity-6',}},
  178.         neck="Orunmila's Torque",
  179.         ear1="Meili Earring",
  180.         ear2="Novia Earring",
  181.         body="Zendik Robe",
  182.         hands={ name="Telchine Gloves", augments={'Mag. Evasion+25','"Fast Cast"+5','Enh. Mag. eff. dur. +10',}},
  183.         ring1="Lebeche Ring",
  184.         ring2="Menelaus's Ring",
  185.         back="Tempered Cape +1",
  186.         waist="Luminary Sash",
  187.         legs="Convoker's Spats +3",
  188.         feet={ name="Vanya Clogs", augments={'MP+50','"Cure" potency +7%','Enmity-6',}}
  189.     }
  190.  
  191.     sets.midcast.Cursna = set_combine(sets.precast.FC, {
  192.         neck="Debilis Medallion",
  193.         ear1="Meili Earring",
  194.         ear2="Beatific Earring",
  195.         ring1="Menelaus's Ring",
  196.         ring2="Haoma's Ring",
  197.         back="Tempered Cape +1",
  198.         waist="Bishop's Sash",
  199.         feet={ name="Vanya Clogs", augments={'Healing magic skill +20','"Cure" spellcasting time -7%','Magic dmg. taken -3',}}
  200.     })
  201.    
  202.     -- Just a standard set for spells that have no set
  203.     sets.midcast.EnmityRecast = set_combine(sets.precast.FC, {
  204.         main="Nirvana",
  205.         ear1="Novia Earring",
  206.         body={ name="Apo. Dalmatica +1", augments={'Summoning magic skill +20','Enmity-6','Pet: Damage taken -4%',}}
  207.     })
  208.  
  209.     sets.midcast.Enfeeble = {
  210.         main="Daybreak",
  211.         sub="Ammurapi Shield",
  212.         head=empty,
  213.         neck="Erra Pendant",
  214.         ear1="Malignance Earring",
  215.         ear2="Dignitary's Earring",
  216.         body="Cohort Cloak +1",
  217.         hands="Inyanga Dastanas +2",
  218.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  219.         ring2={name="Stikini Ring +1", bag="wardrobe4"},
  220.         back="Aurist's Cape +1",
  221.         waist="Luminary Sash",
  222.         legs="Inyanga Shalwar +2",
  223.         feet="Skaoi Boots"
  224.     }
  225.  
  226.     sets.midcast.Enhancing = {
  227.         main={ name="Gada", augments={'Enh. Mag. eff. dur. +6','DEX+1','Mag. Acc.+5','"Mag.Atk.Bns."+18','DMG:+4',}},
  228.         sub="Ammurapi Shield",
  229.         head={ name="Telchine Cap", augments={'Mag. Evasion+24','"Conserve MP"+4','Enh. Mag. eff. dur. +10',}},
  230.         neck="Incanter's Torque",
  231.         ear1="Mimir Earring",
  232.         ear2="Andoaa Earring",
  233.         body={ name="Telchine Chas.", augments={'Mag. Evasion+25','"Conserve MP"+5','Enh. Mag. eff. dur. +10',}},
  234.         hands={ name="Telchine Gloves", augments={'Mag. Evasion+25','"Fast Cast"+5','Enh. Mag. eff. dur. +10',}},
  235.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  236.         ring2={name="Stikini Ring +1", bag="wardrobe4"},
  237.         back="Merciful Cape",
  238.         waist="Embla Sash",
  239.         legs={ name="Telchine Braconi", augments={'Mag. Evasion+25','"Conserve MP"+4','Enh. Mag. eff. dur. +10',}},
  240.         feet={ name="Telchine Pigaches", augments={'Mag. Evasion+24','"Conserve MP"+3','Enh. Mag. eff. dur. +10',}}
  241.     }
  242.  
  243.     sets.midcast.Stoneskin = set_combine(sets.midcast.Enhancing, {
  244.         neck="Nodens Gorget",
  245.         ear2="Earthcry Earring",
  246.         waist="Siegel Sash",
  247.         --legs="Shedir Seraweels"
  248.     })
  249.  
  250.     sets.midcast.Nuke = {
  251.         main={ name="Grioavolr", augments={'"Fast Cast"+6','INT+2','"Mag.Atk.Bns."+17',}},
  252.         sub="Niobid Strap",
  253.         head="Cath Palug Crown",
  254.         neck="Sanctity Necklace",
  255.         ear1="Malignance Earring",
  256.         ear2="Friomisi Earring",
  257.         body={ name="Amalric Doublet +1", augments={'MP+80','Mag. Acc.+20','"Mag.Atk.Bns."+20',}},
  258.         hands={ name="Amalric Gages +1", augments={'INT+12','Mag. Acc.+20','"Mag.Atk.Bns."+20',}},
  259.         ring1="Freke Ring",
  260.         ring2="Shiva Ring +1",
  261.         back={ name="Campestres's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},
  262.         waist="Eschan Stone",
  263.         legs={ name="Amalric Slops +1", augments={'MP+80','Mag. Acc.+20','"Mag.Atk.Bns."+20',}},
  264.         feet={ name="Amalric Nails +1", augments={'Mag. Acc.+20','"Mag.Atk.Bns."+20','"Conserve MP"+7',}}
  265.     }
  266.  
  267.     sets.midcast["Refresh"] = set_combine(sets.midcast.Enhancing, {
  268.         head="Amalric Coif +1",
  269.         waist="Gishdubar Sash"
  270.     })
  271.  
  272.     sets.midcast["Aquaveil"] = set_combine(sets.midcast.Enhancing, {
  273.         main="Vadose Rod",
  274.         head="Amalric Coif +1"
  275.     })
  276.  
  277.     sets.midcast["Dispelga"] = set_combine(sets.midcast.Enfeeble, {
  278.         main="Daybreak",
  279.         sub="Ammurapi Shield"
  280.     })
  281.  
  282.     sets.midcast["Mana Cede"] = { hands="Beckoner's Bracers +1" }
  283.  
  284.     sets.midcast["Astral Flow"] = { head="Glyphic Horn +3" }
  285.    
  286.     -- ===================================================================================================================
  287.     --  Weaponskills
  288.     -- ===================================================================================================================
  289.  
  290.     -- I stack magic accuracy here to land the defense down effect, rather than MAB for damage.
  291.     -- It's a personal preference, use whatever you prefer.
  292.     sets.midcast["Garland of Bliss"] = {
  293.         head="Inyanga Tiara +2",
  294.         neck="Sanctity Necklace",
  295.         ear1="Malignance Earring",
  296.         ear2="Dignitary's Earring",
  297.         body="Inyanga Jubbah +2",
  298.         hands="Inyanga Dastanas +2",
  299.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  300.         ring2={name="Stikini Ring +1", bag="wardrobe4"},
  301.         back="Aurist's Cape +1",
  302.         waist="Eschan Stone",
  303.         legs="Inyanga Shalwar +2",
  304.         feet="Inyanga Crackows +2"
  305.     }
  306.  
  307.     -- My set focuses on accuracy here to make skillchains with Ifrit
  308.     -- Just like Garland, it's not hard to improve on the damage from this set if that's what you're after.
  309.     sets.midcast["Shattersoul"] = {
  310.         head="Convoker's Horn +3",
  311.         neck="Fotia Gorget",
  312.         ear1="Zennaroi Earring",
  313.         ear2="Telos Earring",
  314.         body="Tali'ah Manteel +2",
  315.         hands={ name="Merlinic Dastanas", augments={'STR+7','INT+7','Weapon skill damage +6%','Accuracy+11 Attack+11','Mag. Acc.+10 "Mag.Atk.Bns."+10',}},
  316.         ring1="Freke Ring",
  317.         ring2="Shiva Ring +1",
  318.         back={ name="Campestres's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10','Phys. dmg. taken-10%',}},
  319.         waist="Fotia Belt",
  320.         legs={ name="Telchine Braconi", augments={'Accuracy+17','Weapon Skill Acc.+14','Weapon skill damage +3%',}},
  321.         feet="Convoker's Pigaches +3"
  322.     }
  323.  
  324.     sets.midcast["Cataclysm"] = sets.midcast.Nuke
  325.  
  326.     sets.pet_midcast = {}
  327.  
  328.     -- Main physical pact set (Volt Strike, Pred Claws, etc.)
  329.     -- Prioritize BP Damage & Pet: Double Attack
  330.     -- Strong Alternatives:
  331.     -- Gridarvor, Apogee Crown, Apogee Pumps, Convoker's Doublet, Apogee Dalmatica, Shulmanu Collar, Gelos Earring, Regal Belt
  332.     sets.pet_midcast.Physical_BP = {
  333.         main="Nirvana",
  334.         sub="Elan Strap +1",
  335.         ammo="Sancus Sachet +1",
  336.         head={ name="Helios Band", augments={'Pet: Attack+30 Pet: Rng.Atk.+30','Pet: "Dbl. Atk."+8','Blood Pact Dmg.+7',}},
  337.         neck="Summoner's Collar +2",
  338.         ear1="Lugalbanda Earring",
  339.         ear2="Kyrene's Earring",
  340.         body="Glyphic Doublet +3",
  341.         hands={ name="Merlinic Dastanas", augments={'Pet: Attack+24 Pet: Rng.Atk.+24','Blood Pact Dmg.+9','Pet: STR+10','Pet: Mag. Acc.+7',}},
  342.         ring1="Cath Palug Ring",
  343.         ring2="Varar Ring +1",
  344.         back={ name="Campestres's Cape", augments={'Pet: Acc.+20 Pet: R.Acc.+20 Pet: Atk.+20 Pet: R.Atk.+20','Eva.+20 /Mag. Eva.+20','Pet: Attack+10 Pet: Rng.Atk.+10','Pet: "Regen"+10','Pet: Damage taken -5%',}},
  345.         waist="Incarnation Sash",
  346.         legs={ name="Apogee Slacks +1", augments={'Pet: STR+20','Blood Pact Dmg.+14','Pet: "Dbl. Atk."+4',}},
  347.         feet={ name="Helios Boots", augments={'Pet: Accuracy+28 Pet: Rng. Acc.+28','Pet: "Dbl. Atk."+8','Blood Pact Dmg.+7',}}
  348.     }
  349.  
  350.     -- Physical Pact AM3 set, less emphasis on Pet:DA
  351.     sets.pet_midcast.Physical_BP_AM3 = set_combine(sets.pet_midcast.Physical_BP, {
  352.         ear2="Gelos Earring",
  353.         body="Convoker's Doublet +3",
  354.         ring1="Varar Ring +1",
  355.         feet={ name="Apogee Pumps +1", augments={'MP+80','Pet: Attack+35','Blood Pact Dmg.+8',}}
  356.     })
  357.  
  358.     -- Physical pacts which benefit more from TP than Pet:DA (like Spinning Dive and other pacts you never use except that one time)
  359.     sets.pet_midcast.Physical_BP_TP = set_combine(sets.pet_midcast.Physical_BP, {
  360.         head={ name="Apogee Crown +1", augments={'MP+80','Pet: Attack+35','Blood Pact Dmg.+8',}},
  361.         ear2="Gelos Earring",
  362.         body="Convoker's Doublet +3",
  363.         ring1="Varar Ring +1",
  364.         waist="Regal Belt",
  365.         legs="Enticer's Pants",
  366.         feet={ name="Apogee Pumps +1", augments={'MP+80','Pet: Attack+35','Blood Pact Dmg.+8',}}
  367.     })
  368.  
  369.     -- Used for all physical pacts when AccMode is true
  370.     sets.pet_midcast.Physical_BP_Acc = set_combine(sets.pet_midcast.Physical_BP, {
  371.         head={ name="Apogee Crown +1", augments={'MP+80','Pet: Attack+35','Blood Pact Dmg.+8',}},
  372.         body="Convoker's Doublet +3",
  373.         hands={ name="Merlinic Dastanas", augments={'Pet: Accuracy+28 Pet: Rng. Acc.+28','Blood Pact Dmg.+10','Pet: DEX+9','Pet: Mag. Acc.+9','Pet: "Mag.Atk.Bns."+3',}},
  374.         --feet="Convoker's Pigaches +3"
  375.     })
  376.  
  377.     -- Base magic pact set
  378.     -- Prioritize BP Damage & Pet:MAB
  379.     -- Strong Alternatives:
  380.     -- Espiritus, Apogee Crown, Adad Amulet
  381.     sets.pet_midcast.Magic_BP_Base = {
  382.         main={ name="Grioavolr", augments={'Blood Pact Dmg.+10','Pet: STR+5','Pet: Mag. Acc.+18','Pet: "Mag.Atk.Bns."+25',}},
  383.         sub="Elan Strap +1",
  384.         ammo="Sancus Sachet +1",
  385.         head="Cath Palug Crown",
  386.         neck="Summoner's Collar +2",
  387.         ear1="Lugalbanda Earring",
  388.         ear2="Gelos Earring",
  389.         body={ name="Apo. Dalmatica +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},
  390.         hands={ name="Merlinic Dastanas", augments={'Pet: Mag. Acc.+25 Pet: "Mag.Atk.Bns."+25','Blood Pact Dmg.+10','Pet: "Mag.Atk.Bns."+7',}},
  391.         ring1="Varar Ring +1",
  392.         ring2="Varar Ring +1",
  393.         back={ name="Campestres's Cape", augments={'Pet: M.Acc.+20 Pet: M.Dmg.+20','Eva.+20 /Mag. Eva.+20','Pet: Mag. Acc.+10','"Fast Cast"+10',}},
  394.         waist="Regal Belt",
  395.         feet={ name="Apogee Pumps +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}}
  396.     }
  397.    
  398.     -- Some magic pacts benefit more from TP than others.
  399.     -- Note: This set will only be used on merit pacts if you have less than 4 merits.
  400.     --       Make sure to update your merit values at the top of this Lua.
  401.     sets.pet_midcast.Magic_BP_TP = set_combine(sets.pet_midcast.Magic_BP_Base, {
  402.         legs="Enticer's Pants"
  403.     })
  404.  
  405.     -- NoTP set used when you don't need Enticer's
  406.     sets.pet_midcast.Magic_BP_NoTP = set_combine(sets.pet_midcast.Magic_BP_Base, {
  407.         legs={ name="Apogee Slacks +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}}
  408.     })
  409.  
  410.     sets.pet_midcast.Magic_BP_TP_Acc = set_combine(sets.pet_midcast.Magic_BP_TP, {
  411.         head={ name="Merlinic Hood", augments={'Pet: Mag. Acc.+21 Pet: "Mag.Atk.Bns."+21','Blood Pact Dmg.+7','Pet: INT+6','Pet: "Mag.Atk.Bns."+11',}},
  412.         body="Convoker's Doublet +3",
  413.         hands={ name="Merlinic Dastanas", augments={'Pet: Mag. Acc.+29','Blood Pact Dmg.+10','Pet: INT+7','Pet: "Mag.Atk.Bns."+10',}}
  414.     })
  415.  
  416.     sets.pet_midcast.Magic_BP_NoTP_Acc = set_combine(sets.pet_midcast.Magic_BP_NoTP, {
  417.         head={ name="Merlinic Hood", augments={'Pet: Mag. Acc.+21 Pet: "Mag.Atk.Bns."+21','Blood Pact Dmg.+7','Pet: INT+6','Pet: "Mag.Atk.Bns."+11',}},
  418.         body="Convoker's Doublet +3",
  419.         hands={ name="Merlinic Dastanas", augments={'Pet: Mag. Acc.+29','Blood Pact Dmg.+10','Pet: INT+7','Pet: "Mag.Atk.Bns."+10',}}
  420.     })
  421.  
  422.     -- Favor BP Damage above all. Pet:MAB also very strong.
  423.     -- Pet: Accuracy, Attack, Magic Accuracy moderately important.
  424.     -- Strong Alternatives:
  425.     -- Keraunos, Grioavolr, Espiritus, Was, Apogee Crown, Apogee Dalmatica, Adad Amulet
  426.     sets.pet_midcast.FlamingCrush = {
  427.         main="Nirvana",
  428.         sub="Elan Strap +1",
  429.         ammo="Sancus Sachet +1",
  430.         head="Cath Palug Crown",
  431.         neck="Summoner's Collar +2",
  432.         ear1="Lugalbanda Earring",
  433.         ear2="Gelos Earring",
  434.         body="Convoker's Doublet +3",
  435.         hands={ name="Merlinic Dastanas", augments={'Pet: Mag. Acc.+25 Pet: "Mag.Atk.Bns."+25','Blood Pact Dmg.+10','Pet: "Mag.Atk.Bns."+7',}},
  436.         ring1="Varar Ring +1",
  437.         ring2="Varar Ring +1",
  438.         back={ name="Campestres's Cape", augments={'Pet: Acc.+20 Pet: R.Acc.+20 Pet: Atk.+20 Pet: R.Atk.+20','Eva.+20 /Mag. Eva.+20','Pet: Attack+10 Pet: Rng.Atk.+10','Pet: "Regen"+10','Pet: Damage taken -5%',}},
  439.         waist="Regal Belt",
  440.         legs={ name="Apogee Slacks +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},
  441.         --legs={ name="Apogee Slacks +1", augments={'Pet: STR+20','Blood Pact Dmg.+14','Pet: "Dbl. Atk."+4',}},
  442.         feet={ name="Apogee Pumps +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}}
  443.     }
  444.  
  445.     sets.pet_midcast.FlamingCrush_Acc = set_combine(sets.pet_midcast.FlamingCrush, {
  446.         ear2="Kyrene's Earring",
  447.         body="Convoker's Doublet +3",
  448.         hands={ name="Merlinic Dastanas", augments={'Pet: Accuracy+28 Pet: Rng. Acc.+28','Blood Pact Dmg.+10','Pet: DEX+9','Pet: Mag. Acc.+9','Pet: "Mag.Atk.Bns."+3',}},
  449.         --feet="Convoker's Pigaches +3"
  450.     })
  451.  
  452.     -- Pet: Magic Acc set - Mainly used for debuff pacts like Shock Squall
  453.     sets.pet_midcast.MagicAcc_BP = {
  454.         main="Nirvana",
  455.         sub="Vox Grip",
  456.         ammo="Sancus Sachet +1",
  457.         head="Convoker's Horn +3",
  458.         neck="Summoner's Collar +2",
  459.         ear1="Lugalbanda Earring",
  460.         ear2="Enmerkar Earring",
  461.         body="Convoker's Doublet +3",
  462.         hands="Lamassu Mitts +1",
  463.         ring1="Cath Palug Ring",
  464.         ring2="Evoker's Ring",
  465.         back={ name="Campestres's Cape", augments={'Pet: M.Acc.+20 Pet: M.Dmg.+20','Eva.+20 /Mag. Eva.+20','Pet: Mag. Acc.+10','"Fast Cast"+10',}},
  466.         waist="Regal Belt",
  467.         legs="Convoker's Spats +3",
  468.         feet="Convoker's Pigaches +3"
  469.     }
  470.  
  471.     sets.pet_midcast.Debuff_Rage = sets.pet_midcast.MagicAcc_BP
  472.  
  473.     -- Pure summoning magic set, mainly used for buffs like Hastega II.
  474.     -- Strong Alternatives:
  475.     -- Andoaa Earring, Summoning Earring, Lamassu Mitts +1, Caller's Pendant
  476.     sets.pet_midcast.SummoningMagic = {
  477.         main={ name="Espiritus", augments={'Summoning magic skill +15','Pet: Mag. Acc.+30','Pet: Damage taken -4%',}},
  478.         sub="Vox Grip",
  479.         ammo="Sancus Sachet +1",
  480.         head="Baayami Hat +1",
  481.         neck="Incanter's Torque",
  482.         ear1="Cath Palug Earring",
  483.         ear2="Lodurr Earring",
  484.         body="Baayami Robe +1",
  485.         hands="Baayami Cuffs +1",
  486.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  487.         ring2="Evoker's Ring",
  488.         back={ name="Conveyance Cape", augments={'Summoning magic skill +5','Pet: Enmity+12','Blood Pact Dmg.+2',}},
  489.         waist="Kobo Obi",
  490.         legs="Baayami Slops +1",
  491.         feet="Baayami Sabots +1"
  492.     }
  493.  
  494.     sets.pet_midcast.Buff = sets.pet_midcast.SummoningMagic
  495.    
  496.     -- Wind's Blessing set. Pet:MND increases potency.
  497.     sets.pet_midcast.Buff_MND = set_combine(sets.pet_midcast.Buff, {
  498.         main="Nirvana",
  499.         neck="Summoner's Collar +2",
  500.         hands="Lamassu Mitts +1",
  501.         back={ name="Campestres's Cape", augments={'Pet: Acc.+20 Pet: R.Acc.+20 Pet: Atk.+20 Pet: R.Atk.+20','Eva.+20 /Mag. Eva.+20','Pet: Attack+10 Pet: Rng.Atk.+10','Pet: "Regen"+10','Pet: Damage taken -5%',}},
  502.         legs="Assiduity Pants +1",
  503.     })
  504.  
  505.     -- Don't drop Avatar level in this set if you can help it.
  506.     -- You can use Avatar:HP+ gear to increase the HP recovered, but most of it will decrease your own max HP.
  507.     sets.pet_midcast.Buff_Healing = set_combine(sets.pet_midcast.Buff, {
  508.         main="Nirvana",
  509.         back={ name="Campestres's Cape", augments={'Pet: Acc.+20 Pet: R.Acc.+20 Pet: Atk.+20 Pet: R.Atk.+20','Eva.+20 /Mag. Eva.+20','Pet: Attack+10 Pet: Rng.Atk.+10','Pet: "Regen"+10','Pet: Damage taken -5%',}},
  510.         --body={ name="Apo. Dalmatica +1", augments={'Summoning magic skill +20','Enmity-6','Pet: Damage taken -4%',}},
  511.         --feet={ name="Apogee Pumps +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}}
  512.     })
  513.  
  514.     -- This set is used for certain blood pacts when ImpactDebuff mode is turned ON. (/console gs c ImpactDebuff)
  515.     -- These pacts are normally used with magic damage gear, but they're also strong debuffs when enhanced by summoning skill.
  516.     -- This set is safe to ignore.
  517.     sets.pet_midcast.Impact = set_combine(sets.pet_midcast.SummoningMagic, {
  518.         main="Nirvana",
  519.         head="Convoker's Horn +3",
  520.         ear1="Lugalbanda Earring",
  521.         ear2="Enmerkar Earring",
  522.         hands="Lamassu Mitts +1"
  523.     })
  524.  
  525.     sets.aftercast = {}
  526.  
  527.     -- Idle set with no avatar out.
  528.     sets.aftercast.Idle = {
  529.         main="Contemplator +1",
  530.         sub="Oneiros Grip",
  531.         ammo="Sancus Sachet +1",
  532.         head="Convoker's Horn +3",
  533.         neck="Loricate Torque +1",
  534.         ear1="Cath Palug Earring",
  535.         ear2="Moonshade Earring",
  536.         body={ name="Apo. Dalmatica +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},
  537.         hands={ name="Merlinic Dastanas", augments={'Pet: Crit.hit rate +2','"Mag.Atk.Bns."+25','"Refresh"+2','Mag. Acc.+10 "Mag.Atk.Bns."+10',}},
  538.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  539.         ring2="Defending Ring",
  540.         back={ name="Campestres's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},
  541.         waist="Regal Belt",
  542.         legs="Assiduity Pants +1",
  543.         feet="Herald's Gaiters"
  544.     }
  545.    
  546.     -- Idle set used when ForceIlvl is ON. Use this mode to avoid Gaiters dropping ilvl.
  547.     sets.aftercast.Idle_Ilvl = set_combine(sets.aftercast.Idle, {
  548.         feet="Baayami Sabots +1"
  549.     })
  550.    
  551.     sets.aftercast.DT = sets.DT_Base
  552.  
  553.     -- Main refresh set - Many idle sets inherit from this set.
  554.     -- Put common items here so you don't have to repeat them over and over.
  555.     -- Strong Alternatives:
  556.     -- Gridarvor, Asteria Mitts, Shomonjijoe, Beckoner's Horn, Evans Earring, Isa Belt
  557.     sets.aftercast.Perp_Base = {
  558.         main="Nirvana",
  559.         sub="Oneiros Grip",
  560.         ammo="Sancus Sachet +1",
  561.         head="Convoker's Horn +3",
  562.         neck="Caller's Pendant",
  563.         ear1="Cath Palug Earring",
  564.         ear2="Moonshade Earring",
  565.         body={ name="Apo. Dalmatica +1", augments={'Summoning magic skill +20','Enmity-6','Pet: Damage taken -4%',}},
  566.         hands={ name="Merlinic Dastanas", augments={'Pet: Crit.hit rate +2','"Mag.Atk.Bns."+25','"Refresh"+2','Mag. Acc.+10 "Mag.Atk.Bns."+10',}},
  567.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  568.         ring2="Evoker's Ring",
  569.         back={ name="Campestres's Cape", augments={'Pet: Acc.+20 Pet: R.Acc.+20 Pet: Atk.+20 Pet: R.Atk.+20','Eva.+20 /Mag. Eva.+20','Pet: Attack+10 Pet: Rng.Atk.+10','Pet: "Regen"+10','Pet: Damage taken -5%',}},
  570.         waist="Lucidity Sash",
  571.         legs="Assiduity Pants +1",
  572.         feet="Baayami Sabots +1"
  573.     }
  574.  
  575.     -- Avatar Melee set. Equipped when IdleMode is "DD" and MeleeMode is OFF.
  576.     -- You really don't need this set. It's only here because I can't bring myself to throw it away.
  577.     sets.aftercast.Perp_DD = set_combine(sets.aftercast.Perp_Base, {
  578.         ear2="Rimeice Earring",
  579.         body="Glyphic Doublet +3",
  580.         hands={ name="Helios Gloves", augments={'Pet: Accuracy+22 Pet: Rng. Acc.+22','Pet: "Dbl. Atk."+8','Pet: Haste+6',}},
  581.         waist="Klouskap Sash",
  582.         feet={ name="Helios Boots", augments={'Pet: Accuracy+21 Pet: Rng. Acc.+21','Pet: "Dbl. Atk."+8','Pet: Haste+6',}}
  583.     })
  584.  
  585.     -- Refresh set with avatar out. Equipped when IdleMode is "Refresh".
  586.     sets.aftercast.Perp_Refresh = set_combine(sets.aftercast.Perp_Base, {
  587.     })
  588.  
  589.     -- Refresh set when MP is under 50%
  590.     -- If you have Fucho and don't need Lucidity Sash for perp down, you can uncomment the belt here to enable using it.
  591.     sets.aftercast.Perp_RefreshSub50 = set_combine(sets.aftercast.Perp_Refresh, {
  592.         --waist="Fucho-no-obi"
  593.     })
  594.    
  595.     -- Used when IdleMode is "Favor" to maximize avatar's favor effect.
  596.     -- Skill tiers are 512 / 575 / 670
  597.     sets.aftercast.Perp_Favor = set_combine(sets.aftercast.Perp_Refresh, {
  598.         head="Beckoner's Horn +1",
  599.         ear2="Lodurr Earring",
  600.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  601.         ring2="Evoker's Ring",
  602.         feet="Baayami Sabots +1"
  603.     })
  604.  
  605.     sets.aftercast.Perp_Zendik = set_combine(sets.aftercast.Perp_Favor, {
  606.         body="Zendik Robe"
  607.     })
  608.  
  609.     -- TP set. Equipped when IdleMode is "DD" and MeleeMode is ON.
  610.     sets.aftercast.Perp_Melee = set_combine(sets.aftercast.Perp_Refresh, {
  611.         head="Convoker's Horn +3",
  612.         neck="Shulmanu Collar",
  613.         ear1="Telos Earring",
  614.         ear2="Cessance Earring",
  615.         body="Tali'ah Manteel +2",
  616.         hands={ name="Merlinic Dastanas", augments={'"Mag.Atk.Bns."+3','Accuracy+12','"Store TP"+7','Accuracy+7 Attack+7',}},
  617.         ring1="Rajas Ring",
  618.         ring2="Petrov Ring",
  619.         back={ name="Campestres's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10','Phys. dmg. taken-10%',}},
  620.         waist="Cetl Belt",
  621.         legs="Convoker's Spats +3",
  622.         feet="Convoker's Pigaches +3"
  623.     })
  624.  
  625.     -- Pet:DT build. Equipped when IdleMode is "PetDT". Note: Avatars only need -31 PDT to cap, MDT is the hard one to cap.
  626.     -- Strong alternatives:
  627.     -- Selenian Cap, Enmerkar Earring, Handler's Earring, Rimeice Earring, Thurandaut Ring, Tali'ah Seraweels
  628.     sets.aftercast.Avatar_DT = {
  629.         main="Nirvana",
  630.         sub="Oneiros Grip",
  631.         ammo="Sancus Sachet +1",
  632.         head={ name="Apogee Crown +1", augments={'Pet: Accuracy+25','"Avatar perpetuation cost"+7','Pet: Damage taken -4%',}},
  633.         neck="Summoner's Collar +2",
  634.         ear1="Cath Palug Earring",
  635.         ear2="Enmerkar Earring",
  636.         body={ name="Apo. Dalmatica +1", augments={'Summoning magic skill +20','Enmity-6','Pet: Damage taken -4%',}},
  637.         hands={ name="Telchine Gloves", augments={'Pet: Mag. Evasion+18','Pet: "Regen"+3','Pet: Damage taken -4%',}},
  638.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  639.         ring2={name="Stikini Ring +1", bag="wardrobe4"},
  640.         back={ name="Campestres's Cape", augments={'Pet: Acc.+20 Pet: R.Acc.+20 Pet: Atk.+20 Pet: R.Atk.+20','Eva.+20 /Mag. Eva.+20','Pet: Attack+10 Pet: Rng.Atk.+10','Pet: "Regen"+10','Pet: Damage taken -5%',}},
  641.         waist="Isa Belt",
  642.         legs="Enticer's Pants",
  643.         feet={ name="Telchine Pigaches", augments={'Pet: Mag. Evasion+20','Pet: "Regen"+3','Pet: Damage taken -4%',}}
  644.     }
  645.  
  646.     -- Perp down set used when ForceIlvl is ON. If you use Selenian Cap for Pet:DT, you can make another set here without it.
  647.     sets.aftercast.Avatar_DT_Ilvl = set_combine(sets.aftercast.Avatar_DT, {
  648.     })
  649.  
  650.     -- DT build with avatar out. Equipped when IdleMode is "DT".
  651.     sets.aftercast.Perp_DT = set_combine(sets.DT_Base, {
  652.         ear2="Evans Earring",
  653.         body="Udug Jacket",
  654.         waist="Lucidity Sash"
  655.     })
  656.  
  657.     -- Idle set used when you have a spirit summoned. Glyphic Spats will make them cast more frequently.
  658.     sets.aftercast.Spirit = {
  659.         main="Nirvana",
  660.         sub="Vox Grip",
  661.         ammo="Sancus Sachet +1",
  662.         head="Convoker's Horn +3",
  663.         neck="Incanter's Torque",
  664.         ear1="Cath Palug Earring",
  665.         ear2="Evans Earring",
  666.         body="Baayami Robe +1",
  667.         hands="Baayami Cuffs +1",
  668.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  669.         ring2="Evoker's Ring",
  670.         back={ name="Conveyance Cape", augments={'Summoning magic skill +5','Pet: Enmity+12','Blood Pact Dmg.+2',}},
  671.         waist="Lucidity Sash",
  672.         legs="Glyphic Spats +3",
  673.         feet="Baayami Sabots +1"
  674.     }
  675.  
  676.     -- ===================================================================================================================
  677.     --      End of Sets
  678.     -- ===================================================================================================================
  679.  
  680.     Buff_BPs_Duration = S{'Shining Ruby','Aerial Armor','Frost Armor','Rolling Thunder','Crimson Howl','Lightning Armor','Ecliptic Growl','Glittering Ruby','Earthen Ward','Hastega','Noctoshield','Ecliptic Howl','Dream Shroud','Earthen Armor','Fleet Wind','Inferno Howl','Heavenward Howl','Hastega II','Soothing Current','Crystal Blessing','Katabatic Blades'}
  681.     Buff_BPs_Healing = S{'Healing Ruby','Healing Ruby II','Whispering Wind','Spring Water'}
  682.     Buff_BPs_MND = S{"Wind's Blessing"}
  683.     Debuff_BPs = S{'Mewing Lullaby','Eerie Eye','Lunar Cry','Lunar Roar','Nightmare','Pavor Nocturnus','Ultimate Terror','Somnolence','Slowga','Tidal Roar','Diamond Storm','Sleepga','Shock Squall','Bitter Elegy','Lunatic Voice'}
  684.     Debuff_Rage_BPs = S{'Moonlit Charge','Tail Whip'}
  685.  
  686.     Magic_BPs_NoTP = S{'Holy Mist','Nether Blast','Aerial Blast','Searing Light','Diamond Dust','Earthen Fury','Zantetsuken','Tidal Wave','Judgment Bolt','Inferno','Howling Moon','Ruinous Omen','Night Terror','Thunderspark','Tornado II','Sonic Buffet'}
  687.     Magic_BPs_TP = S{'Impact','Conflag Strike','Level ? Holy','Lunar Bay'}
  688.     Merit_BPs = S{'Meteor Strike','Geocrush','Grand Fall','Wind Blade','Heavenly Strike','Thunderstorm'}
  689.     Physical_BPs_TP = S{'Rock Buster','Mountain Buster','Crescent Fang','Spinning Dive','Roundhouse'}
  690.    
  691.     ZodiacElements = S{'Fire','Earth','Water','Wind','Ice','Lightning'}
  692.  
  693.     --TownIdle = S{"windurst woods","windurst waters","windurst walls","port windurst","bastok markets","bastok mines","port bastok","southern san d'oria","northern san d'oria","port san d'oria","upper jeuno","lower jeuno","port jeuno","ru'lude gardens","norg","kazham","tavnazian safehold","rabao","selbina","mhaura","aht urhgan whitegate","al zahbi","nashmau","western adoulin","eastern adoulin"}
  694.     --Salvage = S{"Bhaflau Remnants","Zhayolm Remnants","Arrapago Remnants","Silver Sea Remnants"}
  695.  
  696.     -- Select initial macro set and set lockstyle
  697.     -- This section likely requires changes or removal if you aren't Pergatory
  698.     -- Note: This doesn't change your macro set for you during play, your macros have to do that. This is just for when the Lua is loaded.
  699.     if pet.isvalid then
  700.         if pet.name=='Fenrir' then
  701.             send_command('input /macro book 10;wait .1;input /macro set 2;wait 3;input /lockstyleset '..StartLockStyle)
  702.         elseif pet.name=='Ifrit' then
  703.             send_command('input /macro book 10;wait .1;input /macro set 3;wait 3;input /lockstyleset '..StartLockStyle)
  704.         elseif pet.name=='Titan' then
  705.             send_command('input /macro book 10;wait .1;input /macro set 4;wait 3;input /lockstyleset '..StartLockStyle)
  706.         elseif pet.name=='Leviathan' then
  707.             send_command('input /macro book 10;wait .1;input /macro set 5;wait 3;input /lockstyleset '..StartLockStyle)
  708.         elseif pet.name=='Garuda' then
  709.             send_command('input /macro book 10;wait .1;input /macro set 6;wait 3;input /lockstyleset '..StartLockStyle)
  710.         elseif pet.name=='Shiva' then
  711.             send_command('input /macro book 10;wait .1;input /macro set 7;wait 3;input /lockstyleset '..StartLockStyle)
  712.         elseif pet.name=='Ramuh' then
  713.             send_command('input /macro book 10;wait .1;input /macro set 8;wait 3;input /lockstyleset '..StartLockStyle)
  714.         elseif pet.name=='Diabolos' then
  715.             send_command('input /macro book 10;wait .1;input /macro set 9;wait 3;input /lockstyleset '..StartLockStyle)
  716.         elseif pet.name=='Cait Sith' then
  717.             send_command('input /macro book 11;wait .1;input /macro set 2;wait 3;input /lockstyleset '..StartLockStyle)
  718.         elseif pet.name=='Siren' then
  719.             send_command('input /macro book 11;wait .1;input /macro set 4;wait 3;input /lockstyleset '..StartLockStyle)
  720.         end
  721.     else
  722.         send_command('input /macro book 10;wait .1;input /macro set 1;wait 3;input /lockstyleset '..StartLockStyle)
  723.     end
  724.     -- End macro set / lockstyle section
  725. end
  726.  
  727. -- ===================================================================================================================
  728. --      Gearswap rules below this point - Modify at your own peril
  729. -- ===================================================================================================================
  730.  
  731. function pretarget(spell,action)
  732.     if not buffactive['Muddle'] then
  733.         -- Auto Remedy --
  734.         if AutoRemedy and (spell.action_type == 'Magic' or spell.type == 'JobAbility') then
  735.             if buffactive['Paralysis'] or (buffactive['Silence'] and not AutoEcho) then
  736.                 cancel_spell()
  737.                 send_command('input /item "Remedy" <me>')
  738.             end
  739.         end
  740.         -- Auto Echo Drop --
  741.         if AutoEcho and spell.action_type == 'Magic' and buffactive['Silence'] then
  742.             cancel_spell()
  743.             send_command('input /item "Echo Drops" <me>')
  744.         end
  745.     end
  746. end
  747.  
  748. function precast(spell)
  749.     if (pet.isvalid and pet_midaction() and not spell.type=="SummonerPact") or spell.type=="Item" then
  750.         -- Do not swap if pet is mid-action. I added the type=SummonerPact check because sometimes when the avatar
  751.         -- dies mid-BP, pet.isvalid and pet_midaction() continue to return true for a brief time.
  752.         return
  753.     end
  754.     -- Spell fast cast
  755.     if sets.precast[spell.english] then
  756.         equip(sets.precast[spell.english])
  757.     elseif spell.action_type=="Magic" then
  758.         if spell.name=="Stoneskin" then
  759.             equip(sets.precast.FC,{waist="Siegel Sash"})
  760.         else
  761.             equip(sets.precast.FC)
  762.         end
  763.     end
  764. end
  765.  
  766. function midcast(spell)
  767.     if (pet.isvalid and pet_midaction()) or spell.type=="Item" then
  768.         return
  769.     end
  770.     -- BP Timer gear needs to swap here
  771.     if (spell.type=="BloodPactWard" or spell.type=="BloodPactRage") then
  772.         if not buffactive["Astral Conduit"] then
  773.             equip(sets.midcast.BP)
  774.         end
  775.         -- If lag compensation mode is on, set up a timer to equip the BP gear.
  776.         if LagMode then
  777.             send_command('wait 0.5;gs c EquipBP '..spell.name)
  778.         end
  779.     -- Spell Midcast & Potency Stuff
  780.     elseif sets.midcast[spell.english] then
  781.         equip(sets.midcast[spell.english])
  782.     elseif spell.name=="Elemental Siphon" then
  783.         if pet.element==world.day_element and ZodiacElements:contains(pet.element) then
  784.             if pet.element==world.weather_element then
  785.                 equip(sets.midcast.SiphonWeatherZodiac)
  786.             else
  787.                 equip(sets.midcast.SiphonZodiac)
  788.             end
  789.         else
  790.             if pet.element==world.weather_element then
  791.                 equip(sets.midcast.SiphonWeather)
  792.             else
  793.                 equip(sets.midcast.Siphon)
  794.             end
  795.         end
  796.     elseif spell.type=="SummonerPact" then
  797.         equip(sets.midcast.Summon)
  798.     elseif string.find(spell.name,"Cure") or string.find(spell.name,"Curaga") then
  799.         equip(sets.midcast.Cure)
  800.     elseif string.find(spell.name,"Protect") or string.find(spell.name,"Shell") then
  801.         equip(sets.midcast.Enhancing,{ring2="Sheltered Ring"})
  802.     elseif spell.skill=="Enfeebling Magic" then
  803.         equip(sets.midcast.Enfeeble)
  804.     elseif spell.skill=="Enhancing Magic" then
  805.         equip(sets.midcast.Enhancing)
  806.     elseif spell.skill=="Elemental Magic" then
  807.         equip(sets.midcast.Nuke)
  808.     elseif spell.action_type=="Magic" then
  809.         equip(sets.midcast.EnmityRecast)
  810.     else
  811.         idle()
  812.     end
  813.     -- Treasure Hunter
  814.     if THSpells:contains(spell.name) then
  815.         equip(sets.TH)
  816.     end
  817.     -- Auto-cancel existing buffs
  818.     if spell.name=="Stoneskin" and buffactive["Stoneskin"] then
  819.         windower.send_command('cancel 37;')
  820.     elseif spell.name=="Sneak" and buffactive["Sneak"] and spell.target.type=="SELF" then
  821.         windower.send_command('cancel 71;')
  822.     elseif spell.name=="Utsusemi: Ichi" and buffactive["Copy Image"] then
  823.         windower.send_command('wait 1;cancel 66;')
  824.     end
  825. end
  826.  
  827. function aftercast(spell)
  828.     if pet_midaction() or spell.type=="Item" then
  829.         return
  830.     end
  831.     if not string.find(spell.type,"BloodPact") then
  832.         idle()
  833.     end
  834. end
  835.  
  836. function pet_change(pet,gain)
  837.     if (not (gain and pet_midaction())) then
  838.         idle()
  839.     end
  840. end
  841.  
  842. function status_change(new,old)
  843.     if new=="Idle" then
  844.         idle()
  845.     end
  846. end
  847.  
  848. function buff_change(name,gain)
  849.     if name=="quickening" then
  850.         idle()
  851.     end
  852.     if SacTorque and name=="sleep" and gain and pet.isvalid then
  853.         equip({neck="Sacrifice Torque"})
  854.         disable("neck")
  855.         if buffactive["Stoneskin"] then
  856.             windower.send_command('cancel 37;')
  857.         end
  858.     end
  859.     if name=="sleep" and not gain then
  860.         enable("neck")
  861.     end
  862. end
  863.  
  864. function pet_midcast(spell)
  865.     if not LagMode then
  866.         equipBPGear(spell.name)
  867.     end
  868. end
  869.  
  870. function pet_aftercast(spell)
  871.     idle()
  872. end
  873.  
  874. function equipBPGear(spell)
  875.     if spell=="Perfect Defense" then
  876.         equip(sets.pet_midcast.SummoningMagic)
  877.     elseif Debuff_BPs:contains(spell) then
  878.         equip(sets.pet_midcast.MagicAcc_BP)
  879.     elseif Buff_BPs_Healing:contains(spell) then
  880.         equip(sets.pet_midcast.Buff_Healing)
  881.     elseif Buff_BPs_Duration:contains(spell) then
  882.         equip(sets.pet_midcast.Buff)
  883.     elseif Buff_BPs_MND:contains(spell) then
  884.         equip(sets.pet_midcast.Buff_MND)
  885.     elseif spell=="Flaming Crush" then
  886.         if AccMode then
  887.             equip(sets.pet_midcast.FlamingCrush_Acc)
  888.         else
  889.             equip(sets.pet_midcast.FlamingCrush)
  890.         end
  891.     elseif ImpactDebuff and (spell=="Impact" or spell=="Conflag Strike") then
  892.         equip(sets.pet_midcast.Impact)
  893.     elseif Magic_BPs_NoTP:contains(spell) then
  894.         if AccMode then
  895.             equip(sets.pet_midcast.Magic_BP_NoTP_Acc)
  896.         else
  897.             equip(sets.pet_midcast.Magic_BP_NoTP)
  898.         end
  899.     elseif Magic_BPs_TP:contains(spell) or string.find(spell," II") or string.find(spell," IV") then
  900.         if AccMode then
  901.             equip(sets.pet_midcast.Magic_BP_TP_Acc)
  902.         else
  903.             equip(sets.pet_midcast.Magic_BP_TP)
  904.         end
  905.     elseif Merit_BPs:contains(spell) then
  906.         if AccMode then
  907.             equip(sets.pet_midcast.Magic_BP_TP_Acc)
  908.         elseif spell=="Meteor Strike" and MeteorStrike>4 then
  909.             equip(sets.pet_midcast.Magic_BP_NoTP)
  910.         elseif spell=="Geocrush" and Geocrush>4 then
  911.             equip(sets.pet_midcast.Magic_BP_NoTP)
  912.         elseif spell=="Grand Fall" and GrandFall>4 then
  913.             equip(sets.pet_midcast.Magic_BP_NoTP)
  914.         elseif spell=="Wind Blade" and WindBlade>4 then
  915.             equip(sets.pet_midcast.Magic_BP_NoTP)
  916.         elseif spell=="Heavenly Strike" and HeavenlyStrike>4 then
  917.             equip(sets.pet_midcast.Magic_BP_NoTP)
  918.         elseif spell=="Thunderstorm" and Thunderstorm>4 then
  919.             equip(sets.pet_midcast.Magic_BP_NoTP)
  920.         else
  921.             equip(sets.pet_midcast.Magic_BP_TP)
  922.         end
  923.     elseif Debuff_Rage_BPs:contains(spell) then
  924.         equip(sets.pet_midcast.Debuff_Rage)
  925.     else
  926.         if AccMode then
  927.             equip(sets.pet_midcast.Physical_BP_Acc)
  928.         elseif Physical_BPs_TP:contains(spell) then
  929.             equip(sets.pet_midcast.Physical_BP_TP)
  930.         elseif buffactive["Aftermath: Lv.3"] then
  931.             equip(sets.pet_midcast.Physical_BP_AM3)
  932.         else
  933.             equip(sets.pet_midcast.Physical_BP)
  934.         end
  935.     end
  936. end
  937.  
  938. -- This command is called whenever you input "gs c <command>"
  939. function self_command(command)
  940.     IdleModeCommands = {'DD','Refresh','DT','Favor','PetDT','Zendik'}
  941.     is_valid = command:lower()=="idle"
  942.    
  943.     for _, v in ipairs(IdleModeCommands) do
  944.         if command:lower()==v:lower() then
  945.             IdleMode = v
  946.             send_command('console_echo "Idle Mode: ['..IdleMode..']"')
  947.             idle()
  948.             return
  949.         end
  950.     end
  951.     if string.sub(command,1,7)=="EquipBP" then
  952.         equipBPGear(string.sub(command,9,string.len(command)))
  953.         return
  954.     elseif command:lower()=="accmode" then
  955.         AccMode = AccMode==false
  956.         is_valid = true
  957.         send_command('console_echo "AccMode: '..tostring(AccMode)..'"')
  958.     elseif command:lower()=="impactmode" then
  959.         ImpactDebuff = ImpactDebuff==false
  960.         is_valid = true
  961.         send_command('console_echo "Impact Debuff: '..tostring(ImpactDebuff)..'"')
  962.     elseif command:lower()=="forceilvl" then
  963.         ForceIlvl = ForceIlvl==false
  964.         is_valid = true
  965.         send_command('console_echo "Force iLVL: '..tostring(ForceIlvl)..'"')
  966.     elseif command:lower()=="lagmode" then
  967.         LagMode = LagMode==false
  968.         is_valid = true
  969.         send_command('console_echo "Lag Compensation Mode: '..tostring(LagMode)..'"')
  970.     elseif command:lower()=="th" then
  971.         TreasureHunter = TreasureHunter==false
  972.         is_valid = true
  973.         send_command('console_echo "Treasure Hunter Mode: '..tostring(TreasureHunter)..'"')
  974.     elseif command:lower()=="meleemode" then
  975.         if MeleeMode then
  976.             MeleeMode = false
  977.             enable("main","sub")
  978.             send_command('console_echo "Melee Mode: false"')
  979.         else
  980.             MeleeMode = true
  981.             equip({main="Nirvana",sub="Elan Strap +1"})
  982.             disable("main","sub")
  983.             send_command('console_echo "Melee Mode: true"')
  984.         end
  985.         is_valid = true
  986.     elseif command=="ToggleIdle" then
  987.         is_valid = true
  988.         -- If you want to change the sets cycled with F9, this is where you do it
  989.         if IdleMode=="Refresh" then
  990.             IdleMode = "DT"
  991.         elseif IdleMode=="DT" then
  992.             IdleMode = "PetDT"
  993.         elseif IdleMode=="PetDT" then
  994.             IdleMode = "DD"
  995.         else
  996.             IdleMode = "Refresh"
  997.         end
  998.         send_command('console_echo "Idle Mode: ['..IdleMode..']"')
  999.     elseif command:lower()=="lowhp" then
  1000.         -- Use for "Cure 500 HP" objectives in Omen
  1001.         equip({head="Apogee Crown +1",body={ name="Apo. Dalmatica +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},legs="Apogee Slacks +1",feet="Apogee Pumps +1",back="Campestres's Cape"})
  1002.         return
  1003.     elseif string.sub(command:lower(),1,12)=="meteorstrike" then
  1004.         MeteorStrike = string.sub(command,13,13)
  1005.         send_command('console_echo "Meteor Strike: '..MeteorStrike..'/5"')
  1006.         is_valid = true
  1007.     elseif string.sub(command:lower(),1,8)=="geocrush" then
  1008.         Geocrush = string.sub(command,9,9)
  1009.         send_command('console_echo "Geocrush: '..Geocrush..'/5"')
  1010.         is_valid = true
  1011.     elseif string.sub(command:lower(),1,9)=="grandfall" then
  1012.         GrandFall = string.sub(command,10,10)
  1013.         send_command('console_echo "Grand Fall: '..GrandFall..'/5"')
  1014.         is_valid = true
  1015.     elseif string.sub(command:lower(),1,9)=="windblade" then
  1016.         WindBlade = +string.sub(command,10,10)
  1017.         send_command('console_echo "Wind Blade: '..WindBlade..'/5"')
  1018.         is_valid = true
  1019.     elseif string.sub(command:lower(),1,14)=="heavenlystrike" then
  1020.         HeavenlyStrike = string.sub(command,15,15)
  1021.         send_command('console_echo "Heavenly Strike: '..HeavenlyStrike..'/5"')
  1022.         is_valid = true
  1023.     elseif string.sub(command:lower(),1,12)=="thunderstorm" then
  1024.         Thunderstorm = string.sub(command,13,13)
  1025.         send_command('console_echo "Thunderstorm: '..Thunderstorm..'/5"')
  1026.         is_valid = true
  1027.     end
  1028.  
  1029.     if is_valid then
  1030.         if not midaction() and not pet_midaction() then
  1031.             idle()
  1032.         end
  1033.     else
  1034.         sanitized = command:gsub("\"", "")
  1035.         send_command('console_echo "Invalid self_command: '..sanitized..'"')
  1036.     end
  1037. end
  1038.  
  1039. -- This function is for returning to aftercast gear after an action/event.
  1040. function idle()
  1041.     --if TownIdle:contains(world.area:lower()) then
  1042.     --  return
  1043.     --end
  1044.     if pet.isvalid then
  1045.         if IdleMode=='DT' then
  1046.             equip(sets.aftercast.Perp_DT)
  1047.         elseif string.find(pet.name,'Spirit') then
  1048.             equip(sets.aftercast.Spirit)
  1049.         elseif IdleMode=='PetDT' then
  1050.             if ForceIlvl then
  1051.                 equip(sets.aftercast.Avatar_DT_Ilvl)
  1052.             else
  1053.                 equip(sets.aftercast.Avatar_DT)
  1054.             end
  1055.         elseif IdleMode=='Refresh' then
  1056.             if player.mpp < 50 then
  1057.                 equip(sets.aftercast.Perp_RefreshSub50)
  1058.             else
  1059.                 equip(sets.aftercast.Perp_Refresh)
  1060.             end
  1061.         elseif IdleMode=='Favor' then
  1062.             equip(sets.aftercast.Perp_Favor)
  1063.         elseif IdleMode=='Zendik' then
  1064.             equip(sets.aftercast.Perp_Zendik)
  1065.         elseif MeleeMode then
  1066.             equip(sets.aftercast.Perp_Melee)
  1067.         elseif IdleMode=='DD' then
  1068.             equip(sets.aftercast.Perp_DD)
  1069.         end
  1070.         -- Gaiters if Fleet Wind is up
  1071.         if buffactive['Quickening'] and IdleMode~='DT' and not ForceIlvl then
  1072.             equip({feet="Herald's Gaiters"})
  1073.         end
  1074.     else
  1075.         if IdleMode=='DT' then
  1076.             equip(sets.aftercast.DT)
  1077.         elseif MeleeMode and IdleMode=='DD' then
  1078.             equip(sets.aftercast.Perp_Melee)
  1079.         elseif ForceIlvl then
  1080.             equip(sets.aftercast.Idle_Ilvl)
  1081.         else
  1082.             equip(sets.aftercast.Idle)
  1083.         end
  1084.     end
  1085.     -- Balrahn's Ring
  1086.     --if Salvage:contains(world.area) then
  1087.     --  equip({ring2="Balrahn's Ring"})
  1088.     --end
  1089.     -- Maquette Ring
  1090.     --if world.area=='Maquette Abdhaljs-Legion' and not IdleMode=='DT' then
  1091.     --  equip({ring2="Maquette Ring"})
  1092.     --end
  1093. end
RAW Paste Data