Pergatory

Pergatory's RUN Gearswap

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