Pergatory

Pergatory's RUN Gearswap

Jan 29th, 2017 (edited)
4,351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 36.60 KB | None | 0 0
  1. -- When engaged:
  2. -- TPMode determines aftercast set used. F9 will toggle between TP, MidHybrid, and Hybrid modes.
  3. -- Other modes may be accessed with "/console gs c TP <mode>"
  4.  
  5. -- When disengaged:
  6. -- IdleMode determines aftercast set used. F10 will toggle between DT, Kite, and Regain modes.
  7. -- Other modes may be accessed with "/console gs c Idle <mode>"
  8.  
  9. -- Some modes can be applied to both at once by not specifying "TP" or "Idle".
  10. -- For example: "/console gs c DT" or "/console gs c Kite"
  11. -- It is recommended to have "/console gs c DT" on a macro/bind for quickly going full DT.
  12.  
  13.  
  14. -- Applying Runes:
  15. -- This Lua uses a flexible system to allow you to apply your chosen runes with a single macro.
  16. -- The macro to activate a rune is:
  17. --      /console gs c Rune
  18. -- To change your selected rune, add an element after the word "Rune".
  19. --      Choices: Fire Earth Water Wind Ice Thunder Light Dark
  20. -- **It is very important to capitalize the first letter and only the first letter.**
  21. -- For example:
  22. --      /console gs c RuneFire
  23. --      /console gs c Rune Fire
  24. -- This will set your rune configuration to [Fire - Fire - Fire] indicating 3x Ignis runes.
  25.  
  26. -- You only need to set the elements once. After that, calling "gs c Rune" will cycle through them.
  27.  
  28. -- You may select up to 3 elements to cycle. For example:
  29. --      /console gs c RuneEarthWindIce
  30. --      /console gs c Rune Earth Wind Ice
  31.  
  32. function file_unload()
  33.     send_command('unbind f9')
  34.     send_command('unbind f10')
  35.     send_command('unbind f11')
  36.     send_command('unbind f12')
  37.     send_command('unbind ^f10')
  38.     send_command('unbind ^f11')
  39.     send_command('unbind ^f12')
  40.     send_command('unbind !f12')
  41. end
  42. function get_sets()
  43.     send_command('bind f9 gs c ToggleTP') -- F9 = Toggle TP Set (Used when engaged)
  44.     send_command('bind f10 gs c ToggleIdle') -- F10 = Toggle Idle Set (Used when not engaged)
  45.     send_command('bind f11 input /item "Panacea" <me>')
  46.     send_command('bind f12 input /item "Holy Water" <me>')
  47.     send_command('bind ^f10 gs c TH') -- Ctrl+F10 = Treasure Hunter toggle
  48.     send_command('bind ^f11 gs c Turms') -- Ctrl+F11 = Turms toggle for parry healing
  49.     send_command('bind ^f12 input /item "Remedy" <me>')
  50.     send_command('bind !f12 gs equip midcast.Phalanx') -- Alt+F12 to equip Phalanx gear when it's being cast on you
  51.  
  52.     StartLockStyle = '89'
  53.     TPMode = 'DT'
  54.     IdleMode = 'Kite'
  55.     AccMode = false -- "/console gs c Acc"
  56.     LowHate = false -- "/console gs c LowHate" - I use this to take Enmity+ out of my JA sets when I don't want a lot of hate.
  57.     Turms = false -- "/console gs c Turms" - This mode favors more parry healing when engaged
  58.     TH = false -- "/console gs TH" to engage & cast in TH gear
  59.     Announcements = true -- Announce Gambit & Rayke elements to the party (uses your first rune's element)
  60.     Rune_ind = 1
  61.     Rune = {}
  62.     Rune[1] = 'Dark'
  63.     Rune[2] = 'Dark'
  64.     Rune[3] = 'Dark'
  65.     ResistAilments = false
  66.     ResistStun = false
  67.     ResistPara = false
  68.     ResistSilence = false
  69.     ResistDeath = false
  70.     ResistCharm = false
  71.    
  72.     TPModeCommands = {'DT','TP','MidHybrid','Hybrid','HybridFull','Kite','Sword','Regain','SB'}
  73.     IdleModeCommands = {'DT','Kite','KiteRegain','Regain','Refresh','MEva','Def','MDB'}
  74.  
  75.     TownIdle = S{"windurst woods","windurst waters","windurst walls","port windurst","bastok markets","bastok mines","port bastok","southern san d'oria","northern san d'oria","port san d'oria","upper jeuno","lower jeuno","port jeuno","ru'lude gardens","norg","kazham","tavnazian safehold","rabao","selbina","mhaura","aht urhgan whitegate","al zahbi","nashmau","western adoulin","eastern adoulin"}
  76.     Escha = S{"escha - zi'tah","escha - ru'aun","reisenjima"}
  77.     EnhancingSkillSpells = S{"Temper","Barfire","Barblizzard","Baraero","Barstone","Barthunder","Barwater"}
  78.     InterruptSpells = S{"Cocoon","Geist Wall","Sheep Song","Healing Breeze","Aquaveil","Sleepga","Poisonga"}
  79.     MAccWeaponskills = S{"Weapon Break","Armor Break"}
  80.  
  81.     macrobook = 2
  82.     macroset = 1
  83.     if player.sub_job=='WAR' then
  84.         macrobook = 1
  85.     elseif player.sub_job=='NIN' then
  86.         macrobook = 3
  87.     elseif player.sub_job=='SAM' then
  88.         macrobook = 15
  89.     elseif player.sub_job=='DRK' then
  90.         macrobook = 14
  91.     elseif player.sub_job=='SCH' then
  92.         macrobook = 17
  93.     elseif player.sub_job=='WHM' then
  94.         macrobook = 19
  95.     end
  96.     send_command('input /macro book '..macrobook..';wait .1;input /macro set '..macroset..';wait 3;input /lockstyleset '..StartLockStyle)
  97.     send_command('console_echo "Panacea: F11 ~~ Holy Water: F12 ~~ TreasureHunter: Ctrl+F10 ~~ Turms: Ctrl+F11"')
  98.     send_command('console_echo "Rune Mode: ['..Rune[1]..' - '..Rune[2]..' - '..Rune[3]..']"')
  99.     send_command('console_echo "TP Mode: ['..TPMode..'] ~ Idle Mode: ['..IdleMode..']"')
  100.  
  101.     -- This is your full defense set. It will be used as a baseline for several other sets.
  102.     -- It's ok for this set to be overcapped on DT, because sets that inherit it may override slots and lose DT.
  103.     sets.DT_Base = {
  104.         ammo="Yamarang",
  105.         head="Nyame Helm",
  106.         neck="Futhark Torque +2",
  107.         ear1="Odnowa Earring +1",
  108.         ear2="Tuisto Earring",
  109.         body="Adamantite Armor",
  110.         hands="Nyame Gauntlets",
  111.         ring1={name="Moonlight Ring", bag="wardrobe2"},
  112.         ring2="Defending Ring",
  113.         back={ name="Ogma's Cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','Enmity+10','DEF+50',}},
  114.         waist="Engraved Belt",
  115.         legs="Erilaz Leg Guards +3",
  116.         feet="Erilaz Greaves +3"
  117.     }
  118.  
  119.     -- Max HP set, mostly just used for One for All
  120.     sets.HP_Base = {
  121.         ammo="Happy Egg",
  122.         head="Erilaz Galea +3",
  123.         neck="Unmoving Collar +1",
  124.         ear1="Odnowa Earring +1",
  125.         ear2="Tuisto Earring",
  126.         body="Runeist Coat +3",
  127.         hands="Regal Gauntlets",
  128.         ring1="Gelatinous Ring +1",
  129.         ring2={name="Moonlight Ring", bag="wardrobe4"},
  130.         back="Moonlight Cape",
  131.         waist="Platinum Moogle Belt",
  132.         legs="Carmine Cuisses +1",
  133.         feet="Carmine Greaves +1"
  134.     }
  135.    
  136.     -- Base Magic Attack Bonus set, for elemental weaponskills, Lunge, and Swipe
  137.     sets.MAB_Base = {
  138.         ammo="Seething Bomblet +1",
  139.         head="Agwu's Cap",
  140.         neck="Sanctity Necklace",
  141.         ear1="Friomisi Earring",
  142.         ear2="Crematio Earring",
  143.         body="Agwu's Robe",
  144.         hands="Agwu's Gages",
  145.         ring1="Mujin Band",
  146.         ring2="Shiva Ring +1",
  147.         back="Evasionist's Cape",
  148.         waist="Orpheus's Sash",
  149.         legs="Agwu's Slops",
  150.         feet="Agwu's Pigaches"
  151.     }
  152.  
  153.     -- Pure accuracy set currently only used for Box Step, but could be used elsewhere.
  154.     sets.Acc_Base = {
  155.         ammo="Cath Palug Stone",
  156.         head="Rune. Bandeau +3",
  157.         body="Runeist Coat +3",
  158.         hands="Runeist Mitons +3",
  159.         legs="Erilaz Leg Guards +3",
  160.         feet="Erilaz Greaves +3",
  161.         neck="Sanctity Necklace",
  162.         waist="Eschan Stone",
  163.         ear1="Zennaroi Earring",
  164.         ear2="Telos Earring",
  165.         ring1="Regal Ring",
  166.         ring2="Varar Ring +1",
  167.         back={ name="Ogma's cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10','Phys. dmg. taken-10%',}},
  168.     }
  169.  
  170.     -- Treasure Hunter set. Don't put anything in here except TH+ gear.
  171.     -- It overwrites several other sets when TH toggle is on (Ctrl+F10).
  172.     sets.TH = {
  173.         head="Volte Cap",
  174.         waist="Chaac Belt",
  175.         hands="Volte Bracers",
  176.         feet="Volte Boots"
  177.     }
  178.    
  179.     sets.HolyWater = {
  180.         neck="Nicander's Necklace",
  181.         ring2="Purity Ring"
  182.     }
  183.  
  184.     -- ************************************************************************
  185.     --                               Precast
  186.     -- ************************************************************************
  187.  
  188.     sets.precast = {}
  189.  
  190.     -- I aim for 70 FC with 1 merit in Inspiration for this set
  191.     sets.precast.FC = {
  192.         ammo="Sapience Orb", -- +2
  193.         head="Runeist Bandeau +3", -- +14
  194.         neck="Orunmila's Torque", -- +5
  195.         ear1="Loquacious Earring", -- +2
  196.         ear2="Etiolation Earring", -- +1
  197.         body={ name="Adhemar Jacket +1", augments={'HP+105','"Fast Cast"+10','Magic dmg. taken -4',}}, -- +10
  198.         hands="Leyline Gloves", -- +8
  199.         ring1={name="Moonlight Ring", bag="wardrobe2"},
  200.         ring2="Kishar Ring", -- +4
  201.         back={ name="Ogma's cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','HP+20','"Fast Cast"+10','Spell interruption rate down-10%',}}, -- +10
  202.         waist={ name="Platinum Moogle Belt", priority=12 },
  203.         legs="Ayanmo Cosciales +2", -- +6
  204.         feet={ name="Carmine Greaves +1", priority=11 } -- +8
  205.     }
  206.  
  207.     sets.precast.FC_Enhancing = set_combine(sets.precast.FC, {
  208.         waist="Siegel Sash",
  209.         legs="Futhark Trousers +3"
  210.     })
  211.    
  212.     sets.precast.FC_Utsusemi = sets.precast.FC
  213.  
  214.     -- ************************************************************************
  215.     --                           Midcast - Spells
  216.     -- ************************************************************************
  217.  
  218.     sets.midcast = {}
  219.  
  220.     sets.midcast.Enhancing = set_combine(sets.DT_Base, {
  221.         head="Erilaz Galea +3",
  222.         neck="Incanter's Torque",
  223.         ear1="Mimir Earring",
  224.         ear2="Andoaa Earring",
  225.         hands="Runeist Mitons +3",
  226.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  227.         ring2={name="Stikini Ring +1", bag="wardrobe4"},
  228.         back="Merciful Cape",
  229.         waist="Olympus Sash",
  230.         legs="Futhark Trousers +3"
  231.     })
  232.  
  233.     sets.midcast.EnhancingDuration = set_combine(sets.midcast.Enhancing, {
  234.         hands="Regal Gauntlets"
  235.     })
  236.  
  237.     sets.midcast.Regen = set_combine(sets.midcast.EnhancingDuration, {
  238.         head="Rune. Bandeau +3",
  239.         neck="Sacro Gorget",
  240.         ear2="Erilaz Earring +1",
  241.         ring1={name="Moonlight Ring", bag="wardrobe2"},
  242.         ring2={name="Moonlight Ring", bag="wardrobe4"},
  243.         waist="Sroda Belt"
  244.     })
  245.  
  246.     sets.midcast.Divine = set_combine(sets.DT_Base, {
  247.         neck="Incanter's Torque",
  248.         ear1="Beatific Earring",
  249.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  250.         ring2={name="Stikini Ring +1", bag="wardrobe4"},
  251.         waist="Olympus Sash",
  252.         legs="Runeist Trousers +3"
  253.     })
  254.  
  255.     sets.midcast.Enmity = {
  256.         ammo={ name="Sapience Orb", }, -- +2
  257.         head={ name="Halitus Helm", }, -- +8
  258.         neck={ name="Futhark Torque +2", }, -- +10 (moonlight has +15 but no DT)
  259.         ear1={ name="Trux Earring", }, -- +5
  260.         ear2={ name="Cryptic Earring", }, -- +4
  261.         body={ name="Emet Harness +1", }, -- +10
  262.         hands={ name="Kurys Gloves", }, -- +9
  263.         ring1={ name="Moonlight Ring", bag="wardrobe2" },
  264.         ring2={ name="Eihwaz Ring", priority=1 }, -- +5
  265.         back={ name="Ogma's Cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','Enmity+10','DEF+50',}}, -- +10
  266.         --waist={ name="Trance Belt", }, -- +4
  267.         waist={ name="Platinum Moogle Belt" },
  268.         legs={ name="Erilaz Leg Guards +3" }, -- +13
  269.         feet={ name="Erilaz Greaves +3", } -- +7
  270.     }
  271.  
  272.     sets.midcast.LowHate = {
  273.         ammo="Yamarang",
  274.         head="Nyame Helm",
  275.         neck="Loricate Torque +1",
  276.         ear1="Odnowa Earring +1",
  277.         ear2="Tuisto Earring",
  278.         body="Nyame Mail",
  279.         hands="Nyame Gauntlets",
  280.         ring1={name="Moonlight Ring", bag="wardrobe2"},
  281.         ring2="Defending Ring",
  282.         back={ name="Ogma's cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','HP+20','"Fast Cast"+10','Spell interruption rate down-10%',}},
  283.         waist="Engraved Belt",
  284.         legs="Nyame Flanchard",
  285.         feet="Nyame Sollerets"
  286.     }
  287.  
  288.     sets.midcast.Interrupt = {
  289.         ammo="Staunch Tathlum +1",
  290.         head="Erilaz Galea +3",
  291.         neck="Moonlight Necklace",
  292.         ear1="Odnowa Earring +1",
  293.         ear2="Tuisto Earring",
  294.         body="Nyame Mail",
  295.         hands="Rawhide Gloves",
  296.         ring1={name="Moonlight Ring", bag="wardrobe2"},
  297.         ring2="Defending Ring",
  298.         back={ name="Ogma's cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','HP+20','"Fast Cast"+10','Spell interruption rate down-10%',}},
  299.         waist="Audumbla Sash",
  300.         legs="Carmine Cuisses +1",
  301.         feet="Erilaz Greaves +3"
  302.     }
  303.  
  304.     sets.midcast["Flash"] = set_combine(sets.midcast.Enmity, { })
  305.     sets.midcast["Foil"] = set_combine(sets.midcast.Enmity, { })
  306.     sets.midcast["Foil"].LowHate = set_combine(sets.midcast.LowHate, { })
  307.  
  308.     -- Phalanx tiers: 443 472 500
  309.     -- I don't recommend shooting for 500 unless you have 30+ MLs. It's good to have some HP & DT in this set.
  310.     sets.midcast["Phalanx"] = set_combine(sets.midcast.Enhancing, {
  311.         head="Futhark Bandeau +3",
  312.         neck="Futhark Torque +2",
  313.         body={ name="Taeon Tabard", augments={'Mag. Evasion+20','Spell interruption rate down -10%','Phalanx +3',}},
  314.         hands={ name="Taeon Gloves", augments={'Mag. Evasion+20','Enemy crit. hit rate -3','Phalanx +3',}},
  315.         --ring1={name="Moonlight Ring", bag="wardrobe2"},
  316.         legs={ name="Herculean Trousers", augments={'MND+8','DEX+5','Phalanx +5','Accuracy+12 Attack+12','Mag. Acc.+2 "Mag.Atk.Bns."+2',}},
  317.         back={ name="Moonlight Cape", priority=1},
  318.         waist={ name="Platinum Moogle Belt", priority=2 },
  319.         feet={ name="Taeon Boots", augments={'Mag. Evasion+20','Spell interruption rate down -10%','Phalanx +3',}}
  320.     })
  321.  
  322.     sets.midcast["Refresh"] = set_combine(sets.midcast.EnhancingDuration, {
  323.         head="Erilaz Galea +3",
  324.         waist="Gishdubar Sash"
  325.     })
  326.  
  327.     sets.midcast["Stoneskin"] = set_combine(sets.DT_Base, {
  328.         ear2="Earthcry Earring",
  329.         neck="Stone Gorget",
  330.         waist="Siegel Sash"
  331.     })
  332.  
  333.     sets.midcast.Cure = set_combine(sets.DT_Base, {
  334.         ammo="Hasty Pinion +1",
  335.         neck="Sacro Gorget",
  336.         --ear1="Meili Earring",
  337.         --ear2="Beatific Earring",
  338.         body="Nyame Mail", -- for the haste
  339.         hands="Agwu's Gages",
  340.         ring1="Menelaus's Ring",
  341.         ring2={name="Stikini Ring +1", bag="wardrobe4"},
  342.         --back="Tempered Cape +1",
  343.         back="Moonlight Cape",
  344.         waist="Sroda Belt",
  345.     })
  346.  
  347.     sets.midcast.CuringWaltz = {
  348.     }
  349.  
  350.     sets.midcast["Absorb-TP"] = {
  351.         ammo="Yamarang",
  352.         head="Erilaz Galea +3",
  353.         neck="Erra Pendant",
  354.         ear1="Dignitary's Earring",
  355.         ear2="Mani Earring",
  356.         body="Nyame Mail",
  357.         hands="Nyame Gauntlets",
  358.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  359.         ring2={name="Stikini Ring +1", bag="wardrobe4"},
  360.         back="Moonlight Cape",
  361.         waist="Acuity Belt +1",
  362.         legs="Erilaz Leg Guards +3",
  363.         feet="Agwu's Pigaches"
  364.     }
  365.  
  366.     -- ************************************************************************
  367.     --                        Midcast - Weapon Skills
  368.     -- ************************************************************************
  369.  
  370.     -- Main WS set - I based mine on Dimidiation
  371.     sets.midcast.Weaponskill = {
  372.         ammo="Knobkierrie",
  373.         head="Nyame Helm",
  374.         neck="Fotia Gorget",
  375.         ear1="Sherida Earring",
  376.         ear2="Ishvara Earring",
  377.         body="Nyame Mail",
  378.         hands="Nyame Gauntlets",
  379.         ring1="Regal Ring",
  380.         ring2="Epaminondas's Ring",
  381.         back={ name="Ogma's cape", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','Weapon skill damage +10%','Phys. dmg. taken-10%',}},
  382.         waist="Fotia Belt",
  383.         legs="Nyame Flanchard",
  384.         feet="Nyame Sollerets"
  385.     }
  386.  
  387.     sets.midcast.Weaponskill_Acc = set_combine(sets.midcast.Weaponskill, {
  388.         ammo="Cath Palug Stone",
  389.         head="Erilaz Galea +3",
  390.         neck="Combatant's Torque",
  391.         ear1="Zennaroi Earring",
  392.         ear2="Telos Earring",
  393.         body="Erilaz Surcoat +3",
  394.         hands="Runeist Mitons +3",
  395.         ring2="Chirich Ring +1",
  396.         back={ name="Ogma's cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10','Phys. dmg. taken-10%',}},
  397.         legs="Erilaz Leg Guards +3",
  398.         feet="Erilaz Greaves +3",
  399.     })
  400.    
  401.     sets.midcast.MagicWeaponskill = set_combine(sets.midcast.Weaponkill, {
  402.         neck="Sanctity Necklace",
  403.         ear1="Friomisi Earring",
  404.         ring1="Regal Ring",
  405.         waist="Orpheus's Sash",
  406.     })
  407.  
  408.     sets.midcast.MAccWeaponskill = set_combine(sets.midcast.Weaponskill, {
  409.         ear1="Dignitary's Earring",
  410.     })
  411.  
  412.     sets.midcast["Dimidiation"] = set_combine(sets.midcast.Weaponskill, {
  413.         neck="Republican Platinum Medal",
  414.         ring1="Ilabrat Ring",
  415.         waist="Grunfeld Rope",
  416.     })
  417.     sets.midcast["Dimidiation"].Acc = set_combine(sets.midcast.Weaponskill_Acc, {})
  418.  
  419.     sets.midcast["Resolution"] = set_combine(sets.midcast.Weaponskill, {
  420.         ammo="Knobkierrie",
  421.         neck="Fotia Gorget",
  422.         ear2="Cessance Earring",
  423.         ring1="Regal Ring",
  424.         ring2="Niqmaddu Ring",
  425.         back={ name="Ogma's cape", augments={'STR+20','Accuracy+20 Attack+20','STR+10','"Dbl.Atk."+10','Phys. dmg. taken-10%',}},
  426.         waist="Fotia Belt",
  427.     })
  428.     sets.midcast["Resolution"].Acc = set_combine(sets.midcast.Weaponskill_Acc, {})
  429.  
  430.     sets.midcast["Herculean Slash"] = set_combine(sets.MagicWeaponskill, {
  431.         ring2="Epaminondas's Ring",
  432.     })
  433.  
  434.     sets.midcast["Shockwave"] = set_combine(sets.MAccWeaponskill, {
  435.     })
  436.  
  437.     sets.midcast["Savage Blade"] = set_combine(sets.midcast.Weaponskill, {
  438.         neck="Futhark Torque +2",
  439.         ring1="Sroda Ring",
  440.         waist="Engraved Belt",
  441.     })
  442.     sets.midcast["Savage Blade"].Acc = set_combine(sets.midcast.Weaponskill_Acc, {})
  443.  
  444.     sets.midcast["Ruinator"] = set_combine(sets.midcast.Weaponskill_Acc, {
  445.     })
  446.    
  447.     sets.midcast["Seraph Blade"] = set_combine(sets.DT_Base, {
  448.     })
  449.  
  450.     -- ************************************************************************
  451.     --                          Midcast - Named Sets
  452.     -- ************************************************************************
  453.  
  454.     -- JOB ABILITIES --
  455.     sets.midcast["Elemental Sforzo"] = set_combine(sets.midcast.Enmity, { body="Futhark Coat +3" })
  456.     sets.midcast["Elemental Sforzo"].LowHate = set_combine(sets.midcast.LowHate, { body="Futhark Coat +3" })
  457.  
  458.     sets.midcast["Gambit"] = set_combine(sets.midcast.Enmity, { hands="Runeist Mitons +3" })
  459.     sets.midcast["Gambit"].LowHate = set_combine(sets.midcast.LowHate, { hands="Runeist Mitons +3" })
  460.  
  461.     sets.midcast["Rayke"] = set_combine(sets.midcast.Enmity, { feet="Futhark Boots +3" })
  462.     sets.midcast["Rayke"].LowHate = set_combine(sets.midcast.LowHate, { feet="Futhark Boots +3" })
  463.  
  464.     sets.midcast["Liement"] = set_combine(sets.midcast.Enmity, { body="Futhark Coat +3" })
  465.     sets.midcast["Liement"].LowHate = set_combine(sets.midcast.LowHate, { body="Futhark Coat +3" })
  466.    
  467.     sets.midcast["One For All"] = sets.HP_Base
  468.  
  469.     sets.midcast["Valiance"] = set_combine(sets.DT_Base, {
  470.         body="Runeist Coat +3",
  471.         back={ name="Ogma's Cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','Enmity+10','DEF+50',}},
  472.         legs="Futhark Trousers +3"
  473.     })
  474.  
  475.     sets.midcast["Vallation"] = set_combine(sets.DT_Base, {
  476.         body="Runeist Coat +3",
  477.         back={ name="Ogma's Cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','Enmity+10','DEF+50',}},
  478.         legs="Futhark Trousers +3"
  479.     })
  480.  
  481.     sets.midcast["Pflug"] = set_combine(sets.midcast.Enmity, {})
  482.     sets.midcast["Pflug"].LowHate = set_combine(sets.midcast.LowHate, {})
  483.  
  484.     sets.midcast["Battuta"] = set_combine(sets.midcast.Enmity, { head="Futhark Bandeau +3" })
  485.     sets.midcast["Battuta"].LowHate = set_combine(sets.midcast.LowHate, { head="Futhark Bandeau +3" })
  486.  
  487.     sets.midcast["Vivacious Pulse"] = set_combine(sets.midcast.Divine, { head="Erilaz Galea +3" })
  488.  
  489.     sets.midcast["Embolden"] = { back="Evasionist's Cape" }
  490.  
  491.     sets.midcast["Swordplay"] = set_combine(sets.midcast.Enmity, { hands="Futhark Mitons +3" })
  492.     sets.midcast["Swordplay"].LowHate = set_combine(sets.midcast.LowHate, { hands="Futhark Mitons +3" })
  493.  
  494.     sets.midcast["Lunge"] = sets.MAB_Base
  495.  
  496.     sets.midcast["Swipe"] = sets.MAB_Base
  497.  
  498.     sets.midcast["Box Step"] = sets.Acc_Base
  499.  
  500.     sets.midcast.BP = {
  501.         legs={ name="Herculean Trousers", augments={'"Blood Pact" ability delay -6','MND+5','Crit.hit rate+2','Accuracy+12 Attack+12',}},
  502.     }
  503.  
  504.     -- ************************************************************************
  505.     --                               Aftercast
  506.     -- ************************************************************************
  507.     -- Syntax:  aftercast.Engaged.TPMode.Turms.Battuta.Acc.Resist.NoShell.Escha
  508.     --          aftercast.IdleMode.Resist.NoShell.Escha
  509.  
  510.     sets.aftercast = set_combine(sets.DT_Base, {
  511.         --body="Runeist Coat +3",
  512.         ring1="Gelatinous Ring +1",
  513.         ring2="Shadow Ring"
  514.     })
  515.    
  516.     sets.aftercast.MEva = set_combine(sets.aftercast, {
  517.         body="Runeist Coat +3",
  518.         ear1="Sanare Earring",
  519.     })
  520.    
  521.     sets.aftercast.Def = set_combine(sets.aftercast, {
  522.         ammo="Brigantia Pebble",
  523.         neck="Loricate Torque +1",
  524.         body="Adamantite Armor",
  525.         --ring2="Gelatinous Ring +1"
  526.     })
  527.    
  528.     sets.aftercast.MDB = set_combine(sets.aftercast, {
  529.         head="Erilaz Galea +3",
  530.         neck="Warder's Charm +1",
  531.         body="Adamantite Armor",
  532.         ear2="Sanare Earring",
  533.     })
  534.  
  535.     sets.aftercast.Kite = set_combine(sets.aftercast, {
  536.         ring2="Shneddick Ring +1",
  537.         --legs="Carmine Cuisses +1"
  538.     })
  539.  
  540.     sets.aftercast.Refresh = set_combine(sets.aftercast.Kite, {
  541.         ammo="Homiliary",
  542.         head="Rawhide Mask",
  543.         neck="Bathy Choker +1",
  544.         body="Runeist Coat +3",
  545.         hands="Regal Gauntlets",
  546.         ring1={name="Stikini Ring +1", bag="wardrobe2"},
  547.         ring2={name="Stikini Ring +1", bag="wardrobe4"},
  548.         waist="Flume Belt +1"
  549.     })
  550.  
  551.     sets.aftercast.Regain = set_combine(sets.aftercast, {
  552.         --ammo="Brigantia Pebble",
  553.         head="Turms Cap +1",
  554.         --ear2="Moonshade Earring",
  555.         body="Adamantite Armor",
  556.         --ring1="Karieyh Ring",
  557.         ring2="Shadow Ring",
  558.     })
  559.  
  560.     sets.aftercast.KiteRegain = set_combine(sets.aftercast.Kite, {
  561.         head="Turms Cap +1",
  562.         body="Adamantite Armor",
  563.         --ring2="Shadow Ring",
  564.     })
  565.  
  566.     -- Resist sets for when magic evasion just doesn't suffice
  567.     sets.aftercast.Resist = set_combine(sets.aftercast, {
  568.         ear2="Hearty Earring",
  569.         hands="Volte Bracers",
  570.         legs="Runeist Trousers +3"
  571.     })
  572.  
  573.     sets.aftercast.ResistCharm = set_combine(sets.aftercast, {
  574.         ammo="Staunch Tathlum +1",
  575.         neck="Unmoving Collar +1",
  576.         back="Solemnity Cape",
  577.         legs="Runeist Trousers +3",
  578.     })
  579.  
  580.     sets.aftercast.ResistDeath = set_combine(sets.aftercast, {
  581.         ammo="Staunch Tathlum +1",
  582.         ring1="Warden's Ring",
  583.         ring2="Shadow Ring",
  584.         legs="Runeist Trousers +3",
  585.     })
  586.  
  587.  
  588.     ------ Engaged Sets ------
  589.     sets.aftercast.Engaged = set_combine(sets.aftercast, {
  590.     })
  591.  
  592.     sets.aftercast.Engaged.Turms = set_combine(sets.aftercast.Engaged, {
  593.         hands="Turms Mittens +1",
  594.         back={ name="Ogma's cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','Enmity+10','Parrying rate+5%',}},
  595.         legs="Erilaz Leg Guards +3",
  596.         feet="Turms Leggings +1"
  597.     })
  598.  
  599.     sets.aftercast.Engaged.TP = {
  600.         ammo="Aurgelmir Orb +1",
  601.         head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
  602.         neck="Lissome Necklace",
  603.         ear1="Sherida Earring",
  604.         ear2="Telos Earring",
  605.         body="Turms Harness +1",
  606.         hands="Adhemar Wristbands +1",
  607.         ring1="Epona's Ring",
  608.         ring2="Niqmaddu Ring",
  609.         back={ name="Ogma's cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10','Phys. dmg. taken-10%',}},
  610.         waist="Ioskeha Belt +1",
  611.         legs="Samnuha Tights",
  612.         feet={ name="Herculean Boots", augments={'Accuracy+26','"Triple Atk."+4','Attack+11',}}
  613.     }
  614.  
  615.     sets.aftercast.Engaged.TP.Turms = set_combine(sets.aftercast.Engaged.TP, {
  616.         hands="Turms Mittens +1",
  617.         feet="Turms Leggings +1"
  618.     })
  619.  
  620.     -- I removed most of this stuff because my TP sets all have plenty of accuracy.
  621.     -- I mainly use my accuracy toggle for WS sets now.
  622.     sets.aftercast.Engaged.TP.Acc = set_combine(sets.aftercast.Engaged.TP, {
  623.         --neck="Combatant's Torque",
  624.         --ear1="Zennaroi Earring",
  625.         --legs="Carmine Cuisses +1",
  626.     })
  627.  
  628.     sets.aftercast.Engaged.Sword = set_combine(sets.aftercast.Engaged.TP, {
  629.         waist="Reiki Yotai"
  630.     })
  631.  
  632.     sets.aftercast.Engaged.MidHybrid = {
  633.         ammo="Yamarang",
  634.         head="Ayanmo Zucchetto +2",
  635.         neck="Futhark Torque +2",
  636.         ear1="Sherida Earring",
  637.         ear2="Telos Earring",
  638.         body="Ashera Harness",
  639.         hands="Adhemar Wristbands +1",
  640.         ring1={name="Moonlight Ring", bag="wardrobe2"},
  641.         ring2={name="Moonlight Ring", bag="wardrobe4"},
  642.         back={ name="Ogma's cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10','Phys. dmg. taken-10%',}},
  643.         waist="Ioskeha Belt +1",
  644.         legs="Meghanada Chausses +2",
  645.         feet={ name="Herculean Boots", augments={'Accuracy+26','"Triple Atk."+4','Attack+11',}}
  646.     }
  647.  
  648.     sets.aftercast.Engaged.MidHybrid.Turms = set_combine(sets.aftercast.Engaged.MidHybrid, {
  649.         hands="Turms Mittens +1",
  650.         feet="Turms Leggings +1"
  651.     })
  652.  
  653.     sets.aftercast.Engaged.Hybrid = {
  654.         ammo="Yamarang",
  655.         head="Ayanmo Zucchetto +2",
  656.         neck="Futhark Torque +2",
  657.         ear1="Sherida Earring",
  658.         ear2="Telos Earring",
  659.         body="Ashera Harness",
  660.         hands="Nyame Gauntlets",
  661.         ring1="Fickblix's Ring",
  662.         ring2={name="Moonlight Ring", bag="wardrobe4"},
  663.         back={ name="Ogma's cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10','Phys. dmg. taken-10%',}},
  664.         waist="Ioskeha Belt +1",
  665.         legs="Meghanada Chausses +2",
  666.         feet="Nyame Sollerets"
  667.     }
  668.    
  669.     sets.aftercast.Engaged.Hybrid.Turms = set_combine(sets.aftercast.Engaged.Hybrid, {
  670.         hands="Turms Mittens +1",
  671.         legs="Erilaz Leg Guards +3",
  672.         feet="Turms Leggings +1"
  673.     })
  674.  
  675.     sets.aftercast.Engaged.Hybrid.Resist = set_combine(sets.aftercast.Engaged.Hybrid, {
  676.         ear1="Hearty Earring",
  677.         legs="Runeist Trousers +3"
  678.     })
  679.    
  680.     -- I change this set as needed. Currently a high-meva version of the Hybrid build.
  681.     sets.aftercast.Engaged.HybridFull = set_combine(sets.aftercast.Engaged.Hybrid, {
  682.         ammo="Yamarang",
  683.         head="Nyame Helm",
  684.         hands="Nyame Gauntlets",
  685.         neck="Anu Torque",
  686.         ring2={name="Chirich Ring +1", bag="wardrobe4"},
  687.         legs="Nyame Flanchard",
  688.         --legs="Erilaz Leg Guards +3",
  689.         feet="Erilaz Greaves +3"
  690.     })
  691.    
  692.     sets.aftercast.Engaged.HybridFull.Turms = set_combine(sets.aftercast.Engaged.HybridFull, {
  693.         ammo="Staunch Tathlum +1",
  694.         neck="Futhark Torque +2",
  695.         hands="Turms Mittens +1",
  696.         ring1={name="Moonlight Ring", bag="wardrobe2"},
  697.         ring2="Defending Ring",
  698.         back={ name="Ogma's cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','Enmity+10','Parrying rate+5%',}},
  699.         legs="Erilaz Leg Guards +3",
  700.         feet="Turms Leggings +1"
  701.     })
  702.    
  703.     sets.aftercast.Engaged.Kite = set_combine(sets.aftercast.Kite, {
  704.     })
  705.  
  706.     sets.aftercast.Engaged.Regain = set_combine(sets.aftercast.Regain, {
  707.     })
  708.  
  709.     -- Subtle Blow set (I assume no Auspice because I mostly use this to low-man Mboze RP)
  710.     sets.aftercast.Engaged.SB = {
  711.         ammo="Staunch Tathlum +1",
  712.         head="Nyame Helm",
  713.         neck="Bathy Choker +1",
  714.         ear1="Sherida Earring",
  715.         ear2="Dignitary's Earring",
  716.         body="Nyame Mail",
  717.         hands="Nyame Gauntlets",
  718.         ring1={name="Chirich Ring +1", bag="wardrobe2"},
  719.         ring2={name="Chirich Ring +1", bag="wardrobe4"},
  720.         back={ name="Ogma's Cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','Enmity+10','DEF+50',}},
  721.         waist="Ninurta's Sash",
  722.         legs="Erilaz Leg Guards +3",
  723.         feet="Erilaz Greaves +3"
  724.     }
  725. end
  726.  
  727. function precast(spell)
  728.     if spell.type=="Item" then
  729.         if spell.name=="Holy Water" then
  730.             equip(sets.HolyWater)
  731.         end
  732.         return
  733.     end
  734.     -- Spell fast cast
  735.     if spell.action_type=="Magic" then
  736.         if spell.skill=="Enhancing Magic" then
  737.             equip(sets.precast.FC_Enhancing)
  738.         elseif string.find(spell.name,"Utsusemi") then
  739.             equip(sets.precast.FC_Utsusemi)
  740.         else
  741.             equip(sets.precast.FC)
  742.         end
  743.     end
  744.     -- Prevents Valiance/Vallation/Liement from being prevented by each other (cancels whichever is active)
  745.     if spell.name=='Valiance' or spell.name=='Vallation' or spell.name=='Liement' then
  746.         if buffactive['Valiance'] then
  747.             cast_delay(0.2)
  748.             windower.ffxi.cancel_buff(535)
  749.         elseif buffactive['Vallation'] then
  750.             cast_delay(0.2)
  751.             windower.ffxi.cancel_buff(531)
  752.         elseif buffactive['Liement'] then
  753.             cast_delay(0.2)
  754.             windower.ffxi.cancel_buff(537)
  755.         end
  756.     elseif spell.name=="Stoneskin" and buffactive["Stoneskin"] then
  757.         windower.send_command('cancel 37;')
  758.     end
  759.     -- Gambit and Rayke announcements
  760.     if Announcements then
  761.         if spell.english == "Gambit" then
  762.             send_command('timers delete "Gambit"')
  763.             send_command('timers create "Gambit" 96 down;wait 66;input /party Gambit [WEARING OFF IN 30 SEC.];wait 30;input /party Gambit [OFF];timers delete "Gambit"')
  764.             send_command('input /p Gambit['..Rune[1]..'] >> '..spell.target.name)
  765.         elseif spell.english == "Rayke" then
  766.             send_command('timers delete "Rayke"')
  767.             send_command('timers create "Rayke" 47 down;wait 32;input /party Rayke [WEARING OFF IN 15 SEC.];wait 15;input /party Rayke [OFF];timers delete "Rayke"')
  768.             send_command('input /p Rayke['..Rune[1]..'] >> '..spell.target.name)
  769.         end
  770.     end
  771. end
  772.  
  773. function midcast(spell)
  774.     if spell.type=="Item" then
  775.         return
  776.     end
  777.     -- Check for a specific set
  778.     if sets.midcast[spell.english] then
  779.         equipSet = sets.midcast[spell.english]
  780.         if LowHate and equipSet.LowHate then
  781.             equipSet = equipSet.LowHate
  782.         end
  783.         if AccMode and equipSet.Acc then
  784.             equipSet = equipSet.Acc
  785.         end
  786.         equip(equipSet)
  787.     elseif InterruptSpells:contains(spell.name) then
  788.         equip(sets.midcast.Interrupt)
  789.     -- Specific Spells
  790.     elseif string.find(spell.english, 'Cure') or string.find(spell.english, 'Curaga') then
  791.         equip(sets.midcast.Cure)
  792.     elseif string.sub(spell.name,1,12)=="Curing Waltz" then
  793.         equip(sets.midcast.CuringWaltz)
  794.     -- Enhancing
  795.     elseif spell.skill=="Enhancing Magic" then
  796.         if string.find(spell.name,"Regen") then
  797.             equip(sets.midcast.Regen)
  798.         elseif string.find(spell.name,"Protect") or string.find(spell.name,"Shell") then
  799.             equip(set_combine(sets.midcast.EnhancingDuration, {ring2="Sheltered Ring"}))
  800.         elseif EnhancingSkillSpells:contains(spell.name) then
  801.             equip(sets.midcast.Enhancing)
  802.         else
  803.             equip(sets.midcast.EnhancingDuration)
  804.         end
  805.  
  806.         if spell.name=="Stoneskin" and buffactive["Stoneskin"] then
  807.             windower.send_command('wait 1;cancel 37;')
  808.         elseif spell.name=="Sneak" and buffactive["Sneak"] and spell.target.type=="SELF" then
  809.             windower.send_command('cancel 71;')
  810.         end
  811.     -- Blue Magic
  812.     elseif spell.skill=="Blue Magic" then
  813.         equip(sets.midcast.Enmity)
  814.     -- Ninjutsu
  815.     elseif spell.type=="Ninjutsu" then
  816.         if spell.name=="Utsusemi: Ichi" then
  817.             if buffactive["Copy Image"] then
  818.                 windower.send_command('wait 1;cancel Copy Image;')
  819.             elseif buffactive["Copy Image (2)"] then
  820.                 windower.send_command('wait 1;cancel Copy Image (2);')
  821.             end
  822.         end
  823.         equip(sets.aftercast.DT)
  824.     -- Weaponskill
  825.     elseif spell.type=="WeaponSkill" then
  826.         if AccMode then
  827.             equip(sets.midcast.Weaponskill_Acc)
  828.         elseif MAccWeaponskills:contains(spell.name) then
  829.             equip(sets.midcast.MAccWeaponskill)
  830.         else
  831.             equip(sets.midcast.Weaponskill)
  832.         end
  833.     elseif spell.type=="BloodPactWard" or spell.type=="BloodPactRage" then
  834.         equip(sets.midcast.BP)
  835.     elseif LowHate then
  836.         equip(sets.midcast.LowHate)
  837.     else
  838.         equip(sets.midcast.Enmity)
  839.     end
  840.     if TH and spell.target.type=="MONSTER" then
  841.         equip(sets.TH)
  842.     end
  843. end
  844.  
  845. function aftercast(spell)
  846.     if spell.type=="Item" then
  847.         return
  848.     end
  849.     idle()
  850. end
  851.  
  852. function status_change(new,old)
  853.     idle()
  854. end
  855.  
  856. function self_command(command)
  857.     is_valid = command:lower()=="idle"
  858.     announceModes = false
  859.  
  860.     if command:lower()=="toggletp" then
  861.         is_valid = true
  862.         if TPMode=="TP" then
  863.             TPMode = "MidHybrid"
  864.         elseif TPMode=="MidHybrid" then
  865.             TPMode = "Hybrid"
  866.         elseif TPMode=="Hybrid" then
  867.             TPMode = "HybridFull"
  868.         else
  869.             TPMode = "TP"
  870.         end
  871.         announceModes = true
  872.     elseif command:lower()=="toggleidle" then
  873.         is_valid = true
  874.         if IdleMode=="DT" then
  875.             IdleMode = "Kite"
  876.         elseif IdleMode=="Kite" then
  877.             IdleMode = "KiteRegain"
  878.         else
  879.             IdleMode = "DT"
  880.         end
  881.         announceModes = true
  882.     elseif command:lower()=="dt" then
  883.         is_valid = true
  884.         TPMode = command
  885.         IdleMode = command
  886.         announceModes = true
  887.     elseif command:lower()=="kite" then
  888.         is_valid = true
  889.         TPMode = command
  890.         IdleMode = command
  891.         announceModes = true
  892.     elseif command:lower()=="regain" then
  893.         is_valid = true
  894.         TPMode = command
  895.         IdleMode = command
  896.         announceModes = true
  897.     -- "gs c TP <mode>" to change TP mode
  898.     elseif string.sub(command:lower(),1,2)=="tp" and string.len(command) > 3 then
  899.         tpCommand = string.sub(command,4,string.len(command))
  900.         for _, v in ipairs(TPModeCommands) do
  901.             if tpCommand:lower()==v:lower() then
  902.                 is_valid = true
  903.                 TPMode = v
  904.                 announceModes = true
  905.             end
  906.         end
  907.     -- "gs c Idle <mode>" to change Idle mode
  908.     elseif string.sub(command:lower(),1,4)=="idle" and string.len(command) > 5 then
  909.         idleCommand = string.sub(command,6,string.len(command))
  910.         for _, v in ipairs(IdleModeCommands) do
  911.             if idleCommand:lower()==v:lower() then
  912.                 is_valid = true
  913.                 IdleMode = v
  914.                 announceModes = true
  915.             end
  916.         end
  917.     elseif command:lower()=="acc" then
  918.         if AccMode then
  919.             is_valid = true
  920.             AccMode = false
  921.             send_command('console_echo "AccMode: false"')
  922.         else
  923.             is_valid = true
  924.             AccMode = true
  925.             send_command('console_echo "AccMode: true"')
  926.         end
  927.     elseif command:lower()=="turms" then
  928.         Turms = Turms==false
  929.         send_command('console_echo "Turms Healing: '..tostring(Turms)..'"')
  930.         is_valid = true
  931.     elseif command:lower()=="lowhate" then
  932.         LowHate = LowHate==false
  933.         send_command('console_echo "Low Hate Mode: '..tostring(LowHate)..'"')
  934.         is_valid = true
  935.     elseif command:lower()=="resistailments" then
  936.         ResistAilments = ResistAilments==false
  937.         send_command('console_echo "Resist Ailments: '..tostring(ResistAilments)..'"')
  938.         is_valid = true
  939.     elseif command:lower()=="resiststun" then
  940.         ResistStun = ResistStun==false
  941.         send_command('console_echo "Resist Stun: '..tostring(ResistStun)..'"')
  942.         is_valid = true
  943.     elseif command:lower()=="resistpara" then
  944.         ResistPara = ResistPara==false
  945.         send_command('console_echo "Resist Para: '..tostring(ResistPara)..'"')
  946.         is_valid = true
  947.     elseif command:lower()=="resistsilence" then
  948.         ResistSilence = ResistSilence==false
  949.         send_command('console_echo "Resist Silence: '..tostring(ResistSilence)..'"')
  950.         is_valid = true
  951.     elseif command:lower()=="resistdeath" then
  952.         ResistDeath = ResistDeath==false
  953.         send_command('console_echo "Resist Death: '..tostring(ResistDeath)..'"')
  954.         is_valid = true
  955.     elseif command:lower()=="resistcharm" then
  956.         ResistCharm = ResistCharm==false
  957.         send_command('console_echo "Resist Charm: '..tostring(ResistCharm)..'"')
  958.         is_valid = true
  959.     elseif string.sub(command,1,4)=="Rune" then
  960.         is_valid = true
  961.         if (string.len(command) > 4) then
  962.             local i = 0
  963.             for word in string.gmatch(command, "%u%l+") do
  964.                 if (i > 0) then
  965.                     Rune[i] = word
  966.                 end
  967.                 i = i + 1
  968.             end
  969.             if (i < 3) then
  970.                 Rune[2] = Rune[1]
  971.                 Rune[3] = Rune[1]
  972.             elseif (i < 4) then
  973.                 Rune[3] = Rune[1]
  974.             end
  975.             Rune_ind = 1
  976.             send_command('console_echo "Rune Mode: ['..(Rune[1])..' - '..(Rune[2])..' - '..(Rune[3])..']"')
  977.         end
  978.         rune()
  979.     elseif command:lower()=="epeo" then
  980.         is_valid = true
  981.         equip({main="Epeolatry",sub="Utu Grip"})
  982.     elseif command:lower()=="lion" then
  983.         is_valid = true
  984.         equip({main="Lionheart",sub="Utu Grip"})
  985.     elseif command:lower()=="reikiko" then
  986.         is_valid = true
  987.         equip({main="Reikiko",sub="Chanter's Shield"})
  988.     elseif command:lower()=="helheim" then
  989.         is_valid = true
  990.         equip({main="Helheim",sub="Utu Grip"})
  991.     elseif command:lower()=="th" then
  992.         TH = TH==false
  993.         send_command('console_echo "Treasure Hunter: '..tostring(TH)..'"')
  994.         is_valid = true
  995.     end
  996.  
  997.     if is_valid then
  998.         if (not midaction() and not pet_midaction()) or command:lower()=="idle" then
  999.             idle()
  1000.         end
  1001.         if announceModes then
  1002.             send_command('console_echo "TP Mode: ['..TPMode..'] ~ Idle Mode: ['..IdleMode..']"')
  1003.         end
  1004.     else
  1005.         sanitized = command:gsub("\"", "")
  1006.         send_command('console_echo "Invalid self_command: '..sanitized..'"')
  1007.     end
  1008. end
  1009.  
  1010. function idle()
  1011.     --if TownIdle:contains(world.area:lower()) then
  1012.     --  return
  1013.     --end
  1014.     equipSet = sets.aftercast
  1015.     if player.status=="Engaged" then
  1016.         if equipSet['Engaged'] then
  1017.             equipSet = equipSet['Engaged']
  1018.         end
  1019.         if equipSet[TPMode] then
  1020.             equipSet = equipSet[TPMode]
  1021.         end
  1022.         -- Toggles & Conditionals When Engaged
  1023.         if Turms and equipSet['Turms'] then
  1024.             equipSet = equipSet['Turms']
  1025.         end
  1026.         if buffactive['Battuta'] and equipSet['Battuta'] then
  1027.             equipSet = equipSet['Battuta']
  1028.         end
  1029.         if AccMode and equipSet['Acc'] then
  1030.             equipSet = equipSet['Acc']
  1031.         end
  1032.     else
  1033.         if equipSet[player.status] then
  1034.             equipSet = equipSet[player.status]
  1035.         end
  1036.         if equipSet[IdleMode] then
  1037.             equipSet = equipSet[IdleMode]
  1038.         end
  1039.     end
  1040.     -- Toggles & Other Conditionals
  1041.     if ResistAilments and equipSet['Resist'] then
  1042.         equipSet = equipSet['Resist']
  1043.     end
  1044.     if ResistDeath and equipSet['ResistDeath'] then
  1045.         equipSet = equipSet['ResistDeath']
  1046.     end
  1047.     if ResistCharm and equipSet['ResistCharm'] then
  1048.         equipSet = equipSet['ResistCharm']
  1049.     end
  1050.     if ResistPara and equipSet['ResistPara'] then
  1051.         equipSet = equipSet['ResistPara']
  1052.     end
  1053.     if ResistStun and equipSet['ResistStun'] then
  1054.         equipSet = equipSet['ResistStun']
  1055.     end
  1056.     if ResistSilence and equipSet['ResistSilence'] then
  1057.         equipSet = equipSet['ResistSilence']
  1058.     end
  1059.     if not buffactive['Shell'] and equipSet['NoShell'] then
  1060.         equipSet = equipSet['NoShell']
  1061.     end
  1062.     if Escha:contains(world.area:lower()) and equipSet['Escha'] then
  1063.         equipSet = equipSet['Escha']
  1064.     end
  1065.    
  1066.     equip(equipSet)
  1067.     -- Treasure Hunter override
  1068.     if TH and player.status=="Engaged" then
  1069.         equip(sets.TH)
  1070.     end
  1071. end
  1072.  
  1073. function rune()
  1074.     nextRune = Rune[Rune_ind]
  1075.     Rune_ind = Rune_ind+1
  1076.     if (Rune_ind > 3) then
  1077.         Rune_ind = 1
  1078.     end
  1079.     if (nextRune=="Fire") then
  1080.         send_command('input /ja Ignis <me>')
  1081.     elseif (nextRune=="Earth") then
  1082.         send_command('input /ja Tellus <me>')
  1083.     elseif (nextRune=="Water") then
  1084.         send_command('input /ja Unda <me>')
  1085.     elseif (nextRune=="Wind") then
  1086.         send_command('input /ja Flabra <me>')
  1087.     elseif (nextRune=="Ice") then
  1088.         send_command('input /ja Gelus <me>')
  1089.     elseif (nextRune=="Thunder") then
  1090.         send_command('input /ja Sulpor <me>')
  1091.     elseif (nextRune=="Light") then
  1092.         send_command('input /ja Lux <me>')
  1093.     elseif (nextRune=="Dark") then
  1094.         send_command('input /ja Tenebrae <me>')
  1095.     else
  1096.         send_command('console_echo "Error: Bad Rune Element ['..nextRune..']"')
  1097.     end
  1098. end
Add Comment
Please, Sign In to add comment