Pergatory

Pergatory's WHM Gearswap

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