Pergatory

Pergatory's WHM Gearswap

Jan 27th, 2017 (edited)
5,135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 27.56 KB | None | 0 0
  1. -- IdleMode determines the set used after casting. You change it with "/console gs c <IdleMode>"
  2. -- The modes are:
  3. -- Auto: Uses "Refresh" below 50%, "DT" at 50-70%, and "MEva" above 70%.
  4. --      I have it this way because MEva is my preferred set but it has lower refresh than the DT one.
  5. -- Refresh: Uses the most refresh available.
  6. -- MEva: Uses magic evasion build.
  7. -- DT: Uses PDT and DT.
  8. -- TP: TP build for meleeing.
  9. -- KC: Seperate TP build used for Kraken Club (less double attack)
  10.  
  11. -- Additional Commands:
  12. -- "/console gs c AccMode" will toggle high-accuracy mode for melee.
  13. -- "/console gs c Gamb" will toggle Gambanteinn for Cursna
  14. -- "/console gs c CureObjective" will force "midcast.CureObjective" and "aftercast.CureObjective" sets to be used for Omen 500HP objective.
  15.  
  16. -- Additional Bindings:
  17. -- F9 - Toggles between a subset of IdleModes (Refresh > MEva > DT)
  18. -- F10 - Toggles WeaponLock (When enabled, changes idle mode to TP and disables weapon slots from swapping)
  19.  
  20. function file_unload()
  21.     send_command('unbind f9')
  22.     send_command('unbind f10')
  23.     send_command('unbind f11')
  24.     send_command('unbind f12')
  25.     send_command('unbind ^f9')
  26.     send_command('unbind ^f10')
  27.     send_command('unbind ^f11')
  28.     enable("main","sub","range","ammo","head","neck","ear1","ear2","body","hands","ring1","ring2","back","waist","legs","feet")
  29. end
  30.  
  31. function get_sets()
  32.     send_command('bind f9 gs c CycleIdle')
  33.     send_command('bind f10 gs c CureDT')
  34.     send_command('bind f11 gs c BanishPot') -- Use to toggle Banish Potency gear for weakening undead targets
  35.     send_command('bind f12 gs c Gamb') -- Gambanteinn toggle for Cursna, don't use if you don't have AG Gambanteinn
  36.     send_command('bind ^f9 gs c WeaponLock')
  37.     send_command('bind ^f10 gs c TH') -- Treasure Hunter toggle. Only equips for spells in the "THSpells" list below.
  38.     send_command('bind ^f11 gs c CureObjective') -- Use to toggle high-HP cure build to complete 500HP cure objectives in Omen
  39.  
  40.     StartLockStyle = '66'
  41.     IdleMode = 'Auto'
  42.     WeaponLock = false
  43.     AccMode = false
  44.     Gambanteinn = false
  45.     BanishPotency = true
  46.     CureObjective = false
  47.     TreasureHunter = false
  48.     CureDT = false -- Capped DT in your Cure Midcast for fights like V20/V25 where you may get hit in midcast
  49.     THSpells = S{"Dia","Dia II","Diaga","Dispelga"} -- If you want Treasure Hunter gear to swap for a spell/ability, add it here.
  50.  
  51.     IdleModeCommands = S{'Auto','Refresh','DT','MEva','TP','DualWield','Hybrid','HybridDW','KC','Shamash','Avatar'}
  52.  
  53.     -- Set initial macro set & lockstyle
  54.     send_command('input /macro book 8;wait .1;input /macro set 1;wait 3;input /lockstyleset '..StartLockStyle)
  55.  
  56.     sets.WakeUp = { main="Prime Maul", sub="Genmei Shield" } -- Add an item here to wake yourself up if you're slept without Sublimation active. --
  57.     sets.Movement = { feet="Herald's Gaiters" } -- Movement item equipped automatically when Sneak/Invis/Bolters are up
  58.  
  59.     -- ===================================================================================================================
  60.     --      Sets
  61.     -- ===================================================================================================================
  62.  
  63.     sets.precast = {}
  64.  
  65.     -- Main fast cast set
  66.     sets.precast.FC = {
  67.         main={ name="Grioavolr", augments={'"Fast Cast"+6','INT+2','"Mag.Atk.Bns."+17',}}, -- +10
  68.         sub="Clerisy Strap +1", -- +3
  69.         ammo="Impatiens",
  70.         head="Bunzi's Hat", -- +10
  71.         neck="Cleric's Torque +2", -- +6
  72.         ear1="Malignance Earring", -- +4
  73.         ear2="Loquacious Earring", -- +2
  74.         hands="Fanatic Gloves", -- +7
  75.         body="Inyanga Jubbah +2", -- +14
  76.         ring1="Lebeche Ring",
  77.         ring2="Kishar Ring", -- +4
  78.         back={ name="Alaunus's Cape", augments={'HP+60','HP+20','"Fast Cast"+10','Damage taken-5%',}},
  79.         waist="Witful Belt", -- +3
  80.         legs={ name="Kaykaus Tights +1", augments={'INT+12','"Mag.Atk.Bns."+20','Enmity-6',}}, -- +7
  81.         feet="Regal Pumps +1" -- +5~7
  82.     }
  83.  
  84.     sets.precast.FC_Enhancing = set_combine(sets.precast.FC, {
  85.     })
  86.     sets.precast.FC_Cure = set_combine(sets.precast.FC, {
  87.     })
  88.  
  89.     -- Fast cast for ailment spells (Divine Benison works well here)
  90.     sets.precast.FC_Ailment = set_combine(sets.precast.FC, {
  91.         main="Yagrush",
  92.         sub="Genmei Shield",
  93.         legs="Ebers Pantaloons +3"
  94.     })
  95.  
  96.     sets.precast['Impact'] = set_combine(sets.precast.FC, { -- Make sure to leave the head empty --
  97.         head=empty,
  98.         body="Crepuscular Cloak"
  99.     })
  100.  
  101.     sets.precast["Dispelga"] = set_combine(sets.precast.FC, {
  102.         main="Daybreak",
  103.         sub="Ammurapi Shield"
  104.     })
  105.  
  106.     -- Yes, I have a blood pact timer set on WHM...
  107.     sets.precast.BP = {
  108.         head={ name="Helios Band", augments={'Pet: Mag. Acc.+29','"Blood Pact" ability delay -5','Summoning magic skill +8',}},
  109.         legs={ name="Helios Spats", augments={'Pet: Mag. Acc.+25','"Blood Pact" ability delay -5','Summoning magic skill +6',}},
  110.         feet={ name="Helios Boots", augments={'Pet: Mag. Acc.+29','"Blood Pact" ability delay -5','Summoning magic skill +8',}}
  111.     }
  112.  
  113.     sets.midcast = {}
  114.  
  115.     -- Cure potency build. I pretty much just assume Aurorastorm is up.
  116.     sets.midcast.Cure = {
  117.         main="Daybreak",
  118.         sub="Genmei Shield",
  119.         ammo="Pemphredo Tathlum",
  120.         head="Kaykaus Mitra +1",
  121.         neck="Cleric's Torque +2",
  122.         ear1="Glorious Earring",
  123.         ear2="Nourishing Earring +1",
  124.         body="Ebers Bliaut +3",
  125.         hands="Theophany Mitts +3",
  126.         ring1="Naji's Loop",
  127.         ring2="Defending Ring",
  128.         back={ name="Alaunus's Cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','Enmity-10','Damage taken-5%',}},
  129.         waist="Witful Belt",
  130.         legs="Ebers Pantaloons +3",
  131.         feet="Kaykaus Boots +1"
  132.     }  
  133.     sets.midcast.Cure.Weather = set_combine(sets.midcast.Cure, {
  134.         main="Chatoyant Staff",
  135.         sub="Clerisy Strap +1",
  136.         waist="Hachirin-no-Obi",
  137.     })
  138.  
  139.     -- Afflatus Solace doesn't work on Curaga so there are some changes here.
  140.     sets.midcast.Curaga = set_combine(sets.midcast.Cure, {
  141.         body="Theophany Bliaut +3",
  142.     })
  143.     sets.midcast.Curaga.Weather = set_combine(sets.midcast.Curaga, {
  144.         main="Chatoyant Staff",
  145.         sub="Clerisy Strap +1",
  146.         waist="Hachirin-no-Obi",
  147.         back="Twilight Cape",
  148.     })
  149.  
  150.     -- Cure set with capped DT for nasty fights like V20+ Odyssey. "//gs c CureDT" to toggle.
  151.     sets.midcast.Cure.CureDT = set_combine(sets.midcast.Cure, {
  152.         ear2="Ebers Earring +1",
  153.         ammo="Staunch Tathlum +1",
  154.         feet="Ebers Duckbills +3",
  155.     })
  156.     sets.midcast.Cure.CureDT.Weather = set_combine(sets.midcast.Cure.CureDT, {
  157.         waist="Hachirin-no-Obi",
  158.     })
  159.  
  160.     -- Curaga set for CureDT
  161.     sets.midcast.Curaga.CureDT = set_combine(sets.midcast.Curaga, {
  162.         ear2="Ebers Earring +1",
  163.         ammo="Staunch Tathlum +1",
  164.         feet="Ebers Duckbills +3",
  165.     })
  166.     sets.midcast.Curaga.CureDT.Weather = set_combine(sets.midcast.Curaga.CureDT, {
  167.         waist="Hachirin-no-Obi",
  168.     })
  169.  
  170.     -- Cure set used for cure objective in Omen. Make sure it has 500HP more than your "aftercast.CureObjective" set.
  171.     sets.midcast.CureObjective = set_combine(sets.midcast.Cure, {
  172.         ear1="Tuisto Earring",
  173.         ear2="Odnowa Earring +1",
  174.         back="Moonlight Cape"
  175.     })
  176.  
  177.     -- For Raise recast
  178.     sets.midcast.HealingRecast = set_combine(sets.precast.FC, {
  179.         main="Asclepius",
  180.         sub="Genmei Shield",
  181.         back={ name="Alaunus's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','MND+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},
  182.     })
  183.  
  184.     -- Enhancing set with 500 skill
  185.     sets.midcast.Enhancing = {
  186.         main={ name="Gada", augments={'Enh. Mag. eff. dur. +6','DEX+1','Mag. Acc.+5','"Mag.Atk.Bns."+18','DMG:+4',}},
  187.         sub="Ammurapi Shield",
  188.         ammo="Pemphredo Tathlum",
  189.         head={ name="Telchine Cap", augments={'Mag. Evasion+24','"Conserve MP"+4','Enh. Mag. eff. dur. +10',}},
  190.         neck="Incanter's Torque",
  191.         ear1="Mimir Earring",
  192.         ear2="Andoaa Earring",
  193.         body={ name="Telchine Chas.", augments={'Mag. Evasion+25','"Conserve MP"+5','Enh. Mag. eff. dur. +10',}},
  194.         hands={ name="Telchine Gloves", augments={'Mag. Evasion+25','"Fast Cast"+5','Enh. Mag. eff. dur. +10',}},
  195.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  196.         ring2={name="Stikini Ring +1", bag="wardrobe4"},
  197.         back={ name="Mending Cape", augments={'Healing magic skill +10','Enha.mag. skill +7','Mag. Acc.+10',}},
  198.         waist="Embla Sash",
  199.         legs={ name="Telchine Braconi", augments={'Mag. Evasion+25','"Conserve MP"+4','Enh. Mag. eff. dur. +10',}},
  200.         feet="Theophany Duckbills +3"
  201.     }
  202.  
  203.     -- If you have to take out duration gear to hit 500 skill above, add the duration gear here for when skill isn't needed.
  204.     sets.midcast.EnhancingDuration = set_combine(sets.midcast.Enhancing, {
  205.     })
  206.  
  207.     -- Make sure this set has 500 skill as well.
  208.     sets.midcast.BarElement = set_combine(sets.midcast.Enhancing, {
  209.         main="Beneficus",
  210.         head="Ebers Cap +3",
  211.         body="Ebers Bliaut +3",
  212.         hands="Ebers Mitts +3",
  213.         back={ name="Alaunus's Cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','Enmity-10','Damage taken-5%',}},
  214.         legs="Piety Pantaloons +3",
  215.         feet="Ebers Duckbills +3"
  216.     })
  217.  
  218.     sets.midcast.BarAilment = set_combine(sets.midcast.Enhancing, {
  219.         neck="Sroda Necklace"
  220.     })
  221.  
  222.     sets.midcast.Regen = {
  223.         main="Bolelabunga",
  224.         sub="Ammurapi Shield",
  225.         head="Inyanga Tiara +2",
  226.         neck="Incanter's Torque",
  227.         body="Piety Bliaut +3",
  228.         hands="Ebers Mitts +3",
  229.         waist="Embla Sash",
  230.         legs="Theophany Pantaloons +3",
  231.         feet="Theophany Duckbills +3"
  232.     }
  233.  
  234.     sets.midcast.Stoneskin = set_combine(sets.midcast.EnhancingDuration, {
  235.         neck="Nodens Gorget",
  236.         ear2="Earthcry Earring",
  237.         waist="Siegel Sash"
  238.     })
  239.  
  240.     sets.midcast["Auspice"] = set_combine(sets.midcast.EnhancingDuration, {
  241.         feet="Ebers Duckbills +3"
  242.     })
  243.  
  244.     sets.midcast.Aquaveil = set_combine(sets.midcast.EnhancingDuration, {
  245.         main="Vadose Rod",
  246.         head="Chironic Hat",
  247.         waist="Emphatikos Rope",
  248.         --legs="Shedir Seraweels"
  249.     })
  250.  
  251.     sets.midcast.Enfeebling = {
  252.         main="Yagrush",
  253.         sub="Ammurapi Shield",
  254.         ammo="Hydrocera",
  255.         head="Theophany Cap +3",
  256.         neck="Erra Pendant",
  257.         ear1="Malignance Earring",
  258.         ear2="Regal Earring",
  259.         body="Theophany Bliaut +3",
  260.         hands="Kaykaus Cuffs +1",
  261.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  262.         ring2={name="Stikini Ring +1", bag="wardrobe4"},
  263.         back="Aurist's Cape +1",
  264.         waist="Obstinate Sash",
  265.         legs={ name="Chironic Hose", augments={'Mag. Acc.+23 "Mag.Atk.Bns."+23','Haste+1','MND+10','Mag. Acc.+7','"Mag.Atk.Bns."+11',}},
  266.         feet="Theophany Duckbills +3"
  267.     }
  268.  
  269.     -- This is a set I just use for Paralyze to maximize MND.
  270.     sets.midcast.EnfeeblingMND = set_combine(sets.midcast.Enfeebling, {
  271.         main="Daybreak",
  272.         waist="Luminary Sash"
  273.     })
  274.  
  275.     -- Used by all black magic enfeebs.
  276.     sets.midcast.EnfeeblingINT = set_combine(sets.midcast.Enfeebling, {
  277.         ammo="Pemphredo Tathlum",
  278.         waist="Acuity Belt +1"
  279.     })
  280.  
  281.     sets.midcast.Divine = set_combine(sets.midcast.Enfeebling, {
  282.         neck="Jokushu Chain"
  283.     })
  284.  
  285.     sets.midcast.NaSpell = set_combine(sets.precast.FC, {
  286.         main="Yagrush",
  287.         sub="Genmei Shield",
  288.         ammo="Staunch Tathlum +1",
  289.         head="Bunzi's Hat",
  290.         neck="Cleric's Torque +2",
  291.         body="Zendik Robe",
  292.         hands="Ebers Mitts +3",
  293.         ring2="Defending Ring",
  294.         feet="Nyame Sollerets"
  295.     })
  296.  
  297.     sets.midcast.Erase = set_combine(sets.midcast.NaSpell, {
  298.     })
  299.  
  300.     sets.midcast.Esuna = set_combine(sets.midcast.NaSpell, {
  301.         main="Asclepius"
  302.     })
  303.  
  304.     sets.midcast.Cursna = {
  305.         main="Yagrush",
  306.         sub="Genmei Shield",
  307.         ammo="Hasty Pinion +1",
  308.         head={ name="Vanya Hood", augments={'Healing magic skill +20','"Cure" spellcasting time -7%','Magic dmg. taken -3',}},
  309.         neck="Debilis Medallion",
  310.         ear1="Meili Earring",
  311.         ear2="Ebers Earring +1",
  312.         body="Ebers Bliaut +3",
  313.         hands="Fanatic Gloves",
  314.         ring1="Menelaus's Ring",
  315.         ring2="Haoma's Ring",
  316.         back={ name="Alaunus's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','MND+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},
  317.         waist="Bishop's Sash",
  318.         legs="Theophany Pantaloons +3",
  319.         feet={ name="Vanya Clogs", augments={'Healing magic skill +20','"Cure" spellcasting time -7%','Magic dmg. taken -3',}}
  320.     }
  321.  
  322.     sets.midcast.Elemental = {
  323.         main="Daybreak",
  324.         sub="Ammurapi Shield",
  325.         ammo="Pemphredo Tathlum",
  326.         head=empty,
  327.         neck="Sanctity Necklace",
  328.         ear1="Malignance Earring",
  329.         ear2="Regal Earring",
  330.         body="Cohort Cloak +1",
  331.         hands={ name="Chironic Gloves", augments={'Mag. Acc.+21 "Mag.Atk.Bns."+21','Spell interruption rate down -3%','MND+1','Mag. Acc.+8','"Mag.Atk.Bns."+14',}},
  332.         ring1="Freke Ring",
  333.         ring2="Shiva Ring +1",
  334.         back={ name="Alaunus's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','MND+10','"Mag.Atk.Bns."+10','Phys. dmg. taken-10%',}},
  335.         waist="Sacro Cord",
  336.         legs={ name="Kaykaus Tights +1", augments={'INT+12','"Mag.Atk.Bns."+20','Enmity-6',}},
  337.         feet={ name="Chironic Slippers", augments={'Mag. Acc.+24 "Mag.Atk.Bns."+24','"Cure" potency +3%','INT+5','"Mag.Atk.Bns."+12',}},
  338.     }
  339.  
  340.     sets.midcast.Elemental.Weather = set_combine(sets.midcast.Elemental, {
  341.         waist="Hachirin-no-Obi"
  342.     })
  343.  
  344.     -- Banish Potency against Undead ~ I think the cap for Banishga II is about +42%
  345.     sets.midcast.BanishPotency = set_combine(sets.midcast.Elemental.Weather, {
  346.         neck="Jokushu Chain",
  347.         hands="Fanatic Gloves",
  348.     })
  349.    
  350.     sets.midcast['Impact'] = set_combine(sets.midcast.Elemental, {  -- Make sure to leave the head empty --
  351.         head=empty,
  352.         body="Crepuscular Cloak",
  353.         hands="Inyanga Dastanas +2",
  354.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  355.         ring2={name="Stikini Ring +1", bag="wardrobe4"},
  356.     })
  357.  
  358.     sets.midcast["Benediction"] = { body="Piety Bliaut +3" }
  359.  
  360.     sets.midcast["Protectra V"] = set_combine(sets.midcast.EnhancingDuration, {
  361.         ring2="Sheltered Ring"
  362.     })
  363.  
  364.     sets.midcast["Shellra V"] = set_combine(sets.midcast.EnhancingDuration, {
  365.         ring2="Sheltered Ring"
  366.     })
  367.  
  368.     sets.midcast["Dispelga"] = set_combine(sets.midcast.EnfeeblingINT, {
  369.         main="Daybreak",
  370.         sub="Ammurapi Shield"
  371.     })
  372.  
  373.     sets.midcast["Divine Caress"] = {
  374.         hands="Ebers Mitts +3",
  375.         back="Mending Cape"
  376.     }
  377.  
  378.     -- Base weaponskill set, use WSD for this since most stuff is single or double hit.
  379.     sets.midcast.Weaponskill = {
  380.         ammo="Oshasha's Treatise",
  381.         head="Nyame Helm",
  382.         neck="Cleric's Torque +2",
  383.         ear1="Ishvara Earring",
  384.         ear2="Telos Earring",
  385.         body="Nyame Mail",
  386.         hands="Nyame Gauntlets",
  387.         ring1="Epaminondas's Ring",
  388.         ring2="Metamorph Ring +1",
  389.         back={ name="Alaunus's Cape", augments={'MND+20','Accuracy+20 Attack+20','MND+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}},
  390.         waist="Grunfeld Rope",
  391.         legs="Nyame Flanchard",
  392.         feet="Nyame Sollerets"
  393.     }
  394.    
  395.     sets.midcast.Weaponskill.MAB = set_combine(sets.midcast.Weaponskill, {
  396.         neck="Sanctity Necklace",
  397.         ear1="Malignance Earring",
  398.         ear2="Regal Earring",
  399.         waist="Orpheus's Sash",
  400.     })
  401.  
  402.     -- 7 hits, no crit, fTP carries
  403.     sets.midcast["Realmrazer"] = set_combine(sets.midcast.Weaponskill, {
  404.         neck="Fotia Gorget",
  405.         ear1="Regal Earring",
  406.         ring1="Ilabrat Ring",
  407.         waist="Fotia Belt",
  408.     })
  409.  
  410.     -- 6 hits, crit WS, fTP carries
  411.     sets.midcast["Hexa Strike"] = set_combine(sets.midcast.Weaponskill, {
  412.         neck="Fotia Gorget",
  413.         ear1="Regal Earring",
  414.         ring1="Begrudging Ring",
  415.         feet="Ayanmo Gambieras +2",
  416.         waist="Fotia Belt",
  417.     })
  418.  
  419.     sets.midcast["Flash Nova"] = set_combine(sets.midcast.Weaponskill.MAB, {
  420.     })
  421.  
  422.     sets.midcast["Seraph Strike"] = set_combine(sets.midcast.Weaponskill.MAB, {
  423.     })
  424.  
  425.     -- Treasure Hunter set. Don't put anything in here except TH+ gear.
  426.     -- It overwrites slots in other sets when TH toggle is on (Ctrl+F10).
  427.     sets.midcast.TH = {
  428.         head="Volte Cap",
  429.         waist="Chaac Belt",
  430.         hands="Volte Bracers",
  431.         feet="Volte Boots"
  432.     }
  433.  
  434.     sets.aftercast = {}
  435.  
  436.     -- Idle set used when IdleMode is "Refresh"
  437.     sets.aftercast.Refresh = {
  438.         main="Mpaca's Staff",
  439.         sub="Oneiros Grip",
  440.         ammo="Homiliary",
  441.         head={ name="Chironic Hat", augments={'"Fast Cast"+2','"Refresh"+2','Mag. Acc.+18 "Mag.Atk.Bns."+18',}},
  442.         neck="Loricate Torque +1",
  443.         ear1="Moonshade Earring",
  444.         ear2="Etiolation Earring",
  445.         body="Ebers Bliaut +3",
  446.         hands={ name="Chironic Gloves", augments={'Pet: INT+10','AGI+12','"Refresh"+2','Accuracy+6 Attack+6',}},
  447.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  448.         ring2={name="Stikini Ring +1", bag="wardrobe4"},
  449.         back={ name="Alaunus's Cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','Enmity-10','Damage taken-5%',}},
  450.         waist="Carrier's Sash",
  451.         legs={ name="Chironic Hose", augments={'AGI+8','Pet: Mag. Acc.+14','"Refresh"+2','Accuracy+16 Attack+16','Mag. Acc.+15 "Mag.Atk.Bns."+15',}},
  452.         feet={ name="Chironic Slippers", augments={'Pet: INT+6','"Snapshot"+1','"Refresh"+2','Accuracy+12 Attack+12','Mag. Acc.+4 "Mag.Atk.Bns."+4',}}
  453.     }
  454.     sets.aftercast.Refresh.LowMP = set_combine(sets.aftercast.Refresh, {
  455.         waist="Fucho-no-obi",
  456.     })
  457.  
  458.     sets.aftercast.Avatar = set_combine(sets.aftercast.Refresh, {
  459.         waist="Avatar Belt",
  460.     })
  461.  
  462.     -- Used when IdleMode is "DT"
  463.     -- As much refresh as I can get while still having capped DT.
  464.     sets.aftercast.DT = set_combine(sets.aftercast.Refresh, {
  465.         main="Asclepius",
  466.         sub="Genmei Shield",
  467.         ammo="Staunch Tathlum +1",
  468.         ring2="Defending Ring"
  469.     })
  470.  
  471.     -- Used when IdleMode is "MEva" and also the main idle set when IdleMode is "Auto"
  472.     -- This is my favored idle set with capped DT and tons of magic evasion, but not much refresh.
  473.     sets.aftercast.MEva = set_combine(sets.aftercast.DT, {
  474.         main="Asclepius",
  475.         sub="Genmei Shield",
  476.         ammo="Staunch Tathlum +1",
  477.         head="Inyanga Tiara +2",
  478.         neck="Warder's Charm +1",
  479.         ear1="Sanare Earring",
  480.         ear2="Moonshade Earring",
  481.         body="Ebers Bliaut +3",
  482.         hands="Nyame Gauntlets",
  483.         ring1="Inyanga Ring",
  484.         ring2="Defending Ring",
  485.         back={ name="Alaunus's Cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','Enmity-10','Damage taken-5%',}},
  486.         waist="Carrier's Sash",
  487.         legs="Inyanga Shalwar +2",
  488.         feet="Inyanga Crackows +2"
  489.     })
  490.  
  491.     sets.aftercast.Shamash = set_combine(sets.aftercast.MEva, {
  492.         body="Shamash Robe"
  493.     })
  494.  
  495.     -- Used for CureObjective mode. If you plan to use that mode, ensure this set has 500HP less than "midcast.CureObjective".
  496.     sets.aftercast.CureObjective = set_combine(sets.aftercast.Refresh, {
  497.         ring2="Metamorph Ring +1",
  498.     })
  499.  
  500.     -- Used when IdleMode is "TP"
  501.     sets.aftercast.TP = {
  502.         ammo="Oshasha's Treatise",
  503.         head={ name="Chironic Hat", augments={'"Dual Wield"+3','INT+4','"Store TP"+5','Accuracy+2 Attack+2',}},
  504.         neck="Lissome Necklace",
  505.         ear1="Telos Earring",
  506.         ear2="Crep. Earring",
  507.         body="Nyame Mail",
  508.         hands="Bunzi's Gloves",
  509.         ring1={name="Chirich Ring +1", bag="wardrobe2"},
  510.         ring2={name="Chirich Ring +1", bag="wardrobe4"},
  511.         back={ name="Alaunus's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10','Phys. dmg. taken-10%',}},
  512.         waist="Ninurta's Sash",
  513.         legs={ name="Chironic Hose", augments={'Rng.Atk.+28','Accuracy+23','"Store TP"+6','Accuracy+17 Attack+17',}},
  514.         feet={ name="Chironic Slippers", augments={'"Dual Wield"+4','Rng.Acc.+21 Rng.Atk.+21','Quadruple Attack +3','Accuracy+17 Attack+17',}}
  515.     }
  516.    
  517.     sets.aftercast.DualWield = set_combine(sets.aftercast.TP, {
  518.         ear2="Suppanomimi",
  519.     })
  520.    
  521.     sets.aftercast.Hybrid = set_combine(sets.aftercast.TP, {
  522.         ammo="Staunch Tathlum +1",
  523.         head="Nyame Helm",
  524.         legs="Nyame Flanchard",
  525.         feet="Nyame Sollerets"
  526.     })
  527.    
  528.     sets.aftercast.HybridDW = set_combine(sets.aftercast.DT, {})
  529.    
  530.     sets.aftercast.HybridDW.Engaged = set_combine(sets.aftercast.Hybrid, {
  531.         ear2="Suppanomimi",
  532.         feet={ name="Chironic Slippers", augments={'"Dual Wield"+4','Rng.Acc.+21 Rng.Atk.+21','Quadruple Attack +3','Accuracy+17 Attack+17',}}
  533.     })
  534.  
  535.     -- Used when IdleMode is "KC". I try to eliminate double attack here since it's bad with Kraken Club.
  536.     sets.aftercast.KC = set_combine(sets.aftercast.TP, {
  537.         neck="Combatant's Torque",
  538.         ear2="Suppanomimi",
  539.         body="Ebers Bliaut +3",
  540.         hands="Gazu Bracelets +1",
  541.         waist="Goading Belt",
  542.     })
  543.  
  544.     -- ===================================================================================================================
  545.     --      End of Sets
  546.     -- ===================================================================================================================
  547.  
  548.     NaSpells = S{"Blindna","Erase","Paralyna","Poisona","Silena","Stona","Viruna"}
  549.     BarElement = S{"Barfira","Barstonra","Barwatera","Baraera","Barblizzara","Barthundra"}
  550.     EnhancingSpells = S{"Boost-STR","Boost-DEX","Boost-VIT","Boost-AGI","Boost-INT","Boost-MND","Boost-CHR"}
  551.     EnfeeblingMND = S{"Paralyze"}
  552. end
  553.  
  554. function precast(spell)
  555.     --if midaction() then
  556.         --cancel_spell()
  557.         --return
  558.     --end
  559.     if spell.type=="Item" then
  560.         return
  561.     end
  562.     -- Spell fast cast
  563.     if spell.action_type=="Magic" then
  564.         if sets.precast[spell.english] then
  565.             equip(sets.precast[spell.english])
  566.         elseif spell.skill=="Enhancing Magic" then
  567.             equip(sets.precast.FC_Enhancing)
  568.         elseif string.find(spell.name,"Cure") or string.find(spell.name,"Curaga") then
  569.             equip(sets.precast.FC_Cure)
  570.         elseif NaSpells:contains(spell.name) or spell.name=="Cursna" then
  571.             equip(sets.precast.FC_Ailment)
  572.         else
  573.             equip(sets.precast.FC)
  574.         end
  575.     end
  576. end
  577.  
  578. function midcast(spell)
  579.     if spell.type=="Item" then
  580.         return
  581.     end
  582.     -- Check for a specific set
  583.     if sets.midcast[spell.english] then
  584.         equip(sets.midcast[spell.english])
  585.         if spell.name=="Cursna" and Gambanteinn then
  586.             equip({main="Gambanteinn"})
  587.         end
  588.     -- Specific Spells
  589.     elseif string.find(spell.name,"Cure") then
  590.         equipSet = sets.midcast.Cure
  591.         if CureObjective then
  592.             equipSet = sets.midcast.CureObjective
  593.         end
  594.         if CureDT and equipSet["CureDT"] then
  595.             equipSet = equipSet["CureDT"]
  596.         end
  597.         if (spell.element==world.weather_element or buffactive["Aurorastorm"]) and equipSet["Weather"] then
  598.             equipSet = equipSet["Weather"]
  599.         end
  600.         equip(equipSet)
  601.     elseif string.find(spell.name,"Cura") then
  602.         equipSet = sets.midcast.Curaga
  603.         if CureDT and equipSet["CureDT"] then
  604.             equipSet = equipSet["CureDT"]
  605.         end
  606.         if (spell.element==world.weather_element or buffactive["Aurorastorm"]) and equipSet["Weather"] then
  607.             equipSet = equipSet["Weather"]
  608.         end
  609.         equip(equipSet)
  610.     elseif NaSpells:contains(spell.name) then
  611.         equip(sets.midcast.NaSpell)
  612.     elseif string.find(spell.name,"Regen") then
  613.         equip(sets.midcast.Regen)
  614.     elseif string.sub(spell.name,1,3)=="Bar" then
  615.         if BarElement:contains(spell.name) then
  616.             equip(sets.midcast.BarElement)
  617.         else
  618.             equip(sets.midcast.BarAilment)
  619.         end
  620.     -- Spells by Type/Skill
  621.     elseif spell.skill=="Enfeebling Magic" then
  622.         equipSet = sets.midcast.Enfeebling
  623.         if EnfeeblingMND:contains(spell.name) then
  624.             equipSet = sets.midcast.EnfeeblingMND
  625.         elseif spell.type=="BlackMagic" then
  626.             equipSet = sets.midcast.EnfeeblingINT
  627.         end
  628.         if CureDT and equipSet["CureDT"] then
  629.             equipSet = equipSet["CureDT"]
  630.         end
  631.         equip(equipSet)
  632.     elseif spell.skill=="Enhancing Magic" then
  633.         equipSet = sets.midcast.EnhancingDuration
  634.         if EnhancingSpells:contains(spell.name) then
  635.             equipSet = sets.midcast.Enhancing
  636.         end
  637.         if CureDT and equipSet["CureDT"] then
  638.             equipSet = equipSet["CureDT"]
  639.         end
  640.         equip(equipSet)
  641.     elseif spell.skill=="Divine Magic" then
  642.         if spell.name=="Repose" then
  643.             equip(sets.midcast.Divine)
  644.         else
  645.             if BanishPotency and string.sub(spell.name,1,6)=="Banish" then
  646.                 equip(sets.midcast.BanishPotency)
  647.             else
  648.                 equipSet = sets.midcast.Elemental
  649.                 if spell.element == world.weather_element or spell.element == world.day_element and equipSet["Weather"] then
  650.                     equipSet = equipSet["Weather"]
  651.                 end
  652.                 equip(equipSet)
  653.             end
  654.         end
  655.     elseif spell.skill=="Healing Magic" then
  656.         equip(sets.midcast.HealingRecast)
  657.     elseif spell.type=="WeaponSkill" then
  658.         equip(sets.midcast.Weaponskill)
  659.     elseif spell.type=="BloodPactWard" or spell.type=="BloodPactRage" then
  660.         equip(sets.precast.BP)
  661.     else
  662.         idle()
  663.     end
  664.     -- Treasure Hunter
  665.     if TreasureHunter and THSpells:contains(spell.name) then
  666.         equip(sets.midcast.TH)
  667.     end
  668.     -- Auto-cancel existing buffs
  669.     if spell.name=="Stoneskin" and buffactive["Stoneskin"] then
  670.         windower.send_command('cancel 37;')
  671.     elseif spell.name=="Sneak" and buffactive["Sneak"] and spell.target.type=="SELF" then
  672.         windower.send_command('cancel 71;')
  673.     elseif spell.name=="Utsusemi: Ichi" and buffactive["Copy Image"] then
  674.         windower.send_command('wait 1;cancel 66;')
  675.     end
  676. end
  677.  
  678. function aftercast(spell)
  679.     if spell.type=="Item" then
  680.         return
  681.     end
  682.     idle()
  683. end
  684.  
  685. function status_change(new,old)
  686.     idle()
  687. end
  688.  
  689. function buff_change(name,gain)
  690.     -- Auto-wakeup
  691.     if name=="sleep" and gain then
  692.         if not buffactive["Sublimation: Activated"] then
  693.             equip(sets.WakeUp)
  694.         end
  695.         if buffactive["Stoneskin"] then
  696.             windower.send_command('cancel 37;')
  697.         end
  698.     end
  699. end
  700.  
  701. function self_command(command)
  702.     is_valid = command:lower()=="idle"
  703.  
  704.     if IdleModeCommands:contains(command) then
  705.         IdleMode = command
  706.         is_valid = true
  707.         send_command('console_echo "Idle Mode: '..IdleMode..'"')
  708.     elseif command:lower()=="cycleidle" then
  709.         if IdleMode=="Auto" then
  710.             IdleMode = "DT"
  711.         elseif IdleMode=="DT" then
  712.             IdleMode = "Refresh"
  713.         elseif IdleMode=="Refresh" then
  714.             IdleMode = "MEva"
  715.         else
  716.             IdleMode = "Auto"
  717.         end
  718.         is_valid = true
  719.         send_command('console_echo "Idle Mode: '..IdleMode..'"')
  720.     elseif command:lower()=="weaponlock" then
  721.         if WeaponLock then
  722.             enable("main","sub","range")
  723.             IdleMode = "Auto"
  724.             WeaponLock = false
  725.         else
  726.             disable("main","sub","range")
  727.             IdleMode = "Hybrid"
  728.             WeaponLock = true
  729.         end
  730.         is_valid = true
  731.         send_command('console_echo "Idle Mode: '..IdleMode..'"')
  732.         send_command('console_echo "Weapon Lock: '..tostring(WeaponLock)..'"')
  733.     elseif command:lower()=="accmode" then
  734.         AccMode = AccMode==false
  735.         send_command('console_echo "Acc Mode: '..tostring(AccMode)..'"')
  736.         is_valid = true
  737.     elseif command:lower()=="banishpot" then
  738.         BanishPotency = BanishPotency==false
  739.         send_command('console_echo "Banish Potency Mode: '..tostring(BanishPotency)..'"')
  740.         is_valid = true
  741.     elseif command:lower()=="gamb" then
  742.         Gambanteinn = Gambanteinn==false
  743.         send_command('console_echo "Gambanteinn Cursna Mode: '..tostring(Gambanteinn)..'"')
  744.         is_valid = true
  745.     elseif command:lower()=="th" then
  746.         TreasureHunter = TreasureHunter==false
  747.         is_valid = true
  748.         send_command('console_echo "Treasure Hunter Mode: '..tostring(TreasureHunter)..'"')
  749.     elseif command:lower()=="cureobjective" then
  750.         CureObjective = CureObjective==false
  751.         send_command('console_echo "Cure Objective Mode: '..tostring(CureObjective)..'"')
  752.         is_valid = true
  753.     elseif command:lower()=="curedt" then
  754.         CureDT = CureDT==false
  755.         send_command('console_echo "Cure DT Mode: '..tostring(CureDT)..'"')
  756.         is_valid = true
  757.     end
  758.  
  759.     if is_valid then
  760.         if (not midaction() and not pet_midaction()) or command:lower()=="idle" then
  761.             idle()
  762.         end
  763.     else
  764.         sanitized = command:gsub("\"", "")
  765.         send_command('console_echo "Invalid self_command: '..sanitized..'"')
  766.     end
  767. end
  768.  
  769. function idle()
  770.     if IdleMode=='Auto' then
  771.         if player.mpp < 50 then
  772.             equip(sets.aftercast.Refresh.LowMP)
  773.         elseif player.mpp < 70 then
  774.             equip(sets.aftercast.DT)
  775.         else
  776.             equip(sets.aftercast.MEva)
  777.         end
  778.     else
  779.         equipSet = sets.aftercast
  780.         if equipSet[IdleMode] then
  781.             equipSet = equipSet[IdleMode]
  782.         end
  783.         if equipSet[player.status] then
  784.             equipSet = equipSet[player.status]
  785.         end
  786.         if player.mpp < 50 and equipSet["LowMP"] then
  787.             equipSet = equipSet["LowMP"]
  788.         end
  789.         equip(equipSet)
  790.     end
  791.  
  792.     if (buffactive["Sneak"] or buffactive["Invisible"] or buffactive["Bolter's Roll"]) and IdleMode~='DT' then
  793.         equip(sets.Movement)
  794.     end
  795.     -- Balrahn's Ring
  796.     --if Salvage:contains(world.area) then
  797.     --  equip({ring2="Balrahn's Ring"})
  798.     --end
  799.     -- Maquette Ring
  800.     --if world.area=='Maquette Abdhaljs-Legion' and not IdleMode=='DT' then
  801.     --  equip({ring2="Maquette Ring"})
  802.     --end
  803.  
  804.     -- CureObjective Mode takes precedence over everything else
  805.     if CureObjective then
  806.         equip(sets.aftercast.CureObjective)
  807.     end
  808.     -- Wake up if slept
  809.     if buffactive["Sleep"] then
  810.         if not buffactive["Sublimation: Activated"] then
  811.             equip(sets.WakeUp)
  812.         end
  813.     end
  814. end
Add Comment
Please, Sign In to add comment