Pergatory

Pergatory's SMN Gearswap

Jan 27th, 2017 (edited)
25,963
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 56.53 KB | None | 0 0
  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 out-of-the-box 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 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. -- You can add your own modes in the IdleModes list, just make sure to add corresponding sets as well.
  12.  
  13. -- Additional Bindings:
  14. -- F9 - Toggles between a subset of IdleModes (Refresh > DT > PetDT)
  15. -- Ctrl+F9 - Toggles WeaponLock (When enabled, equips Nirvana and Elan+1, then disables those 2 slots from swapping)
  16. --       NOTE: If you don't already have the Nirvana & Elan+1 equipped, YOU WILL LOSE TP
  17.  
  18. -- Additional Commands:
  19. -- /console gs c AccMode - Toggles high-accuracy sets to be used where appropriate.
  20. -- /console gs c ImpactMode - Toggles between using normal magic BP set for Fenrir's Impact or a custom high-skill set for debuffs.
  21. -- /console gs c ForceIlvl - I have this set up to override a few specific slots where I normally use non-ilvl pieces.
  22. -- /console gs c TH - Treasure Hunter toggle. By default, this is only used for Dia, Dia II, and Diaga.
  23. -- /console gs c LagMode - Used to help BPs land in the right gear in high-lag situations.
  24. --                          Sets a timer to swap gear 0.5s after the BP is used rather than waiting for server response.
  25.  
  26. function file_unload()
  27.     send_command('unbind f9')
  28.     send_command('unbind f11')
  29.     send_command('unbind ^f9')
  30.     send_command('unbind ^f10')
  31.     enable("main","sub","range","ammo","head","neck","ear1","ear2","body","hands","ring1","ring2","back","waist","legs","feet")
  32. end
  33.  
  34. function get_sets()
  35.     enable("main","sub","range","ammo","head","neck","ear1","ear2","body","hands","ring1","ring2","back","waist","legs","feet")
  36.     -- Binding shorthand: ^ = Ctrl, ! = Alt, ~ = Shift, @ = Win, # = Apps
  37.     send_command('bind f9 gs c ToggleIdle') -- F9 = Cycle through commonly used idle modes
  38.     send_command('bind f11 gs c ForceIlvl') -- Ctrl+F9 = Toggle ForceIlvl
  39.     send_command('bind ^f9 gs c WeaponLock') -- F10 = Toggle Melee Mode
  40.     send_command('bind ^f10 gs c TH') -- Ctrl+F10 = Treasure Hunter toggle
  41.  
  42.     -- Set your merits here. This is used in deciding between Enticer's Pants or Apogee Slacks +1.
  43.     -- To change in-game, "/console gs c MeteorStrike3" will change Meteor Strike to 3/5 merits.
  44.     -- The damage difference is very minor unless you're over 2400 TP.
  45.     -- It's ok to just always use Enticer's Pants and ignore this section.
  46.     MeteorStrike = 1
  47.     HeavenlyStrike = 1
  48.     WindBlade = 1
  49.     Geocrush = 1
  50.     Thunderstorm = 5
  51.     GrandFall = 1
  52.  
  53.     StartLockStyle = '85'
  54.     IdleMode = 'Refresh'
  55.     AccMode = false
  56.     ImpactDebuff = false
  57.     WeaponLock = false
  58.     TreasureHunter = false
  59.     Empy = false -- Empy toggle for Wards. I use this set in V25s to try for a chance at a ward that lasts the whole fight.
  60.     THSpells = S{"Dia","Dia II","Diaga","Bio","Bio II"} -- If you want Treasure Hunter gear to swap for a spell/ability, add it here.
  61.     ForceIlvl = false
  62.     LagMode = false -- Default LagMode. If you have a lot of lag issues, change to "true".
  63.         -- Warning: LagMode can cause problems if you spam BPs during Conduit because it doesn't trust server packets to say whether the BP is readying or not.
  64.     SacTorque = true -- If you have Sacrifice Torque, this will auto-equip it when slept in order to wake up.
  65.     AutoRemedy = false -- Auto Remedy when using an ability while Paralyzed.
  66.     AutoEcho = false -- Auto Echo Drop when using an ability while Silenced.
  67.     TestMode = false
  68.  
  69.     -- Add idle modes here if you need more options for your sets
  70.     IdleModes = {'Refresh','DT','DD','PetDT','PetDD','Favor','Zendik','MEva','Enspell','Kite','MDB','Move'}
  71.    
  72.     -- Custom idle modes - If you want toggles that change the normal behavior you can add them here.
  73.     -- For example when I lock Opashoro, I lose the perp down of Nirvana and my sets need to compensate, so I added a custom mode for it.
  74.     -- "/console gs c Custom <mode>" to change mode, and append ".<mode>" to the end of the set name to use it in that mode.
  75.     CustomMode = 'None'
  76.     CustomModes = {'None','Opashoro'}
  77.  
  78.     -- ===================================================================================================================
  79.     --      Sets
  80.     -- ===================================================================================================================
  81.  
  82.     -- Base Damage Taken Set - Mainly used when IdleMode is "DT"
  83.     sets.DT_Base = {
  84.         main="Nirvana",
  85.         sub="Oneiros Grip",
  86.         ammo="Epitaph",
  87.         head="Beckoner's Horn +3",
  88.         neck="Summoner's Collar +2",
  89.         ear1="Cath Palug Earring",
  90.         ear2="Beckoner's Earring +1",
  91.         body="Beckoner's Doublet +3",
  92.         hands={ name="Merlinic Dastanas", augments={'Pet: Crit.hit rate +2','"Mag.Atk.Bns."+25','"Refresh"+2','Mag. Acc.+10 "Mag.Atk.Bns."+10',}},
  93.         ring1="Inyanga Ring",
  94.         ring2="Murky Ring",
  95.         back={ name="Campestres's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},
  96.         waist="Carrier's Sash",
  97.         legs="Inyanga Shalwar +2",
  98.         feet="Baayami Sabots +1"
  99.     }
  100.  
  101.     -- Treasure Hunter set. Don't put anything in here except TH+ gear.
  102.     -- It overwrites slots in other sets when TH toggle is on (Ctrl+F10).
  103.     sets.TH = {
  104.         head="Volte Cap",
  105.         waist="Chaac Belt",
  106.         body="Nyame Mail", -- Because otherwise Cohort Cloak and such mess up the swap
  107.         hands="Volte Bracers",
  108.         feet="Volte Boots"
  109.     }
  110.    
  111.     -- This gets equipped automatically when you have Sneak/Invis or Quickening such as from Fleet Wind.
  112.     sets.Movement = {
  113.         ring1="Shneddick Ring +1"
  114.         --feet="Herald's Gaiters"
  115.     }
  116.  
  117.     sets.precast = {}
  118.  
  119.     -- Fast Cast
  120.     sets.precast.FC = {
  121.         main={ name="Grioavolr", augments={'"Fast Cast"+6','INT+2','"Mag.Atk.Bns."+17',}}, -- +10
  122.         sub="Clerisy Strap +1", -- +3
  123.         --ammo="Sapience Orb",
  124.         head="Amalric Coif +1", -- +11
  125.         neck="Orunmila's Torque", -- +5
  126.         ear1="Malignance Earring", -- +4
  127.         ear2="Loquacious Earring", -- +2
  128.         hands={ name="Telchine Gloves", augments={'Mag. Evasion+25','"Fast Cast"+5','Enh. Mag. eff. dur. +10',}},
  129.         body="Inyanga Jubbah +2", -- +14
  130.         ring1="Lebeche Ring",
  131.         ring2="Kishar Ring", -- +4
  132.         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','Damage taken-5%',}},
  133.         waist="Witful Belt", -- +3
  134.         legs={ name="Merlinic Shalwar", augments={'"Fast Cast"+6','CHR+6','Mag. Acc.+14','"Mag.Atk.Bns."+14',}},
  135.         feet="Regal Pumps +1" -- +5~7
  136.     }
  137.  
  138.     sets.precast["Dispelga"] = set_combine(sets.precast.FC, {
  139.         main="Daybreak",
  140.         sub="Ammurapi Shield"
  141.     })
  142.  
  143.     sets.midcast = {}
  144.  
  145.     -- BP Timer Gear
  146.     -- Use BP Recast Reduction here, along with Avatar's Favor gear.
  147.     -- Avatar's Favor skill tiers are 512 / 575 / 670 / 735.
  148.     sets.midcast.BP = {
  149.         main={ name="Espiritus", augments={'Summoning magic skill +15','Pet: Mag. Acc.+30','Pet: Damage taken -4%',}},
  150.         sub="Vox Grip",
  151.         ammo="Sancus Sachet +1",
  152.         head="Beckoner's Horn +3", -- Always use Beckoner's Horn here.
  153.         neck="Hoxne Torque",
  154.         ear1="Cath Palug Earring",
  155.         ear2="Lodurr Earring",
  156.         body="Baayami Robe +1",
  157.         hands="Baayami Cuffs +1",
  158.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  159.         ring2="Evoker's Ring",
  160.         back={ name="Conveyance Cape", augments={'Summoning magic skill +5','Pet: Enmity+12','Blood Pact Dmg.+2',}},
  161.         waist="Kobo Obi",
  162.         legs="Baayami Slops +1",
  163.         feet="Baayami Sabots +1"
  164.     }
  165.    
  166.     -- Shock Squall is too fast to swap gear in pet_midcast() or otherwise. It'll generally land in your BP timer set.
  167.     -- I settle for the 670-skill favor tier so I can fit more Pet:MAcc, credit to Papesse of Carbuncle for suggesting this compromise
  168.     sets.midcast.BP["Shock Squall"] = set_combine(sets.midcast.BP, {
  169.         neck="Summoner's Collar +2",
  170.         ear1="Enmerkar Earring",
  171.         ear2="Lugalbanda Earring",
  172.         ring1="Cath Palug Ring",
  173.         ring2="Fickblix's Ring",
  174.         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','Damage taken-5%',}},
  175.         waist="Incarnation Sash",
  176.     })
  177.  
  178.     -- Elemental Siphon sets. Zodiac Ring is affected by day, Chatoyant Staff by weather, and Twilight Cape by both.
  179.     sets.midcast.Siphon = {
  180.         main={ name="Espiritus", augments={'Summoning magic skill +15','Pet: Mag. Acc.+30','Pet: Damage taken -4%',}},
  181.         sub="Vox Grip",
  182.         ammo="Esper Stone +1",
  183.         head="Baayami Hat +1",
  184.         neck="Hoxne Torque",
  185.         ear1="Cath Palug Earring",
  186.         ear2="Lodurr Earring",
  187.         body="Baayami Robe +1",
  188.         hands="Baayami Cuffs +1",
  189.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  190.         ring2="Evoker's Ring",
  191.         back={ name="Conveyance Cape", augments={'Summoning magic skill +5','Pet: Enmity+12','Blood Pact Dmg.+2',}},
  192.         waist="Kobo Obi",
  193.         legs="Baayami Slops +1",
  194.         feet="Beckoner's Pigaches +3"
  195.     }
  196.  
  197.     sets.midcast.SiphonZodiac = set_combine(sets.midcast.Siphon, { ring1="Zodiac Ring" })
  198.  
  199.     sets.midcast.SiphonWeather = set_combine(sets.midcast.Siphon, { main="Chatoyant Staff" })
  200.    
  201.     sets.midcast.SiphonWeatherZodiac = set_combine(sets.midcast.SiphonZodiac, { main="Chatoyant Staff" })
  202.  
  203.     -- Summoning Midcast, cap spell interruption if possible (Baayami Robe gives 100, need 2 more)
  204.     -- PDT isn't a bad idea either, so don't overwrite a lot from the DT set it inherits from.
  205.     sets.midcast.Summon = set_combine(sets.DT_Base, {
  206.         body="Baayami Robe +1",
  207.         legs="Bunzi's Pants",
  208.     })
  209.  
  210.     -- If you ever lock your weapon, keep that in mind when building cure potency set.
  211.     sets.midcast.Cure = {
  212.         main="Nirvana",
  213.         sub="Clerisy Strap +1",
  214.         head={ name="Vanya Hood", augments={'MP+50','"Cure" potency +7%','Enmity-6',}},
  215.         neck="Orunmila's Torque",
  216.         ear1="Meili Earring",
  217.         ear2="Novia Earring",
  218.         body="Zendik Robe",
  219.         hands={ name="Telchine Gloves", augments={'Mag. Evasion+25','"Fast Cast"+5','Enh. Mag. eff. dur. +10',}},
  220.         ring1="Lebeche Ring",
  221.         ring2="Menelaus's Ring",
  222.         back="Tempered Cape +1",
  223.         waist="Luminary Sash",
  224.         legs="Beckoner's Spats +3",
  225.         feet={ name="Vanya Clogs", augments={'MP+50','"Cure" potency +7%','Enmity-6',}}
  226.     }
  227.  
  228.     sets.midcast.Cursna = set_combine(sets.precast.FC, {
  229.         neck="Debilis Medallion",
  230.         ear1="Meili Earring",
  231.         ear2="Beatific Earring",
  232.         ring1="Menelaus's Ring",
  233.         ring2="Haoma's Ring",
  234.         back="Tempered Cape +1",
  235.         waist="Bishop's Sash",
  236.         feet={ name="Vanya Clogs", augments={'Healing magic skill +20','"Cure" spellcasting time -7%','Magic dmg. taken -3',}}
  237.     })
  238.    
  239.     -- Just a standard set for spells that have no set
  240.     sets.midcast.EnmityRecast = set_combine(sets.precast.FC, {
  241.         main="Nirvana",
  242.         ear1="Novia Earring",
  243.         body={ name="Apo. Dalmatica +1", augments={'Summoning magic skill +20','Enmity-6','Pet: Damage taken -4%',}}
  244.     })
  245.  
  246.     -- Strong alternatives: Daybreak and Ammurapi Shield, Cath Crown, Gwati Earring
  247.     sets.midcast.Enfeeble = {
  248.         main="Contemplator +1",
  249.         sub="Enki Strap",
  250.         head=empty,
  251.         neck="Null Loop",
  252.         ear1="Malignance Earring",
  253.         ear2="Dignitary's Earring",
  254.         body="Cohort Cloak +1",
  255.         hands="Inyanga Dastanas +2",
  256.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  257.         ring2={name="Stikini Ring +1", bag="wardrobe4"},
  258.         back="Aurist's Cape +1",
  259.         waist="Null Belt",
  260.         legs="Inyanga Shalwar +2",
  261.         feet="Skaoi Boots"
  262.     }
  263.     sets.midcast.Enfeeble.INT = set_combine(sets.midcast.Enfeeble, {
  264.         waist="Acuity Belt +1"
  265.     })
  266.  
  267.     sets.midcast.Enhancing = {
  268.         main={ name="Gada", augments={'Enh. Mag. eff. dur. +6','DEX+1','Mag. Acc.+5','"Mag.Atk.Bns."+18','DMG:+4',}},
  269.         sub="Ammurapi Shield",
  270.         head={ name="Telchine Cap", augments={'Mag. Evasion+24','"Conserve MP"+4','Enh. Mag. eff. dur. +10',}},
  271.         neck="Hoxne Torque",
  272.         ear1="Mimir Earring",
  273.         ear2="Andoaa Earring",
  274.         body={ name="Telchine Chas.", augments={'Mag. Evasion+25','"Conserve MP"+5','Enh. Mag. eff. dur. +10',}},
  275.         hands={ name="Telchine Gloves", augments={'Mag. Evasion+25','"Fast Cast"+5','Enh. Mag. eff. dur. +10',}},
  276.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  277.         ring2={name="Stikini Ring +1", bag="wardrobe4"},
  278.         back="Merciful Cape",
  279.         waist="Embla Sash",
  280.         legs={ name="Telchine Braconi", augments={'Mag. Evasion+25','"Conserve MP"+4','Enh. Mag. eff. dur. +10',}},
  281.         feet={ name="Telchine Pigaches", augments={'Mag. Evasion+24','"Conserve MP"+3','Enh. Mag. eff. dur. +10',}}
  282.     }
  283.  
  284.     sets.midcast.Stoneskin = set_combine(sets.midcast.Enhancing, {
  285.         neck="Nodens Gorget",
  286.         ear2="Earthcry Earring",
  287.         waist="Siegel Sash",
  288.         --legs="Shedir Seraweels"
  289.     })
  290.  
  291.     -- Alternatives: Cath Palug Crown, Amalric gear, Sanctity Necklace, Eschan Stone
  292.     sets.midcast.Nuke = {
  293.         main="Opashoro",
  294.         sub="Enki Strap",
  295.         head="Bunzi's Hat",
  296.         neck="Sibyl Scarf",
  297.         ear1="Malignance Earring",
  298.         ear2="Friomisi Earring",
  299.         body={ name="Amalric Doublet +1", augments={'MP+80','Mag. Acc.+20','"Mag.Atk.Bns."+20',}},
  300.         hands="Bunzi's Gloves",
  301.         ring1="Freke Ring",
  302.         ring2="Metamorph Ring +1",
  303.         back={ name="Campestres's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},
  304.         waist="Acuity Belt +1",
  305.         legs="Bunzi's Pants",
  306.         feet="Bunzi's Sabots"
  307.     }
  308.  
  309.     sets.midcast["Refresh"] = set_combine(sets.midcast.Enhancing, {
  310.         head="Amalric Coif +1",
  311.         waist="Gishdubar Sash"
  312.     })
  313.  
  314.     sets.midcast["Aquaveil"] = set_combine(sets.midcast.Enhancing, {
  315.         main="Vadose Rod",
  316.         head="Amalric Coif +1",
  317.         hands="Regal Cuffs",
  318.         waist="Emphatikos Rope",
  319.     })
  320.  
  321.     sets.midcast["Dispelga"] = set_combine(sets.midcast.Enfeeble, {
  322.         main="Daybreak",
  323.         sub="Ammurapi Shield"
  324.     })
  325.  
  326.     sets.midcast["Mana Cede"] = { hands="Beckoner's Bracers +3" }
  327.  
  328.     sets.midcast["Astral Flow"] = { head="Glyphic Horn +4" }
  329.    
  330.     -- ===================================================================================================================
  331.     --  Weaponskills
  332.     -- ===================================================================================================================
  333.  
  334.     -- Base weaponskill set, used when you don't have a specific set for the weaponskill.
  335.     sets.Weaponskill = {
  336.         head="Nyame Helm",
  337.         neck="Fotia Gorget",
  338.         ear1="Malignance Earring",
  339.         ear2="Crepuscular Earring",
  340.         body="Nyame Mail",
  341.         hands="Nyame Gauntlets",
  342.         ring1="Epaminondas's Ring",
  343.         ring2="Metamorph Ring +1",
  344.         back="Aurist's Cape +1",
  345.         waist="Fotia Belt",
  346.         legs="Nyame Flanchard",
  347.         feet="Nyame Sollerets"
  348.     }
  349.  
  350.     -- It's ok to just target accuracy & magic accuracy for this set, and use it to get AM3, apply defense down, and/or open skillchains.
  351.     sets.midcast["Garland of Bliss"] = set_combine(sets.Weaponskill, {
  352.         neck="Sanctity Necklace",
  353.         ear2="Friomisi Earring",
  354.         waist="Orpheus's Sash",
  355.     })
  356.  
  357.     -- Shattersoul is a good weaponskill for skillchaining with Ifrit. If that's your intent, I suggest stacking accuracy.
  358.     -- If you have access to Oshala, that's generally a better use.
  359.     sets.midcast["Shattersoul"] = set_combine(sets.Weaponskill, {
  360.         head="Beckoner's Horn +3",
  361.         ear1="Zennaroi Earring",
  362.         ear2="Telos Earring",
  363.         body="Tali'ah Manteel +2",
  364.         hands="Beckoner's Bracers +3",
  365.         back={ name="Campestres's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10','Phys. dmg. taken-10%',}},
  366.         waist="Fotia Belt",
  367.         feet="Beckoner's Pigaches +3"
  368.     })
  369.  
  370.     sets.midcast["Cataclysm"] = set_combine(sets.midcast["Garland of Bliss"], {})
  371.    
  372.     -- Magic accuracy here to land defense down
  373.     sets.midcast["Shell Crusher"] = set_combine(sets.Weaponskill, {
  374.         head="Beckoner's Horn +3",
  375.         neck="Sanctity Necklace",
  376.         ear1="Dignitary's Earring",
  377.         body="Beckoner's Doublet +3",
  378.         hands="Beckoner's Bracers +3",
  379.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  380.         back={ name="Campestres's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10','Phys. dmg. taken-10%',}},
  381.         waist="Null Belt",
  382.         feet="Beckoner's Pigaches +3",
  383.     })
  384.    
  385.     sets.midcast["Black Halo"] = set_combine(sets.Weaponskill, {
  386.         neck="Republican Platinum Medal",
  387.         waist="Grunfeld Rope",
  388.     })
  389.    
  390.     sets.midcast["Oshala"] = set_combine(sets.Weaponskill, {
  391.         ear2="Telos Earring",
  392.         neck="Shulmanu Collar",
  393.         ring1="Epaminondas's Ring",
  394.         ring2="Metamorph Ring +1",
  395.         waist="Acuity Belt +1",
  396.     })
  397.    
  398.     sets.midcast["Rock Crusher"] = {    -- Low damage set used for SC in Omen (Punch>Rock Crusher)
  399.         head="Baayami Hat +1",
  400.         body="Baayami Robe +1",
  401.         hands="Baayami Cuffs +1",
  402.         legs="Baayami Slops +1",
  403.         feet="Baayami Sabots +1"
  404.     }
  405.  
  406.     sets.pet_midcast = {}
  407.  
  408.     -- Main physical pact set (Volt Strike, Pred Claws, etc.)
  409.     -- Prioritize BP Damage & Pet: Double Attack
  410.     -- Strong Alternatives:
  411.     --   Nirvana, Gridarvor, Apogee Crown/Pumps/Dalmatica, AF body/hands, Empy Feet, Shulmanu Collar (equal to ~R15 Collar),
  412.     --   Merlinic Dastanas or Helios Gloves (both equal to R20 Indomitable), Gelos Earring, Regal Belt, Varar Ring, Kyrene's Earring
  413.     -- I find that between the head, hands, and feet augments you generally want two attack and one accuracy. Helios are easiest to change.
  414.     sets.pet_midcast.Physical_BP = {
  415.         main="Opashoro",
  416.         sub="Elan Strap +1",
  417.         ammo="Epitaph",
  418.         head={ name="Helios Band", augments={'Pet: Attack+30 Pet: Rng.Atk.+30','Pet: "Dbl. Atk."+8','Blood Pact Dmg.+7',}},
  419.         neck="Summoner's Collar +2",
  420.         ear1="Lugalbanda Earring",
  421.         ear2="Sroda Earring",
  422.         body="Glyphic Doublet +4",
  423.         hands="Indomitable Gloves",
  424.         ring1="Cath Palug Ring",
  425.         ring2="Fickblix's Ring",
  426.         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%',}},
  427.         waist="Incarnation Sash",
  428.         legs={ name="Apogee Slacks +1", augments={'Pet: STR+20','Blood Pact Dmg.+14','Pet: "Dbl. Atk."+4',}},
  429.         feet={ name="Helios Boots", augments={'Pet: Attack+30 Pet: Rng.Atk.+30','Pet: "Dbl. Atk."+8','Blood Pact Dmg.+7',}}
  430.     }
  431.  
  432.     -- Physical Pact AM3 set, less emphasis on Pet:DA (can use the calculator on my Pastebin to fine tune BP Dmg versus Pet:DA)
  433.     -- Indomitable Gloves generally surpasses well-augmented Merlinic only at max rank (R30)
  434.     sets.pet_midcast.Physical_BP_AM3 = set_combine(sets.pet_midcast.Physical_BP, {
  435.         body="Convoker's Doublet +4",
  436.         ring1="Varar Ring +1",
  437.         feet={ name="Apogee Pumps +1", augments={'MP+80','Pet: Attack+35','Blood Pact Dmg.+8',}}
  438.     })
  439.  
  440.     -- Physical pacts which benefit more from TP than Pet:DA (like Spinning Dive and other pacts you never use except that one time)
  441.     sets.pet_midcast.Physical_BP_TP = set_combine(sets.pet_midcast.Physical_BP, {
  442.         head={ name="Apogee Crown +1", augments={'MP+80','Pet: Attack+35','Blood Pact Dmg.+8',}},
  443.         body="Convoker's Doublet +4",
  444.         hands={ name="Merlinic Dastanas", augments={'Pet: Attack+24 Pet: Rng.Atk.+24','Blood Pact Dmg.+9','Pet: STR+10','Pet: Mag. Acc.+7',}},
  445.         ring1="Varar Ring +1",
  446.         waist="Regal Belt",
  447.         legs="Enticer's Pants",
  448.         feet={ name="Apogee Pumps +1", augments={'MP+80','Pet: Attack+35','Blood Pact Dmg.+8',}}
  449.     })
  450.  
  451.     -- Used for all physical pacts when AccMode is true
  452.     sets.pet_midcast.Physical_BP_Acc = set_combine(sets.pet_midcast.Physical_BP, {
  453.         head={ name="Apogee Crown +1", augments={'MP+80','Pet: Attack+35','Blood Pact Dmg.+8',}},
  454.         ear2="Beckoner's Earring +1",
  455.         body="Convoker's Doublet +4",
  456.         feet="Beckoner's Pigaches +3"
  457.     })
  458.  
  459.     -- Base magic pact set
  460.     -- Prioritize BP Damage & Pet:MAB
  461.     -- Strong Alternatives:
  462.     -- Espiritus, Apogee Crown/Slacks, Adad Amulet (equal to ~R12 Collar), Gelos Earring, Sancus Sachet
  463.     sets.pet_midcast.Magic_BP_Base = {
  464.         main={ name="Grioavolr", augments={'Blood Pact Dmg.+10','Pet: STR+5','Pet: Mag. Acc.+18','Pet: "Mag.Atk.Bns."+25',}},
  465.         sub="Elan Strap +1",
  466.         ammo="Epitaph",
  467.         head="Cath Palug Crown",
  468.         neck="Summoner's Collar +2",
  469.         ear1="Lugalbanda Earring",
  470.         ear2="Beckoner's Earring +1",
  471.         body={ name="Apo. Dalmatica +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},
  472.         hands={ name="Merlinic Dastanas", augments={'Pet: Mag. Acc.+25 Pet: "Mag.Atk.Bns."+25','Blood Pact Dmg.+10','Pet: "Mag.Atk.Bns."+7',}},
  473.         ring1={name="Varar Ring +1", bag="wardrobe2"},
  474.         ring2="Fickblix's Ring",
  475.         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','Damage taken-5%',}},
  476.         waist="Regal Belt",
  477.         legs="Enticer's Pants",
  478.         feet={ name="Apogee Pumps +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}}
  479.     }
  480.    
  481.     -- Some magic pacts benefit more from TP than others.
  482.     -- Note: This set will only be used on merit pacts if you have less than 4 merits.
  483.     --       Make sure to update your merit values at the top of this Lua.
  484.     sets.pet_midcast.Magic_BP_TP = set_combine(sets.pet_midcast.Magic_BP_Base, {
  485.     })
  486.  
  487.     -- NoTP set used when you don't need Enticer's
  488.     sets.pet_midcast.Magic_BP_NoTP = set_combine(sets.pet_midcast.Magic_BP_Base, {
  489.         legs={ name="Apogee Slacks +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}}
  490.     })
  491.  
  492.     sets.pet_midcast.Magic_BP_TP_Acc = set_combine(sets.pet_midcast.Magic_BP_TP, {
  493.         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',}},
  494.         body="Convoker's Doublet +4",
  495.         hands={ name="Merlinic Dastanas", augments={'Pet: Mag. Acc.+29','Blood Pact Dmg.+10','Pet: INT+7','Pet: "Mag.Atk.Bns."+10',}}
  496.     })
  497.  
  498.     sets.pet_midcast.Magic_BP_NoTP_Acc = set_combine(sets.pet_midcast.Magic_BP_NoTP, {
  499.         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',}},
  500.         body="Convoker's Doublet +4",
  501.         hands={ name="Merlinic Dastanas", augments={'Pet: Mag. Acc.+29','Blood Pact Dmg.+10','Pet: INT+7','Pet: "Mag.Atk.Bns."+10',}}
  502.     })
  503.  
  504.     -- Favor BP Damage above all. Pet:MAB also very strong.
  505.     -- Pet: Accuracy, Attack, Magic Accuracy moderately important.
  506.     -- Strong Alternatives:
  507.     -- Nirvana, Keraunos, Grioavolr, Espiritus, Was, Apogee Crown, Apogee Dalmatica, Adad Amulet
  508.     sets.pet_midcast.FlamingCrush = {
  509.         main="Opashoro",
  510.         sub="Elan Strap +1",
  511.         ammo="Epitaph",
  512.         head="Cath Palug Crown",
  513.         neck="Summoner's Collar +2",
  514.         ear1="Lugalbanda Earring",
  515.         ear2="Beckoner's Earring +1",
  516.         body="Convoker's Doublet +4",
  517.         hands={ name="Merlinic Dastanas", augments={'Pet: Mag. Acc.+25 Pet: "Mag.Atk.Bns."+25','Blood Pact Dmg.+10','Pet: "Mag.Atk.Bns."+7',}},
  518.         ring1={name="Varar Ring +1", bag="wardrobe2"},
  519.         ring2="Fickblix's Ring",
  520.         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%',}},
  521.         waist="Regal Belt",
  522.         legs={ name="Apogee Slacks +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},
  523.         feet={ name="Apogee Pumps +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}}
  524.     }
  525.  
  526.     sets.pet_midcast.FlamingCrush_Acc = set_combine(sets.pet_midcast.FlamingCrush, {
  527.         hands="Indomitable Gloves",
  528.         feet="Beckoner's Pigaches +3"
  529.     })
  530.  
  531.     -- Pet: Magic Acc set - Mainly used for debuff pacts like Bitter Elegy
  532.     sets.pet_midcast.MagicAcc_BP = {
  533.         main="Opashoro",
  534.         sub="Vox Grip",
  535.         ammo="Epitaph",
  536.         head="Beckoner's Horn +3",
  537.         neck="Summoner's Collar +2",
  538.         ear1="Enmerkar Earring",
  539.         ear2="Lugalbanda Earring",
  540.         body="Beckoner's Doublet +3",
  541.         hands="Lamassu Mitts +1",
  542.         ring1="Cath Palug Ring",
  543.         ring2="Fickblix's Ring",
  544.         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','Damage taken-5%',}},
  545.         waist="Incarnation Sash",
  546.         legs="Beckoner's Spats +3",
  547.         feet="Bunzi's Sabots"
  548.     }
  549.  
  550.     sets.pet_midcast.Debuff_Rage = sets.pet_midcast.MagicAcc_BP
  551.  
  552.     -- Pure summoning magic set, mainly used for buffs like Hastega II.
  553.     -- Strong Alternatives:
  554.     -- Andoaa Earring, Summoning Earring, Lamassu Mitts +1, Caller's Pendant
  555.     sets.pet_midcast.SummoningMagic = {
  556.         main={ name="Espiritus", augments={'Summoning magic skill +15','Pet: Mag. Acc.+30','Pet: Damage taken -4%',}},
  557.         sub="Vox Grip",
  558.         ammo="Epitaph",
  559.         head="Baayami Hat +1",
  560.         neck="Hoxne Torque",
  561.         ear1="Cath Palug Earring",
  562.         ear2="Lodurr Earring",
  563.         body="Baayami Robe +1",
  564.         hands="Baayami Cuffs +1",
  565.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  566.         ring2="Evoker's Ring",
  567.         back={ name="Conveyance Cape", augments={'Summoning magic skill +5','Pet: Enmity+12','Blood Pact Dmg.+2',}},
  568.         waist="Kobo Obi",
  569.         legs="Baayami Slops +1",
  570.         feet="Baayami Sabots +1"
  571.     }
  572.  
  573.     sets.pet_midcast.Buff = set_combine(sets.pet_midcast.SummoningMagic, {})
  574.    
  575.     -- Super optional set. I use it in 15-minute Odyssey fights where a proc at the start would save me from having to reapply it.
  576.     sets.pet_midcast.Buff.Empy = set_combine(sets.pet_midcast.Buff, {
  577.         head="Beckoner's Horn +3", -- 8
  578.         body="Beckoner's Doublet +3", -- 13
  579.         --hands="Beckoner's Bracers +3", -- 33
  580.         legs="Beckoner's Spats +3", -- 5
  581.         feet="Beckoner's Pigaches +3", -- 29
  582.     })
  583.    
  584.     -- Wind's Blessing set. Pet:MND increases potency.
  585.     sets.pet_midcast.Buff_MND = set_combine(sets.pet_midcast.Buff, {
  586.         main="Opashoro",
  587.         neck="Summoner's Collar +2",
  588.         ear2="Beckoner's Earring +1",
  589.         hands="Lamassu Mitts +1",
  590.         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%',}},
  591.         legs="Assiduity Pants +1",
  592.         feet="Bunzi's Sabots"
  593.     })
  594.  
  595.     -- Don't drop Avatar level in this set if you can help it.
  596.     -- You can use Avatar:HP+ gear to increase the HP recovered, but most of it will decrease your own max HP.
  597.     sets.pet_midcast.Buff_Healing = set_combine(sets.pet_midcast.Buff, {
  598.         main="Opashoro",
  599.         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%',}},
  600.         --body={ name="Apo. Dalmatica +1", augments={'Summoning magic skill +20','Enmity-6','Pet: Damage taken -4%',}},
  601.         --feet={ name="Apogee Pumps +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}}
  602.     })
  603.  
  604.     -- This set is used for certain blood pacts when ImpactDebuff mode is turned ON. (/console gs c ImpactDebuff)
  605.     -- These pacts are normally used with magic damage gear, but they're also strong debuffs when enhanced by summoning skill.
  606.     -- This set is safe to ignore.
  607.     sets.pet_midcast.Impact = set_combine(sets.pet_midcast.SummoningMagic, {
  608.         main="Opashoro",
  609.         head="Beckoner's Horn +3",
  610.         ear1="Enmerkar Earring",
  611.         ear2="Lugalbanda Earring",
  612.         hands="Lamassu Mitts +1"
  613.     })
  614.    
  615.     -- ===================================================================================================================
  616.     -- Aftercast Sets
  617.     -- ===================================================================================================================
  618.     -- Syntax: sets.aftercast.{IdleMode}.{PetName|Spirit|Avatar}.{PlayerStatus}.{LowMP}.{ForceIlvl}.{CustomMode}
  619.  
  620.     -- Example: sets.aftercast.DT["Cait Sith"] will be a set used when IdleMode is "DT" and you have Cait Sith summoned.
  621.  
  622.     -- This is your default idle gear used as a baseline for most idle sets below. Put gear here and you won't have to repeat it over and over.
  623.     -- I focus on refresh. Strong alternatives: Asteria Mitts, Convoker Horn, Shomonjijoe
  624.     sets.aftercast = {
  625.         main="Mpaca's Staff",
  626.         sub="Oneiros Grip",
  627.         ammo="Epitaph",
  628.         head="Beckoner's Horn +3",
  629.         neck="Loricate Torque +1",
  630.         ear1="Cath Palug Earring",
  631.         ear2="Beckoner's Earring +1",
  632.         body={ name="Apo. Dalmatica +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','Blood Pact Dmg.+8',}},
  633.         hands={ name="Merlinic Dastanas", augments={'Pet: Crit.hit rate +2','"Mag.Atk.Bns."+25','"Refresh"+2','Mag. Acc.+10 "Mag.Atk.Bns."+10',}},
  634.         ring1="Shneddick Ring +1",
  635.         --ring1={name="Stikini Ring +1", bag="wardrobe2"},
  636.         ring2="Murky Ring",
  637.         back={ name="Campestres's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},
  638.         waist="Regal Belt",
  639.         legs="Assiduity Pants +1",
  640.         --feet="Herald's Gaiters"
  641.         feet="Baayami Sabots +1"
  642.     }
  643.    
  644.     -- sets.aftercast.ForceIlvl = set_combine(sets.aftercast, {
  645.         -- feet="Baayami Sabots +1"
  646.     -- })
  647.     sets.aftercast.LowMP = set_combine(sets.aftercast, {
  648.         waist="Fucho-no-obi"
  649.     })
  650.     -- sets.aftercast.LowMP.ForceIlvl = set_combine(sets.aftercast.LowMP, {
  651.         -- feet="Baayami Sabots +1"
  652.     -- })
  653.    
  654.     -- Main perpetuation set ~~ Strong Alternatives:
  655.     -- Gridarvor, Asteria Mitts, Shomonjijoe, Convoker's Horn, Evans Earring, Isa Belt
  656.     sets.aftercast.Avatar = {
  657.         main="Nirvana",
  658.         sub="Oneiros Grip",
  659.         ammo="Epitaph",
  660.         head="Beckoner's Horn +3",
  661.         neck="Caller's Pendant",
  662.         ear1="Cath Palug Earring",
  663.         ear2="Beckoner's Earring +1",
  664.         body={ name="Apo. Dalmatica +1", augments={'Summoning magic skill +20','Enmity-6','Pet: Damage taken -4%',}},
  665.         hands={ name="Merlinic Dastanas", augments={'Pet: Crit.hit rate +2','"Mag.Atk.Bns."+25','"Refresh"+2','Mag. Acc.+10 "Mag.Atk.Bns."+10',}},
  666.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  667.         ring2="Evoker's Ring",
  668.         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%',}},
  669.         waist="Lucidity Sash",
  670.         legs="Assiduity Pants +1",
  671.         feet="Baayami Sabots +1"
  672.     }
  673.     -- If you have Fucho and don't need Lucidity Sash for perp down, you can uncomment the belt here to enable using it.
  674.     sets.aftercast.Avatar.LowMP = set_combine(sets.aftercast.Avatar, {
  675.         --waist="Fucho-no-obi"
  676.     })
  677.  
  678.     sets.aftercast.Avatar.Opashoro = set_combine(sets.aftercast.Avatar, {
  679.         body="Beckoner's Doublet +3",
  680.     })
  681.  
  682.     -- Damage Taken set
  683.     sets.aftercast.DT = set_combine(sets.DT_Base, {
  684.     })
  685.  
  686.     sets.aftercast.DT.Avatar = set_combine(sets.aftercast.DT, {
  687.         waist="Isa Belt"
  688.     })
  689.    
  690.     sets.aftercast.DT.Avatar.Opashoro = set_combine(sets.aftercast.DT.Avatar, {
  691.         feet="Beckoner's Pigaches +3"
  692.     })
  693.  
  694.     -- You aren't likely to be in PetDT mode without an avatar for long, but I default to the DT set in that scenario.
  695.     sets.aftercast.PetDT = set_combine(sets.aftercast.DT, { })
  696.  
  697.     -- Pet:DT build. Equipped when IdleMode is "PetDT".
  698.     -- Strong alternatives:
  699.     -- Selenian Cap, Enticer's Pants, Enmerkar Earring, Handler's Earring, Rimeice Earring, Tali'ah Seraweels
  700.     sets.aftercast.PetDT.Avatar = {
  701.         main="Nirvana",
  702.         sub="Oneiros Grip",
  703.         ammo="Epitaph",
  704.         head={ name="Apogee Crown +1", augments={'Pet: Accuracy+25','"Avatar perpetuation cost"+7','Pet: Damage taken -4%',}},
  705.         neck="Summoner's Collar +2",
  706.         ear1="Enmerkar Earring",
  707.         ear2="Beckoner's Earring +1",
  708.         body={ name="Apo. Dalmatica +1", augments={'Summoning magic skill +20','Enmity-6','Pet: Damage taken -4%',}},
  709.         hands={ name="Telchine Gloves", augments={'Pet: DEF+17','Pet: "Regen"+3','Pet: Damage taken -4%',}},
  710.         --ring1="Thurandaut Ring +1",
  711.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  712.         ring2={name="Stikini Ring +1", bag="wardrobe4"},
  713.         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%',}},
  714.         waist="Isa Belt",
  715.         legs="Bunzi's Pants",
  716.         feet={ name="Telchine Pigaches", augments={'Pet: DEF+14','Pet: "Regen"+3','Pet: Damage taken -4%',}}
  717.     }
  718.  
  719.     -- ===================================================================================================================
  720.     -- Sets below this point are extremely niche. If just getting set up, this is a good stopping point to save for later.
  721.    
  722.     -- Kite set. I just use this to gather up mobs in Escha Ru'Aun for merit farming.
  723.     sets.aftercast.Kite = set_combine(sets.aftercast.DT, sets.Movement)
  724.     sets.aftercast.Kite.Avatar = set_combine(sets.aftercast.DT.Avatar, sets.Movement)
  725.    
  726.     sets.aftercast.Move = set_combine(sets.aftercast, sets.Movement)
  727.     sets.aftercast.Move.Avatar = set_combine(sets.aftercast.Avatar, sets.Movement)
  728.  
  729.     -- These 2 sets are for when you're in DD mode but not actually engaged to something.
  730.     sets.aftercast.DD = set_combine(sets.aftercast, {
  731.         head="Null Masque",
  732.     })
  733.  
  734.     sets.aftercast.DD.Avatar = set_combine(sets.aftercast.Avatar, {
  735.         head="Null Masque",
  736.     })
  737.     sets.aftercast.DD.Avatar.Opashoro = set_combine(sets.aftercast.DD.Avatar, {
  738.         body="Beckoner's Doublet +3",
  739.     })
  740.  
  741.     -- Main melee set
  742.     -- If you want specific things equipped only when an avatar is out, modify "sets.aftercast.DD.Avatar.Engaged" below.
  743.     sets.aftercast.DD.Engaged = set_combine(sets.aftercast.DD.Avatar, {
  744.         --head="Beckoner's Horn +3",
  745.         head="Bunzi's Hat",
  746.         neck="Shulmanu Collar",
  747.         ear1="Telos Earring",
  748.         ear2="Cessance Earring",
  749.         body="Tali'ah Manteel +2",
  750.         hands="Bunzi's Gloves",
  751.         ring1={ name="Chirich Ring +1", bag="wardrobe2" },
  752.         ring2="Fickblix's Ring",
  753.         back={ name="Campestres's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10','Phys. dmg. taken-10%',}},
  754.         waist="Cetl Belt",
  755.         legs="Nyame Flanchard",
  756.         feet="Beckoner's Pigaches +3"
  757.     })
  758.    
  759.     -- Main melee set when engaged with an avatar out. Usually doesn't have many changes from the above set.
  760.     sets.aftercast.DD.Avatar.Engaged = set_combine(sets.aftercast.DD.Engaged, {
  761.         ear2="Sroda Earring"
  762.     })
  763.    
  764.     sets.aftercast.DD.Avatar.Engaged.Opashoro = set_combine(sets.aftercast.DD.Engaged, {
  765.         body="Beckoner's Doublet +3",
  766.     })
  767.  
  768.     sets.aftercast.Enspell = set_combine(sets.aftercast, { })
  769.     sets.aftercast.Enspell.Avatar = set_combine(sets.aftercast.Avatar, { })
  770.    
  771.     -- Enspell set I mainly use for Peach Power. Load up on accuracy & magic accuracy. Doesn't seem to help much honestly, it's a work in progress.
  772.     sets.aftercast.Enspell.Engaged = set_combine(sets.aftercast.DD.Avatar.Engaged, {
  773.         ear1="Crepuscular Earring",
  774.         ear2="Beckoner's Earring +1",
  775.         body="Beckoner's Doublet +3", --replaces feet for perp cost
  776.         ring1="Metamorph Ring +1",
  777.         waist="Orpheus's Sash",
  778.         feet="Nyame Sollerets",
  779.     })
  780.     sets.aftercast.Enspell.Avatar.Engaged = set_combine(sets.aftercast.Enspell.Engaged, {})
  781.    
  782.     sets.aftercast.Favor = set_combine(sets.aftercast, { })
  783.    
  784.     -- Used when IdleMode is "Favor" to maximize avatar's favor effect.
  785.     -- Skill tiers are 512 / 575 / 670 / 735
  786.     sets.aftercast.Favor.Avatar = set_combine(sets.aftercast.Avatar, {
  787.         head="Beckoner's Horn +3",
  788.         --ear2="Lodurr Earring",
  789.         body="Beckoner's Doublet +3",
  790.         hands="Baayami Cuffs +1",
  791.         legs="Baayami Slops +1",
  792.         feet="Baayami Sabots +1"
  793.     })
  794.  
  795.     sets.aftercast.PetDD = set_combine(sets.aftercast, { })
  796.  
  797.     -- Avatar Melee set. You really don't need this set. It's only here because I can't bring myself to throw it away.
  798.     sets.aftercast.PetDD.Avatar = set_combine(sets.aftercast.Avatar, {
  799.         ear2="Rimeice Earring",
  800.         body="Glyphic Doublet +4",
  801.         hands={ name="Helios Gloves", augments={'Pet: Accuracy+22 Pet: Rng. Acc.+22','Pet: "Dbl. Atk."+8','Pet: Haste+6',}},
  802.         ring2="Fickblix's Ring",
  803.         waist="Klouskap Sash",
  804.         feet={ name="Helios Boots", augments={'Pet: Accuracy+21 Pet: Rng. Acc.+21','Pet: "Dbl. Atk."+8','Pet: Haste+6',}}
  805.     })
  806.  
  807.     sets.aftercast.Zendik = set_combine(sets.aftercast, {
  808.         body="Zendik Robe"
  809.     })
  810.     -- sets.aftercast.Zendik.ForceIlvl = set_combine(sets.aftercast.Zendik, {
  811.         -- feet="Baayami Sabots +1"
  812.     -- })
  813.     sets.aftercast.Zendik.LowMP = set_combine(sets.aftercast.Zendik, {
  814.         waist="Fucho-no-obi"
  815.     })
  816.     -- sets.aftercast.Zendik.LowMP.ForceIlvl = set_combine(sets.aftercast.Zendik.LowMP, {
  817.         -- feet="Baayami Sabots +1"
  818.     -- })
  819.  
  820.     sets.aftercast.Zendik.Avatar = set_combine(sets.aftercast.Favor.Avatar, {
  821.         body="Zendik Robe"
  822.     })
  823.  
  824.     -- I use this mode for Mewing Lullaby duty in V20+ Gaol. Heaviest defense possible, less attention toward MP management.
  825.     sets.aftercast.MEva = set_combine(sets.aftercast.DT, {
  826.         sub="Khonsu",
  827.         hands="Nyame Gauntlets",
  828.         feet="Baayami Sabots +1"
  829.     })
  830.  
  831.     sets.aftercast.MEva.Avatar = set_combine(sets.aftercast.MEva, {
  832.         ear1="Enmerkar Earring",
  833.         waist="Isa Belt",
  834.         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%',}},
  835.     })
  836.    
  837.     -- MDB set for Limbus bosses
  838.     sets.aftercast.MDB = set_combine(sets.aftercast.DT, {
  839.         body="Adamantite Armor",
  840.         hands="Bunzi's Gloves",
  841.         ring1="Shneddick Ring +1",
  842.         waist="Null Belt",
  843.         feet="Beckoner's Pigaches +3",
  844.     })
  845.  
  846.     sets.aftercast.MDB.Avatar = set_combine(sets.aftercast.MDB, {
  847.         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%',}},
  848.     })
  849.  
  850.     -- Idle set used when you have a spirit summoned.
  851.     -- Perp Down caps at 7. Glyphic Spats will make them cast more frequently, caps at ~20 seconds.
  852.     sets.aftercast.Spirit = set_combine(sets.aftercast.Avatar, {
  853.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  854.         ring2={name="Stikini Ring +1", bag="wardrobe4"},
  855.         waist="Fucho-no-obi",
  856.         legs="Glyphic Spats +4",
  857.     })
  858.     sets.aftercast.Favor.Spirit = set_combine(sets.aftercast.Spirit, {
  859.     })
  860.     sets.aftercast.Zendik.Spirit = set_combine(sets.aftercast.Favor.Spirit, {
  861.     })
  862.    
  863.     sets.aftercast.Town = set_combine(sets.aftercast.Avatar, {
  864.         main="Opashoro",
  865.         sub="Oneiros Grip",
  866.         ammo="Sancus Sachet +1",
  867.         head="Null Masque",
  868.         neck="Summoner's Collar +2",
  869.         hands="Indomitable Gloves",
  870.         ring1="Shneddick Ring +1",
  871.         ring2="Fickblix's Ring",
  872.         waist="Ninurta's Sash",
  873.         legs="Bunzi's Pants",
  874.     })
  875.    
  876.     -- Set that I sometimes lock myself into when faced with Encumbrance (inability to swap gear)
  877.     sets.LockGear = {
  878.         head="Beckoner's Horn +3", -- Favor+5 for BP recast
  879.         neck="Summoner's Collar +2",
  880.         ear1="Lugalbanda Earring",
  881.         ear2="Sroda Earring",
  882.         body="Convoker's Doublet +4", -- 15 BP recast
  883.         hands="Indomitable Gloves",
  884.         ring1="Cath Palug Ring",
  885.         ring2="Fickblix's Ring",
  886.         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%',}},
  887.         waist="Incarnation Sash",
  888.         legs={ name="Apogee Slacks +1", augments={'Pet: STR+20','Blood Pact Dmg.+14','Pet: "Dbl. Atk."+4',}},
  889.         feet="Beckoner's Pigaches +3", -- 9 perp down
  890.     }
  891.    
  892.     sets.Test = set_combine(sets.aftercast.DT, {
  893.         head="Amalric Coif +1",
  894.         ear1="Odnowa Earring +1",
  895.         body="Adamantite Armor",
  896.         ring1="Warp Ring",
  897.         waist="Cetl Belt",
  898.         legs={ name="Merlinic Shalwar", augments={'"Fast Cast"+6','CHR+6','Mag. Acc.+14','"Mag.Atk.Bns."+14',}},
  899.     })
  900.    
  901.  
  902.     -- ===================================================================================================================
  903.     --      End of Sets
  904.     -- ===================================================================================================================
  905.  
  906.     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'}
  907.     Buff_BPs_Healing = S{'Healing Ruby','Healing Ruby II','Whispering Wind','Spring Water'}
  908.     Buff_BPs_MND = S{"Wind's Blessing"}
  909.     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'}
  910.     Debuff_Rage_BPs = S{'Moonlit Charge','Tail Whip'}
  911.  
  912.     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'}
  913.     Magic_BPs_TP = S{'Impact','Conflag Strike','Level ? Holy','Lunar Bay'}
  914.     Merit_BPs = S{'Meteor Strike','Geocrush','Grand Fall','Wind Blade','Heavenly Strike','Thunderstorm'}
  915.     Physical_BPs_TP = S{'Rock Buster','Mountain Buster','Crescent Fang','Spinning Dive','Roundhouse'}
  916.    
  917.     ZodiacElements = S{'Fire','Earth','Water','Wind','Ice','Lightning'}
  918.  
  919.     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","nashmau","western adoulin","eastern adoulin","chocobo circuit"}
  920.     --Salvage = S{"Bhaflau Remnants","Zhayolm Remnants","Arrapago Remnants","Silver Sea Remnants"}
  921.  
  922.     -- Select initial macro set and set lockstyle
  923.     -- This section likely requires changes or removal if you aren't Pergatory
  924.     -- 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.
  925.     if pet.isvalid then
  926.         if pet.name=='Fenrir' then
  927.             send_command('input /macro book 10;wait .1;input /macro set 2;wait 3;input /lockstyleset '..StartLockStyle)
  928.         elseif pet.name=='Ifrit' then
  929.             send_command('input /macro book 10;wait .1;input /macro set 3;wait 3;input /lockstyleset '..StartLockStyle)
  930.         elseif pet.name=='Titan' then
  931.             send_command('input /macro book 10;wait .1;input /macro set 4;wait 3;input /lockstyleset '..StartLockStyle)
  932.         elseif pet.name=='Leviathan' then
  933.             send_command('input /macro book 10;wait .1;input /macro set 5;wait 3;input /lockstyleset '..StartLockStyle)
  934.         elseif pet.name=='Garuda' then
  935.             send_command('input /macro book 10;wait .1;input /macro set 6;wait 3;input /lockstyleset '..StartLockStyle)
  936.         elseif pet.name=='Shiva' then
  937.             send_command('input /macro book 10;wait .1;input /macro set 7;wait 3;input /lockstyleset '..StartLockStyle)
  938.         elseif pet.name=='Ramuh' then
  939.             send_command('input /macro book 10;wait .1;input /macro set 8;wait 3;input /lockstyleset '..StartLockStyle)
  940.         elseif pet.name=='Diabolos' then
  941.             send_command('input /macro book 10;wait .1;input /macro set 9;wait 3;input /lockstyleset '..StartLockStyle)
  942.         elseif pet.name=='Cait Sith' then
  943.             send_command('input /macro book 11;wait .1;input /macro set 2;wait 3;input /lockstyleset '..StartLockStyle)
  944.         elseif pet.name=='Siren' then
  945.             send_command('input /macro book 11;wait .1;input /macro set 4;wait 3;input /lockstyleset '..StartLockStyle)
  946.         end
  947.     else
  948.         -- Macro set for no avatar out (usually the case unless you're reloading Gearswap in the field)
  949.         send_command('input /macro book 10;wait .1;input /macro set 1;wait 3;input /lockstyleset '..StartLockStyle)
  950.     end
  951.     -- End macro set / lockstyle section
  952. end
  953.  
  954. -- ===================================================================================================================
  955. --      Gearswap rules below this point - Modify at your own peril
  956. -- ===================================================================================================================
  957.  
  958. function pretarget(spell,action)
  959.     if not buffactive['Muddle'] then
  960.         -- Auto Remedy --
  961.         if AutoRemedy and (spell.action_type == 'Magic' or spell.type == 'JobAbility') then
  962.             if buffactive['Paralysis'] or (buffactive['Silence'] and not AutoEcho) then
  963.                 cancel_spell()
  964.                 send_command('input /item "Remedy" <me>')
  965.             end
  966.         end
  967.         -- Auto Echo Drop --
  968.         if AutoEcho and spell.action_type == 'Magic' and buffactive['Silence'] then
  969.             cancel_spell()
  970.             send_command('input /item "Echo Drops" <me>')
  971.         end
  972.     end
  973. end
  974.  
  975. function precast(spell)
  976.     if (pet.isvalid and pet_midaction() and not spell.type=="SummonerPact") or spell.type=="Item" then
  977.         -- Do not swap if pet is mid-action. I added the type=SummonerPact check because sometimes when the avatar
  978.         -- dies mid-BP, pet.isvalid and pet_midaction() continue to return true for a brief time.
  979.         return
  980.     end
  981.     -- Spell fast cast
  982.     if sets.precast[spell.english] then
  983.         equip(sets.precast[spell.english])
  984.     elseif spell.action_type=="Magic" then
  985.         if spell.name=="Stoneskin" then
  986.             equip(sets.precast.FC,{waist="Siegel Sash"})
  987.         else
  988.             equip(sets.precast.FC)
  989.         end
  990.     end
  991. end
  992.  
  993. function midcast(spell)
  994.     if (pet.isvalid and pet_midaction()) or spell.type=="Item" then
  995.         return
  996.     end
  997.     -- BP Timer gear needs to swap here
  998.     if (spell.type=="BloodPactWard" or spell.type=="BloodPactRage") then
  999.         if not buffactive["Astral Conduit"] then
  1000.             equipSet = sets.midcast.BP
  1001.             if equipSet[spell.name] then
  1002.                 equipSet = equipSet[spell.name]
  1003.             end
  1004.             equip(equipSet)
  1005.         end
  1006.         -- If lag compensation mode is on, set up a timer to equip the BP gear.
  1007.         if LagMode then
  1008.             send_command('wait 0.5;gs c EquipBP '..spell.name)
  1009.         end
  1010.     -- Spell Midcast & Potency Stuff
  1011.     elseif sets.midcast[spell.english] then
  1012.         equip(sets.midcast[spell.english])
  1013.     elseif spell.name=="Elemental Siphon" then
  1014.         if pet.element==world.day_element and ZodiacElements:contains(pet.element) then
  1015.             if pet.element==world.weather_element then
  1016.                 equip(sets.midcast.SiphonWeatherZodiac)
  1017.             else
  1018.                 equip(sets.midcast.SiphonZodiac)
  1019.             end
  1020.         else
  1021.             if pet.element==world.weather_element then
  1022.                 equip(sets.midcast.SiphonWeather)
  1023.             else
  1024.                 equip(sets.midcast.Siphon)
  1025.             end
  1026.         end
  1027.     elseif spell.type=="SummonerPact" then
  1028.         equip(sets.midcast.Summon)
  1029.     elseif string.find(spell.name,"Cure") or string.find(spell.name,"Curaga") then
  1030.         equip(sets.midcast.Cure)
  1031.     elseif string.find(spell.name,"Protect") or string.find(spell.name,"Shell") then
  1032.         equip(sets.midcast.Enhancing,{ring2="Sheltered Ring"})
  1033.     elseif spell.skill=="Enfeebling Magic" then
  1034.         equip(sets.midcast.Enfeeble)
  1035.     elseif spell.skill=="Enhancing Magic" then
  1036.         equip(sets.midcast.Enhancing)
  1037.     elseif spell.skill=="Elemental Magic" then
  1038.         equip(sets.midcast.Nuke)
  1039.     elseif spell.action_type=="Magic" then
  1040.         equip(sets.midcast.EnmityRecast)
  1041.     elseif spell.type=="WeaponSkill" then
  1042.         equip(sets.Weaponskill)
  1043.     else
  1044.         idle()
  1045.     end
  1046.     -- Treasure Hunter
  1047.     if TreasureHunter and THSpells:contains(spell.name) then
  1048.         equip(sets.TH)
  1049.     end
  1050.     -- Auto-cancel existing buffs
  1051.     if spell.name=="Stoneskin" and buffactive["Stoneskin"] then
  1052.         windower.send_command('cancel 37;')
  1053.     elseif spell.name=="Sneak" and buffactive["Sneak"] and spell.target.type=="SELF" then
  1054.         windower.send_command('cancel 71;')
  1055.     elseif spell.name=="Utsusemi: Ichi" and buffactive["Copy Image"] then
  1056.         windower.send_command('wait 1;cancel 66;')
  1057.     end
  1058. end
  1059.  
  1060. function aftercast(spell)
  1061.     if pet_midaction() or spell.type=="Item" then
  1062.         return
  1063.     end
  1064.     if not string.find(spell.type,"BloodPact") then
  1065.         idle()
  1066.     end
  1067. end
  1068.  
  1069. function pet_change(pet,gain)
  1070.     if (not (gain and pet_midaction())) then
  1071.         idle()
  1072.     end
  1073. end
  1074.  
  1075. function status_change(new,old)
  1076.     if not midaction() and not pet_midaction() then
  1077.         idle()
  1078.     end
  1079. end
  1080.  
  1081. function buff_change(name,gain)
  1082.     if name=="quickening" and not pet_midaction() then
  1083.         idle()
  1084.     end
  1085.     if SacTorque and name=="sleep" and gain and pet.isvalid then
  1086.         equip({neck="Sacrifice Torque"})
  1087.         disable("neck")
  1088.         if buffactive["Stoneskin"] then
  1089.             windower.send_command('cancel 37;')
  1090.         end
  1091.     end
  1092.     if SacTorque and name=="sleep" and not gain then
  1093.         enable("neck")
  1094.     end
  1095. end
  1096.  
  1097. function pet_midcast(spell)
  1098.     if not LagMode then
  1099.         equipBPGear(spell.name)
  1100.     end
  1101. end
  1102.  
  1103. function pet_aftercast(spell)
  1104.     idle()
  1105. end
  1106.  
  1107. function equipBPGear(spell)
  1108.     if spell=="Shock Squall" then
  1109.         return -- Don't bother for Shock Squall, it already went off by the time we get here
  1110.     end
  1111.     if spell=="Perfect Defense" then
  1112.         equip(sets.pet_midcast.SummoningMagic)
  1113.     elseif Debuff_BPs:contains(spell) then
  1114.         equip(sets.pet_midcast.MagicAcc_BP)
  1115.     elseif Buff_BPs_Healing:contains(spell) then
  1116.         equip(sets.pet_midcast.Buff_Healing)
  1117.     elseif Buff_BPs_Duration:contains(spell) then
  1118.         if Empy then
  1119.             equip(sets.pet_midcast.Buff.Empy)
  1120.         else
  1121.             equip(sets.pet_midcast.Buff)
  1122.         end
  1123.     elseif Buff_BPs_MND:contains(spell) then
  1124.         equip(sets.pet_midcast.Buff_MND)
  1125.     elseif spell=="Flaming Crush" then
  1126.         if AccMode then
  1127.             equip(sets.pet_midcast.FlamingCrush_Acc)
  1128.         else
  1129.             equip(sets.pet_midcast.FlamingCrush)
  1130.         end
  1131.     elseif ImpactDebuff and (spell=="Impact" or spell=="Conflag Strike") then
  1132.         equip(sets.pet_midcast.Impact)
  1133.     elseif Magic_BPs_NoTP:contains(spell) then
  1134.         if AccMode then
  1135.             equip(sets.pet_midcast.Magic_BP_NoTP_Acc)
  1136.         else
  1137.             equip(sets.pet_midcast.Magic_BP_NoTP)
  1138.         end
  1139.     elseif Magic_BPs_TP:contains(spell) or string.find(spell," II") or string.find(spell," IV") then
  1140.         if AccMode then
  1141.             equip(sets.pet_midcast.Magic_BP_TP_Acc)
  1142.         else
  1143.             equip(sets.pet_midcast.Magic_BP_TP)
  1144.         end
  1145.     elseif Merit_BPs:contains(spell) then
  1146.         if AccMode then
  1147.             equip(sets.pet_midcast.Magic_BP_TP_Acc)
  1148.         elseif spell=="Meteor Strike" and MeteorStrike>4 then
  1149.             equip(sets.pet_midcast.Magic_BP_NoTP)
  1150.         elseif spell=="Geocrush" and Geocrush>4 then
  1151.             equip(sets.pet_midcast.Magic_BP_NoTP)
  1152.         elseif spell=="Grand Fall" and GrandFall>4 then
  1153.             equip(sets.pet_midcast.Magic_BP_NoTP)
  1154.         elseif spell=="Wind Blade" and WindBlade>4 then
  1155.             equip(sets.pet_midcast.Magic_BP_NoTP)
  1156.         elseif spell=="Heavenly Strike" and HeavenlyStrike>4 then
  1157.             equip(sets.pet_midcast.Magic_BP_NoTP)
  1158.         elseif spell=="Thunderstorm" and Thunderstorm>4 then
  1159.             equip(sets.pet_midcast.Magic_BP_NoTP)
  1160.         else
  1161.             equip(sets.pet_midcast.Magic_BP_TP)
  1162.         end
  1163.     elseif Debuff_Rage_BPs:contains(spell) then
  1164.         equip(sets.pet_midcast.Debuff_Rage)
  1165.     else
  1166.         if string.find(pet.name,'Spirit') then
  1167.             return
  1168.         elseif AccMode then
  1169.             equip(sets.pet_midcast.Physical_BP_Acc)
  1170.         elseif Physical_BPs_TP:contains(spell) then
  1171.             equip(sets.pet_midcast.Physical_BP_TP)
  1172.         elseif buffactive["Aftermath: Lv.3"] and not CustomMode=="Opashoro" then
  1173.             equip(sets.pet_midcast.Physical_BP_AM3)
  1174.         else
  1175.             equip(sets.pet_midcast.Physical_BP)
  1176.         end
  1177.     end
  1178.     -- Custom Timers
  1179.     if spell=="Mewing Lullaby" and string.find(world.area,"Walk of Echoes %[P") then
  1180.         send_command('timers create "Mewing Resist: can go @ 30s" 60 down') -- In Gaol, underperforms if used every 20s. 60s is full potency.
  1181.         -- Tip: I found it was best to go after 30 seconds. It doesn't fully drain them but you can't afford to wait the full 60.
  1182.         -- Use the time between this to use BP:Rages for additional damage! They feed no TP, as long as your avatar doesn't attack.
  1183.     end
  1184. end
  1185.  
  1186. -- This command is called whenever you input "gs c <command>"
  1187. function self_command(command)
  1188.     if string.sub(command,1,7)=="EquipBP" then
  1189.         equipBPGear(string.sub(command,9,string.len(command)))
  1190.         return
  1191.     end
  1192.  
  1193.     is_valid = command:lower()=="idle"
  1194.  
  1195.     for _, v in ipairs(IdleModes) do
  1196.         if command:lower()==v:lower() then
  1197.             IdleMode = v
  1198.             send_command('console_echo "Idle Mode: ['..IdleMode..']"')
  1199.             is_valid = true
  1200.         end
  1201.     end
  1202.     if not is_valid then
  1203.         if string.sub(command,1,6):lower()=="custom" then
  1204.             for _, v in ipairs(CustomModes) do
  1205.                 if string.sub(command,8,string.len(command)):lower()==v:lower() then
  1206.                     CustomMode = v
  1207.                     send_command('console_echo "Custom Mode: ['..CustomMode..']"')
  1208.                     is_valid = true
  1209.                 end
  1210.             end
  1211.         elseif command:lower()=="accmode" then
  1212.             AccMode = AccMode==false
  1213.             is_valid = true
  1214.             send_command('console_echo "AccMode: '..tostring(AccMode)..'"')
  1215.         elseif command:lower()=="impactmode" then
  1216.             ImpactDebuff = ImpactDebuff==false
  1217.             is_valid = true
  1218.             send_command('console_echo "Impact Debuff: '..tostring(ImpactDebuff)..'"')
  1219.         elseif command:lower()=="forceilvl" then
  1220.             ForceIlvl = ForceIlvl==false
  1221.             is_valid = true
  1222.             send_command('console_echo "Force iLVL: '..tostring(ForceIlvl)..'"')
  1223.         elseif command:lower()=="lagmode" then
  1224.             LagMode = LagMode==false
  1225.             is_valid = true
  1226.             send_command('console_echo "Lag Compensation Mode: '..tostring(LagMode)..'"')
  1227.         elseif command:lower()=="th" then
  1228.             TreasureHunter = TreasureHunter==false
  1229.             is_valid = true
  1230.             send_command('console_echo "Treasure Hunter Mode: '..tostring(TreasureHunter)..'"')
  1231.         elseif command:lower()=="empy" then
  1232.             Empy = Empy==false
  1233.             is_valid = true
  1234.             send_command('console_echo "Empyrean Ward Mode: '..tostring(Empy)..'"')
  1235.         elseif command:lower()=="test" then
  1236.             TestMode = TestMode==false
  1237.             is_valid = true
  1238.             send_command('console_echo "Test Mode: '..tostring(TestMode)..'"')
  1239.         elseif command:lower()=="weaponlock" then
  1240.             if WeaponLock then
  1241.                 enable("main","sub")
  1242.                 WeaponLock = false
  1243.             else
  1244.                 equip({main="Nirvana",sub="Elan Strap +1"})
  1245.                 disable("main","sub")
  1246.                 WeaponLock = true
  1247.             end
  1248.             is_valid = true
  1249.             send_command('console_echo "Weapon Lock: '..tostring(WeaponLock)..'"')
  1250.         elseif command=="ToggleIdle" then
  1251.             is_valid = true
  1252.             -- If you want to change the sets cycled with F9, this is where you do it
  1253.             if IdleMode=="Refresh" then
  1254.                 IdleMode = "DT"
  1255.             elseif IdleMode=="DT" then
  1256.                 IdleMode = "PetDT"
  1257.             elseif IdleMode=="PetDT" then
  1258.                 IdleMode = "DD"
  1259.             else
  1260.                 IdleMode = "Refresh"
  1261.             end
  1262.             send_command('console_echo "Idle Mode: ['..IdleMode..']"')
  1263.         elseif command:lower()=="lowhp" then
  1264.             -- Use for "Cure 500 HP" objectives in Omen
  1265.             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"})
  1266.             return
  1267.         elseif string.sub(command:lower(),1,12)=="meteorstrike" then
  1268.             MeteorStrike = string.sub(command,13,13)
  1269.             send_command('console_echo "Meteor Strike: '..MeteorStrike..'/5"')
  1270.             is_valid = true
  1271.         elseif string.sub(command:lower(),1,8)=="geocrush" then
  1272.             Geocrush = string.sub(command,9,9)
  1273.             send_command('console_echo "Geocrush: '..Geocrush..'/5"')
  1274.             is_valid = true
  1275.         elseif string.sub(command:lower(),1,9)=="grandfall" then
  1276.             GrandFall = string.sub(command,10,10)
  1277.             send_command('console_echo "Grand Fall: '..GrandFall..'/5"')
  1278.             is_valid = true
  1279.         elseif string.sub(command:lower(),1,9)=="windblade" then
  1280.             WindBlade = +string.sub(command,10,10)
  1281.             send_command('console_echo "Wind Blade: '..WindBlade..'/5"')
  1282.             is_valid = true
  1283.         elseif string.sub(command:lower(),1,14)=="heavenlystrike" then
  1284.             HeavenlyStrike = string.sub(command,15,15)
  1285.             send_command('console_echo "Heavenly Strike: '..HeavenlyStrike..'/5"')
  1286.             is_valid = true
  1287.         elseif string.sub(command:lower(),1,12)=="thunderstorm" then
  1288.             Thunderstorm = string.sub(command,13,13)
  1289.             send_command('console_echo "Thunderstorm: '..Thunderstorm..'/5"')
  1290.             is_valid = true
  1291.         elseif command:lower()=="lockgear" then
  1292.             equip(sets.LockGear)
  1293.             disable("head","neck","ear1","ear2","body","hands","ring1","ring2","back","waist","legs","feet")
  1294.             is_valid = true
  1295.         elseif command:lower()=="opa" then
  1296.             if CustomMode=='Opashoro' then
  1297.                 enable("main","sub")
  1298.                 WeaponLock = false
  1299.                 CustomMode = 'None'
  1300.             else
  1301.                 enable("main","sub")
  1302.                 equip({main="Opashoro",sub="Elan Strap +1"})
  1303.                 disable("main","sub")
  1304.                 WeaponLock = true
  1305.                 CustomMode = 'Opashoro'
  1306.             end
  1307.             send_command('console_echo "Opashoro Mode: '..tostring(WeaponLock)..'"')
  1308.             is_valid = true
  1309.         end
  1310.     end
  1311.  
  1312.     if is_valid then
  1313.         if not midaction() and not pet_midaction() then
  1314.             idle()
  1315.         end
  1316.     else
  1317.         sanitized = command:gsub("\"", "")
  1318.         send_command('console_echo "Invalid self_command: '..sanitized..'"') -- Note: If you use Gearinfo, comment out this line
  1319.     end
  1320. end
  1321.  
  1322. -- This function is for returning to aftercast gear after an action/event.
  1323. function idle()
  1324.     equipSet = sets.aftercast
  1325.     if TownIdle:contains(world.area:lower()) then
  1326.         equipSet = sets.aftercast.Town
  1327.     end
  1328.     if equipSet[IdleMode] then
  1329.         equipSet = equipSet[IdleMode]
  1330.     end
  1331.     if pet.isvalid then
  1332.         if equipSet[pet.name] then
  1333.             equipSet = equipSet[pet.name]
  1334.         elseif string.find(pet.name,'Spirit') and equipSet["Spirit"] then
  1335.             equipSet = equipSet["Spirit"]
  1336.         elseif equipSet["Avatar"] then
  1337.             equipSet = equipSet["Avatar"]
  1338.         end
  1339.     end
  1340.     if equipSet[player.status] then
  1341.         equipSet = equipSet[player.status]
  1342.     end
  1343.     if player.mpp < 50 and equipSet["LowMP"] then
  1344.         equipSet = equipSet["LowMP"]
  1345.     end
  1346.     if ForceIlvl and equipSet["ForceIlvl"] then
  1347.         equipSet = equipSet["ForceIlvl"]
  1348.     end
  1349.     if equipSet[CustomMode] then
  1350.         equipSet = equipSet[CustomMode]
  1351.     end
  1352.     equip(equipSet)
  1353.  
  1354.     if (buffactive['Quickening'] or buffactive['Sneak'] or buffactive['Invisible']) and IdleMode~='DT' then
  1355.         --if not ForceIlvl then
  1356.             equip(sets.Movement)
  1357.         --end
  1358.     end
  1359.     if TestMode then
  1360.         equip(sets.Test)
  1361.     end
  1362.     -- Balrahn's Ring
  1363.     --if Salvage:contains(world.area) then
  1364.     --  equip({ring2="Balrahn's Ring"})
  1365.     --end
  1366.     -- Maquette Ring (works in Ambuscade too)
  1367.     --if world.area=='Maquette Abdhaljs-Legion' and not IdleMode=='DT' then
  1368.     --  equip({ring2="Maquette Ring"})
  1369.     --end
  1370. end
Add Comment
Please, Sign In to add comment