Guest User

RUN

a guest
Mar 15th, 2018
169
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- (Original: Motenten / Modified: Arislan)
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. --[[    Custom Features:
  6.  
  7.         Rune Selector       Cycle through available runes and trigger with a single macro [Ctl-`]
  8.         Knockback Mode      Equips knockback prevention gear (Ctl-[)
  9.         Death Mode          Equips death prevention gear (Ctl-])
  10.         Auto. Doom          Automatically equips cursna received gear on doom status
  11.         Capacity Pts. Mode  Capacity Points Mode Toggle [WinKey-C]
  12.         Reive Detection     Automatically equips Reive bonus gear
  13.         Auto. Lockstyle     Automatically locks specified equipset on file load
  14. --]]
  15.  
  16.  
  17. -------------------------------------------------------------------------------------------------------------------
  18. -- Setup functions for this job.  Generally should not be modified.
  19. -------------------------------------------------------------------------------------------------------------------
  20.  
  21. -- Initialization function for this job file.
  22. function get_sets()
  23.     mote_include_version = 2
  24.  
  25.     -- Load and initialize the include file.
  26.     include('Mote-Include.lua')
  27.     include('organizer-lib')
  28. end
  29.  
  30. -- Setup vars that are user-independent.
  31. function job_setup()
  32.     -- /BLU Spell Maps
  33.     blue_magic_maps = {}
  34.  
  35.     blue_magic_maps.Enmity = S{'Blank Gaze', 'Geist Wall', 'Jettatura', 'Soporific', 'Actinic Burst', 'Temporal Shift',
  36.         'Poison Breath', 'Blitzstrahl', 'Sheep Song', 'Chaotic Eye', 'Stinking Gas', 'Fantod'}
  37.     blue_magic_maps.Cure = S{'Wild Carrot', 'Pollen'}
  38.     blue_magic_maps.Buffs = S{'Cocoon', 'Refueling'}
  39.  
  40.     rayke_duration = 35
  41.     gambit_duration = 92
  42.    
  43.  
  44.  
  45. end
  46.  
  47. -------------------------------------------------------------------------------------------------------------------
  48. -- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
  49. -------------------------------------------------------------------------------------------------------------------
  50.  
  51. function user_setup()
  52.     state.OffenseMode:options('Normal', 'MidAcc', 'HighAcc', 'MaxAcc') -- 'STP',
  53.     state.WeaponskillMode:options('Normal', 'Acc')
  54.     state.HybridMode:options('Normal', 'PDT')
  55.     state.CastingMode:options('Normal', 'Resistant')
  56.     state.IdleMode:options('Normal', 'DT', 'Refresh', 'Regen')
  57.     state.PhysicalDefenseMode:options('PDT', 'HP', 'Magic') -- ALT+F10
  58.     state.MagicalDefenseMode:options('MDT', 'Status')
  59.    
  60.     state.WeaponLock = M(false, 'Weapon Lock') 
  61.     state.Charm = M(false, 'Charm')
  62.     state.Knockback = M(false, 'Knockback')
  63.     state.Death = M(false, "Death Resistance")
  64.     state.CP = M(false, "Capacity Points Mode")
  65.  
  66.     state.Runes = M{['description']='Runes', "Ignis", "Gelus", "Flabra", "Tellus", "Sulpor", "Unda", "Lux", "Tenebrae"}
  67.    
  68.     state.Rune = M{['description']='which',
  69.         "Fire Dmg | Ice Resist: Paralyze, Bind, Frost",
  70.         "Ice Dmg | Wind Resist: Choke, Gravity, Silence",
  71.         "Wind dmg | Earth Resist: Slow, Petrify, Rasp",
  72.         "Earth dmg | Lightning Resist: Stun, Shock",
  73.         "Lightning Dmg | Water Resist: Poison, Drown",
  74.         "Water dmg | Fire Resist: Addle, Burn, Plague, Amnesia",
  75.         "Light Dmg | Dark Resist's: Blind, Bio, Sleep",
  76.         "Dark Dmg | Light Resist's: Repose, Dia, Charm"
  77.     }
  78.    
  79.     send_command('bind ` input /ma "Flash" <t>')
  80.     send_command('bind ^` input //gs c rune')
  81.     send_command('bind !` input /ja "Vivacious Pulse" <me>')
  82.     send_command('bind @` input /ma "Stun" <t>')
  83.     send_command('bind ^- gs c cycleback Runes')
  84.     send_command('bind ^= gs c cycle Runes')
  85.     send_command('bind ^f10 gs c cycle PhysicalDefenseMode')
  86.     send_command('bind !f11 gs c cycle MagicalDefenseMode')
  87.     send_command('bind ^[ gs c toggle Knockback')
  88.     send_command('bind ^] gs c toggle Death')
  89.     send_command('bind ^\ gs c toggle Charm')
  90.     send_command('bind !q input /ma "Temper" <me>')
  91.     send_command('bind delete input /ws "Resolution" <t>')
  92.     send_command('bind end input /ws "Dimidiation" <t>')
  93.     send_command('bind @w gs c toggle WeaponLock')
  94.     send_command('bind ^f11 gs c toggle Kiting')
  95.     send_command('bind @c gs c toggle CP')
  96.  
  97.     if player.sub_job == 'BLU' then
  98.         send_command('bind home input /ma "Cocoon" <me>')
  99.     elseif player.sub_job == 'WAR' then
  100.         send_command('bind home input /ja "Berserk" <me>')
  101.         send_command('bind != input /ja "Defender" <me>')
  102.     elseif player.sub_job == 'DRK' then
  103.         send_command('bind home input /ja "Last Resort" <me>')
  104.         send_command('bind != input /ja "Souleater" <me>')
  105.         send_command('bind !- input /ja "Weapon Bash" <me>')
  106.     elseif player.sub_job == 'SAM' then
  107.         send_command('bind home input /ja "Hasso" <me>')
  108.         send_command('bind != input /ja "Sekkanoki" <me>')
  109.         send_command('bind !- input /ja "Meditate" <me>')
  110.     end
  111.    
  112.     select_default_macro_book()
  113.     set_lockstyle()
  114.     define_rune_info()
  115.    
  116.     target_distance = 5.5 -- Set Default Distance Here --
  117. end
  118.  
  119. function user_unload()
  120.     send_command('unbind `')
  121.     send_command('unbind ^`')
  122.     send_command('unbind !`')
  123.     send_command('unbind @`')
  124.     send_command('unbind ^-')
  125.     send_command('unbind !-')
  126.     send_command('unbind @-')
  127.     send_command('unbind ^=')
  128.     send_command('unbind !=')
  129.     send_command('unbind @=')
  130.     send_command('unbind delete')
  131.     send_command('unbind end')
  132.     send_command('unbind home')
  133.     send_command('unbind ^delete')
  134.     send_command('unbind ^end')
  135.     send_command('unbind ^home')
  136.     send_command('unbind !delete')
  137.     send_command('unbind !end')
  138.     send_command('unbind !home')
  139.     send_command('unbind @delete')
  140.     send_command('unbind @end')
  141.     send_command('unbind @home')
  142.     send_command('unbind !q')
  143.     send_command('unbind !p')
  144.     send_command('unbind @c')
  145.     send_command('unbind !f9')
  146. end
  147.  
  148. -- Define sets and vars used by this job file.
  149. function init_gear_sets()
  150.     --------------------------------------
  151.     -- Start defining the sets
  152.     --------------------------------------
  153.    
  154.     -- Priority defining gear: ring1={name="Ramuh Ring +1", priority=1},
  155.    
  156.     -- Organizer: weapons
  157.     organizer_items = {"Aettir","Lionheart","Refined Grip +1","Utu Grip"}
  158.    
  159.     ------------------------------------------------------------------------------------------
  160.     -------------------------------------- Enmity set ----------------------------------------
  161.     ------------------------------------------------------------------------------------------
  162.    
  163.     sets.Enmity = {ammo="Iron Gobbet",
  164.         head={name="Halitus Helm", priority=2},neck="Unmoving Collar +1",ear1="Trux Earring",ear2="Friomisi Earring",
  165.         body={name="Emet Harness +1", priority=5},hands={name="Kurys Gloves", priority=7},ring1={name="Begrudging Ring", priority=1},ring2="Moonbeam Ring",
  166.         back={name=run_HP, priority=4},waist={name="Kasiri Belt", priority=6},legs={name="Erilaz Leg Guards +1", priority=3},feet={name="Erilaz Greaves +1", priority=8}}
  167.  
  168.     ------------------------------------------------------------------------------------------
  169.     -------------------------------------- Precast sets --------------------------------------
  170.     ------------------------------------------------------------------------------------------ 
  171.        
  172.     -- Precast sets to enhance JAs
  173.     sets.precast.JA['Vallation'] = set_combine(sets.Enmity, {body="Runeist's Coat +2",legs="Futhark Trousers +1",back=run_HP})
  174.     sets.precast.JA['Valiance'] = set_combine(sets.precast.JA['Vallation'], {})
  175.     sets.precast.JA['Pflug'] = set_combine(sets.Enmity, {feet="Runeist's Boots +2"})
  176.     sets.precast.JA['Battuta'] = set_combine(sets.Enmity, {head="Futhark Bandeau +1"})
  177.     sets.precast.JA['Liement'] = set_combine(sets.Enmity, {body="Futhark Coat +1"})
  178.  
  179.     sets.precast.JA['Lunge'] = {ammo="Seeth. Bomblet +1",
  180.         head=herc_head_MAB,neck="Sanctity Necklace",ear1="Novio Earring",ear2="Friomisi Earring",
  181.         body="Samnuha Coat",hands="Leyline Gloves",ring1="Shiva Ring +1",ring2="Shiva Ring +1",
  182.         back="Toro Cape",waist="Eschan Stone",legs="Ayanmo Cosciales +2",feet="Ayanmo Gambieras +1"}
  183.  
  184.     sets.precast.JA['Swipe'] = set_combine(sets.precast.JA['Lunge'], {})
  185.     sets.precast.JA['Gambit'] = {hands="Runeist's Mitons +3"}
  186.     sets.precast.JA['Rayke'] = {feet="Futhark Boots"}
  187.     sets.precast.JA['Elemental Sforzo'] = set_combine(sets.Enmity, {body="Futhark Coat +1"})
  188.     sets.precast.JA['Swordplay'] = set_combine(sets.Enmity, {hands="Futhark Mitons"})
  189.     sets.precast.JA['Embolden'] = set_combine(sets.Enmity, {back="Evasionist's Cape",head="Erilaz Galea +1",legs="Futhark Trousers +1"})
  190.     sets.precast.JA['Vivacious Pulse'] = set_combine(sets.Enmity, {head="Erilaz Galea +1",neck="Incanter's Torque",ring1="Stikini Ring",ring2="Stikini Ring",waist="Bishop's Sash",legs="Rune. Trousers +2"})
  191.     sets.precast.JA['One For All'] = set_combine(sets.Enmity, {})
  192.     sets.precast.JA['Provoke'] = set_combine(sets.Enmity, {})
  193.    
  194.     sets.precast.Waltz = {}
  195.     sets.precast.Waltz['Healing Waltz'] = {}
  196.  
  197.     ------------------------------------------------------------------------------------------
  198.     -------------------------------------- Fastcast sets -------------------------------------
  199.     ------------------------------------------------------------------------------------------
  200.    
  201.     sets.precast.FC = {ammo="Staunch Tathlum",
  202.         head={name="Runeist's Bandeau +2", priority=3},neck="Unmoving Collar +1",ear1="Loquacious Earring",ear2={name="Odnowa Earring +1", priority=1},
  203.         body={name="Emet Harness +1", priority=6},hands={name="Leyline Gloves", priority=8},ring1="Kishar Ring",ring2={name="Moonbeam Ring", priority=2},
  204.         back={name=run_HP, priority=5},waist={name="Oneiros Belt", priority=7},legs={name="Erilaz Leg Guards +1", priority=4},feet={name="Carmine Greaves", priority=9}}   
  205.  
  206.     sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {legs="Futhark Trousers +1"})
  207.     sets.precast.FC.Cure = set_combine(sets.precast.FC, {ammo="Impatiens",ear2="Mendi. Earring"})
  208.     sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {ammo="Impatiens",neck="Magoraga Beads"})
  209.  
  210.     ------------------------------------------------------------------------------------------
  211.     -------------------------------------- Weaponskill sets ----------------------------------
  212.     ------------------------------------------------------------------------------------------
  213.    
  214.     sets.precast.WS = {ammo="Knobkierrie",
  215.         head="Adhemar Bonnet +1",neck="Fotia Gorget",ear1="Moonshade Earring",ear2="Brutal earring",
  216.         body=herc_body_TA,hands="Meghanada Gloves +2",ring1="Epona's Ring",ring2="Regal Ring",
  217.         back=run_DA,waist="Fotia Belt",legs="Samnuha Tights",feet=herc_feet_TA}
  218.     sets.precast.WS.Acc = set_combine(sets.precast.WS, {ear2="Telos Earring",legs="Meg. Chausses +2"})
  219.  
  220.     ------------------------------------------------------------------------------------------
  221.     -------------------------------------- Resolution sets -----------------------------------
  222.     ------------------------------------------------------------------------------------------
  223.    
  224.     sets.precast.WS['Resolution'] = set_combine(sets.precast.WS, {
  225.         ear2="Sherida Earring",body="Adhemar Jacket +1",hands="Adhemar Wristbands +1",ring1="Niqmaddu Ring",legs="Meghanada Chausses +2",feet="Lustratio Leggings +1"})
  226.     sets.precast.WS['Resolution'].Acc = set_combine(sets.precast.WS['Resolution'], {ammo="Seething Bomblet +1",head="Dampening Tam",ear1="Telos Earring"})
  227.    
  228.     ------------------------------------------------------------------------------------------
  229.     -------------------------------------- Dimidiation sets ----------------------------------
  230.     ------------------------------------------------------------------------------------------
  231.    
  232.     sets.precast.WS['Dimidiation'] = set_combine(sets.precast.WS, {
  233.         ear2="Sherida Earring",body="Adhemar Jacket +1",ring1="Ilabrat Ring",ring2="Regal Ring",
  234.         back=run_WSD,waist="Fotia Belt",legs="Lustratio Subligar +1",feet="Lustratio Leggings +1"})
  235.     sets.precast.WS['Dimidiation'].Acc = set_combine(sets.precast.WS['Dimidiation'], {
  236.         hands="Meghanada Gloves +2",ring1="Ramuh Ring +1",ring2="Ramuh Ring +1"})
  237.        
  238.     ------------------------------------------------------------------------------------------
  239.     -------------------------------------- All other WS sets ---------------------------------
  240.     ------------------------------------------------------------------------------------------ 
  241.        
  242.     sets.precast.WS['Herculean Slash'] = set_combine(sets.precast.JA['Lunge'], {})
  243.  
  244.     sets.precast.WS['Savage Blade'] = set_combine(sets.precast.WS, {ammo="Floestone",
  245.         head=herc_head_STRWSD,neck="Caro Necklace",ear1="Moonshade Earring",ear2="Ishvara Earring",
  246.         body=herc_body_STRWSD,hands=herc_hands_STRWSD,ring2="Regal Ring",
  247.         waist="Prosilio Belt +1",legs=herc_legs_STRWSD,feet=herc_feet_STRWSD})
  248.  
  249.     sets.precast.WS['Sanguine Blade'] = set_combine(sets.precast.Lunge, {head="Pixie Hairpin +1",ear1="Moonshade Earring"})
  250.     sets.precast.WS['True Strike']= set_combine(sets.precast.WS['Resolution'], {})
  251.     sets.precast.WS['Judgment'] = set_combine(sets.precast.WS['Savage Blade'])
  252.     sets.precast.WS['Black Halo'] = set_combine(sets.precast.WS['Savage Blade'])
  253.     sets.precast.WS['Flash Nova'] = set_combine(sets.precast.Lunge, {})
  254.     sets.precast.WS['Shockwave'] = {ammo="Hydrocera",
  255.         head="Aya. Zucchetto +2",neck="Sanctity Necklace",ear1="Digni. Earring",ear2="Gwati Earring",
  256.         body="Ayanmo Corazza +2",hands="Leyline Gloves",ring1="Stikini Ring",ring2="Stikini Ring",
  257.         waist="Eschan Stone",legs="Aya. Cosciales +2",feet="Aya. Gambieras +1"}
  258.  
  259.     ------------------------------------------------------------------------------------------
  260.     -------------------------------------- Midcast sets --------------------------------------
  261.     ------------------------------------------------------------------------------------------
  262.    
  263.     sets.midcast.FastRecast = set_combine(sets.precast.FC, {})
  264.  
  265.     sets.midcast.SpellInterrupt = {ammo="Staunch Tathlum",ring1="Evanescence Ring",legs="Carmine Cuisses +1"}
  266.  
  267.     sets.midcast.Cure = {ammo="Staunch Tathlum",
  268.         head=herc_head_DT,neck="Loricate Torque +1",ear1="Roundel Earring",ear2="Mendi. Earring",
  269.         body="Vrikodara Jupon",hands="Buremte Gloves",ring1="Defending Ring",ring2="Gelatinous Ring +1",
  270.         waist="Gishdubar Sash",legs="Eri. Leg Guards +1",feet="Skaoi Boots"}
  271.  
  272.     sets.midcast['Enhancing Magic'] = {
  273.         head={name="Carmine Mask", priority=7},neck="Incanter's Torque",ear1="Andoaa Earring",ear2={name="Odnowa Earring +1", priority=1},
  274.         body={name="Futhark Coat +1", priority=4},hands={name="Runeist's Mitons +3", priority=5},ring1="Stikini Ring",ring2={name="Moonbeam Ring", priority=2},
  275.         back="Evasionist's Cape",waist="Cascade Belt",legs={name="Carmine Cuisses +1", priority=7},feet={name="Erilaz Greaves +1", priority=8}}
  276.        
  277.     sets.midcast.EnhancingDuration = {head="Erilaz Galea +1",legs="Futhark Trousers +1",back="Evasionist's Cape"}
  278.     sets.midcast['Temper'] = set_combine(sets.midcast['Enhancing Magic'], {head="Erilaz Galea +1"})
  279.     sets.midcast['Phalanx'] = set_combine(sets.midcast['Enhancing Magic'], {head="Futhark Bandeau +1"})
  280.     sets.midcast['Regen'] = set_combine(sets.midcast['Enhancing Magic'], {head="Runeist's Bandeau +2"})
  281.     sets.midcast.Refresh = set_combine(sets.midcast.EnhancingDuration, {waist="Gishdubar Sash"})
  282.     sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {})
  283.     sets.midcast.Protect = set_combine(sets.midcast.EnhancingDuration, {ring2="Sheltered Ring"})
  284.     sets.midcast.Shell = set_combine(sets.midcast.Protect, {})
  285.     sets.midcast.Crusade = set_combine(sets.midcast.EnhancingDuration, {})
  286.     sets.midcast['Divine Magic'] = {neck="Incanter's Torque",waist="Bishop's Sash",legs="Rune. Trousers +2"} --ring1="Stikini Ring",ring2="Stikini Ring",
  287.     sets.midcast.Flash = set_combine(sets.Enmity, {})
  288.     sets.midcast.Stun = set_combine(sets.Enmity, {})
  289.     sets.midcast.Foil = set_combine(sets.Enmity, {head="Erilaz Galea +1",legs="Futhark Trousers +1"})
  290.     sets.midcast.Diaga = set_combine(sets.Enmity, {})
  291.     sets.midcast.Utsusemi = set_combine(sets.midcast.SpellInterrupt, {})
  292.     sets.midcast['Blue Magic'] = {}
  293.     sets.midcast['Blue Magic'].Enmity = set_combine(sets.Enmity, {})
  294.     sets.midcast['Blue Magic'].Cure = set_combine(sets.midcast.Cure, {})
  295.     sets.midcast['Blue Magic'].Buff = set_combine(sets.midcast['Enhancing Magic'])
  296.    
  297.     ------------------------------------------------------------------------------------------
  298.     -------------------------------------- Idle sets -----------------------------------------
  299.     ------------------------------------------------------------------------------------------
  300.  
  301.     sets.idle = {ammo="Homiliary",
  302.         head="Rawhide Mask",neck="Loricate Torque +1",ear1={name="Odnowa Earring", priority=4},ear2={name="Odnowa Earring +1", priority=3},
  303.         body={name="Runeist's Coat +2", priority=2},hands=herc_hands_REF,ring1="Defending Ring",ring2="Gelatinous Ring +1",
  304.         back={name="Moonbeam Cape", priority=1},waist="Flume Belt",legs="Carmine Cuisses +1",feet="Erilaz Greaves +1"}
  305.     -- PDT: 20% | DT: 24
  306.  
  307.     sets.idle.DT = set_combine(sets.idle, {ammo="Staunch Tathlum",
  308.         head=herc_head_DT,body={name="Futhark Coat +1", priority=2},hands=herc_hands_DT,ring2={name="Moonbeam Ring", priority=1},feet="Ayanmo Gambieras +1"})
  309.        
  310.     sets.idle.Refresh = set_combine(sets.idle, {legs="Rawhide Trousers"})
  311.     sets.idle.Regen = set_combine(sets.idle.DT, {neck="Sanctity Necklace",ring1="Paguroidea Ring",ring2="Sheltered Ring"})
  312.    
  313.     sets.idle.Town = set_combine(sets.idle, {head="Runeist's Bandeau +2",hands=herc_hands_DT})
  314.     sets.idle.Weak = set_combine(sets.idle.DT, {})
  315.     sets.Kiting = {legs="Carmine Cuisses +1"}
  316.  
  317.  
  318.     ------------------------------------------------------------------------------------------
  319.     -------------------------------------- Defense sets --------------------------------------
  320.     ------------------------------------------------------------------------------------------
  321.  
  322.     sets.defense.PDT = {ammo="Staunch Tathlum",
  323.         head=herc_head_DT,neck="Loricate Torque +1", ear1="Ethereal Earring",ear2={name="Odnowa Earring +1", priority=1},
  324.         body={name="Futhark Coat +1", priority=3},ring1="Defending Ring",ring2={name="Moonbeam Ring", priority=2},
  325.         hands={name="Herculean Gloves", augments={'Attack+11','Damage taken-4%','STR+5','Accuracy+9'}, priority=7},
  326.         back={name="Ogma's cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','Enmity+10'}, priority=5},
  327.         waist="Flume Belt",legs={name="Erilaz Leg Guards +1", priority=4},feet={name="Turms Leggings", priority=8}}
  328.     -- DT: Ammo 2, Head 4, Neck 6, Body 7, Hands 4, Rings 14, TOTAL: 37%    
  329.     -- PDT: Hands 2, Waist 4, Legs 7,  TOTAL: 13%
  330.    
  331.     sets.defense.MDT = {ammo="Staunch Tathlum",
  332.         head=herc_head_DT,neck="Loricate Torque +1",ear1="Etiolation Earring",ear2="Sanare Earring",
  333.         body="Futhark Coat +1",hands=herc_hands_DT,ring1="Defending Ring",ring2="Shadow Ring",
  334.         back="Engulfer Cape +1",waist="Flume Belt",legs="Ayanmo Cosciales +2",feet="Erilaz Greaves +1"}
  335.        
  336.     sets.defense.Magic = {ammo="Staunch Tathlum",
  337.         head=herc_head_DT,neck="Warder's Charm +1",ear1="Etiolation Earring",ear2="Odnowa Earring +1",
  338.         body="Runeist's Coat +2",hands=herc_hands_DT,ring1="Defending Ring",ring2="Shadow Ring",
  339.         back="Reiki Cloak",waist="Flume Belt",legs="Eri. Leg Guards +1",feet="Erilaz Greaves +1"}  
  340.  
  341.     sets.defense.Status = {ammo="Staunch Tathlum",
  342.         head=herc_head_DT,neck="Loricate Torque +1",ear1="Hearty Earring",ear2="Odnowa Earring +1",
  343.         body="Runeist's Coat +2",hands="Erilaz Gauntlets +1",ring1="Defending Ring",ring2="Gelatinous Ring +1",
  344.         back="Evasionist's Cape",waist="Flume Belt",legs="Rune. Trousers +2",feet="Erilaz Greaves +1"}
  345.    
  346.     sets.defense.HP = {ammo="Staunch Tathlum",
  347.         head=herc_head_DT,neck="Loricate Torque +1",ear1={name="Odnowa Earring", priority=4},ear2={name="Odnowa Earring +1", priority=3},
  348.         body={name="Runeist's Coat +2", priority=2},hands={name="Runeist's Mitons +3", priority=6},ring1="Defending Ring",ring2={name="Moonbeam Ring", priority=5},
  349.         back={name="Moonbeam Cape", priority=1},waist="Flume Belt",legs={name="Erilaz Leg Guards +1", priority=7},feet={name="Turms Leggings", priority=9}}
  350.  
  351.     sets.defense.Critical = {}
  352.     --sets.defense.Knockback = {back="Repulse Mantle"}
  353.     sets.defense.Death = {body="Samnuha Coat",ring1="Warden's Ring"}
  354.  
  355.     ------------------------------------------------------------------------------------------
  356.     -------------------------------------- Engaged sets --------------------------------------
  357.     ------------------------------------------------------------------------------------------
  358.    
  359.     -- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
  360.     -- sets if more refined versions aren't defined.
  361.     -- If you create a set with both offense and defense modes, the offense mode should be first.
  362.     -- EG: sets.engaged.Dagger.Accuracy.Evasion
  363.    
  364.     -- General order that slots should be swapped out: Ammo > Head > Neck > Waist > Feet > Earring (Brutal) > Legs > everything else.
  365.    
  366.     -- /SAM 35+15 sTP, /DRK 50 sTP
  367.     sets.engaged = {}
  368.     sets.engaged.MidAcc = {}
  369.     sets.engaged.HighAcc = {}
  370.     sets.engaged.MaxAcc = {}
  371.    
  372.     sets.engaged.SAM = {ammo="Yamarang",
  373.         head="Adhemar Bonnet +1",neck="Anu Torque",ear1="Telos Earring",ear2="Sherida Earring",
  374.         body="Adhemar Jacket +1",hands="Adhemar Wristbands +1",ring1="Niqmaddu Ring",ring2="Epona's Ring",
  375.         back=run_DA,waist="Windbuffet Belt +1",legs="Samnuha Tights",feet=herc_feet_TA}
  376.     -- sTP: Lionheart 10, Yamarang 3, Anu 7, Sherida 5, Telos 5, Wristbands 7, Tights 7    
  377.    
  378.     sets.engaged.MidAcc.SAM = set_combine(sets.engaged, {neck="Combatant's Torque",hands="Adhemar Wristbands +1"})
  379.     -- Accuracy: Aettir 1249 | Zulfiqar 1216
  380.     sets.engaged.HighAcc.SAM = set_combine(sets.engaged.MidAcc, {ammo="Falcon Eye",waist="Ioskeha Belt +1",legs="Carmine Cuisses +1"})
  381.     -- Accuracy: Aettir 1331 | Zulfiqar 1298
  382.     sets.engaged.MaxAcc.SAM = set_combine(sets.engaged.HighAcc, {
  383.         head="Carmine Mask",ear1="Dignitary's Earring",
  384.         head="Carmine Mask",ear1="Dignitary's Earring",
  385.         body=herc_body_ACC,ring1="Ramuh Ring +1",ring2="Ramuh Ring +1",
  386.         feet=herc_feet_ACC})
  387.         -- Kentarch Belt +1
  388.  
  389.     sets.engaged.DRK = {ammo="Yamarang",
  390.         head="Adhemar Bonnet +1",neck="Anu Torque",ear1="Telos Earring",ear2="Sherida Earring",
  391.         body="Adhemar Jacket +1",hands="Adhemar Wristbands +1",ring1="Niqmaddu Ring",ring2="Epona's Ring",
  392.         back=run_TP,waist="Windbuffet Belt +1",legs="Samnuha Tights",feet=herc_feet_TA}
  393.     -- sTP: Lionheart 10, Yamarang 3, Anu 7, Sherida 5, Telos 5, Wristbands 7, Cape 10, Tights 7
  394.    
  395.     sets.engaged.MidAcc.DRK = set_combine(sets.engaged.MidAcc.SAM,{})
  396.     sets.engaged.HighAcc.DRK = set_combine(sets.engaged.HighAcc.SAM,{})
  397.     sets.engaged.MaxAcc.DRK = set_combine(sets.engaged.MaxAcc.SAM,{})
  398.            
  399.     sets.engaged.PDT = {ammo="Yamarang",
  400.         head={name="Ayanmo Zucchetto +2", priority=3},neck="Loricate Torque +1",ear1="Telos Earring",ear2="Sherida Earring",
  401.         body={name="Ayanmo Corazza +2", priority=2},hands=herc_hands_TA,ring1="Defending Ring",ring2={name="Moonbeam Ring", priority=1},
  402.         back=run_TP,waist="Ioskeha Belt +1",legs={name="Meghanada Chausses +2", priority=4},feet=herc_feet_PDT}
  403.     -- PDT: Meg Hands 4, Meg Legs 6, Herc Feet 6 = +16
  404.     -- DT: Aya Head 3 Body 6, Neck 6, Rings 14 = +29
  405.    
  406.     sets.engaged.PDT.MidAcc = set_combine(sets.engaged.PDT,{})
  407.     sets.engaged.PDT.HighAcc = set_combine(sets.engaged.PDT.MidAcc,{})
  408.     sets.engaged.PDT.MaxAcc = set_combine(sets.engaged.PDT.HighAcc,{})
  409.  
  410.     -- Custom buff sets
  411.     --sets.buff.Doom = {ring1="Saida Ring",ring2="Saida Ring",waist="Gishdubar Sash"}
  412.     sets.Embolden = set_combine(sets.midcast.EnhancingDuration, {back="Evasionist's Cape"})
  413.  
  414.     sets.CP = {back="Mecisto. Mantle"}
  415.     sets.Reive = {}
  416.  
  417. end
  418.  
  419. -------------------------------------------------------------------------------------------------------------------
  420. -- Job-specific hooks for standard casting events.
  421. -------------------------------------------------------------------------------------------------------------------
  422.  
  423. function job_pretarget(spell,action)
  424.     if spell.type == "WeaponSkill" and player.status == 'Engaged' and spell.target.distance > target_distance then -- Cancel WS If You Are Out Of Range --
  425.        cancel_spell()
  426.        add_to_chat(123, spell.name..' Canceled: [Out of Range]')
  427.        return
  428.     end
  429. end
  430.  
  431. function job_precast(spell, action, spellMap, eventArgs)
  432.     if spell.english == 'Lunge' then
  433.         local abil_recasts = windower.ffxi.get_ability_recasts()
  434.         if abil_recasts[spell.recast_id] > 0 then
  435.             send_command('input /jobability "Swipe" <t>')
  436.             add_to_chat(122, '***Lunge Aborted: Timer on Cooldown -- Downgrading to Swipe.***')
  437.             eventArgs.cancel = true
  438.             return
  439.         end
  440.     end
  441.     if spell.english == 'Valiance' then
  442.         local abil_recasts = windower.ffxi.get_ability_recasts()
  443.         if abil_recasts[spell.recast_id] > 0 then
  444.             send_command('input /jobability "Vallation" <me>')
  445.             eventArgs.cancel = true
  446.             return
  447.         end
  448.     end
  449.     if spellMap == 'Utsusemi' then
  450.         if buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)'] then
  451.             cancel_spell()
  452.             add_to_chat(123, '**!! '..spell.english..' Canceled: [3+ IMAGES] !!**')
  453.             eventArgs.handled = true
  454.             return
  455.         elseif buffactive['Copy Image'] or buffactive['Copy Image (2)'] then
  456.             send_command('cancel 66; cancel 444; cancel Copy Image; cancel Copy Image (2)')
  457.         end
  458.     end
  459.     if (spell.type:endswith('Magic') or spell.type == "Ninjutsu" or spell.type == "Geomancy") then
  460.        if buffactive.Silence then
  461.         cancel_spell()
  462.         send_command('input /item "Echo Drops" <me>')
  463.        end
  464.     end
  465.     if spell.english == 'Berserk' then
  466.         if buffactive.Berserk then -- Change Berserk To Aggressor If Berserk Is On --
  467.         cancel_spell()
  468.         send_command('input /ja Aggressor <me>')
  469.         end
  470.     end
  471. end
  472.  
  473. -- Run after the default midcast() is done.
  474. -- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
  475. function job_post_midcast(spell, action, spellMap, eventArgs)
  476.     if spell.english == 'Lunge' or spell.english == 'Swipe' then
  477.         local obi = get_obi(get_rune_obi_element())
  478.         if obi then
  479.             equip({waist=obi})
  480.         end
  481.     end
  482.     if spell.skill == 'Enhancing Magic' and classes.NoSkillSpells:contains(spell.english) then
  483.         equip(sets.midcast.EnhancingDuration)
  484.     end
  485.     -- If DefenseMode is active, apply that gear over midcast
  486.     -- choices.  Precast is allowed through for fast cast on
  487.     -- spells, but we want to return to def gear before there's
  488.     -- time for anything to hit us.
  489.     -- Exclude Job Abilities from this restriction, as we probably want
  490.     -- the enhanced effect of whatever item of gear applies to them,
  491.     -- and only one item should be swapped out.
  492.     if state.DefenseMode.value ~= 'None' and (spell.type ~= 'JobAbility' or spell.english == "Phalanx") then
  493.         handle_equipping_gear(player.status)
  494.         eventArgs.handled = true
  495.     end
  496.     if buffactive['Reive Mark'] and spell.type == 'WeaponSkill' then
  497.         equip(sets.Reive)
  498.     end
  499. end
  500.  
  501. function job_aftercast(spell, action, spellMap, eventArgs)
  502.     if spell.name == 'Rayke' and not spell.interrupted then
  503.         send_command('@timers c "Rayke ['..spell.target.name..']" '..rayke_duration..' down spells/00136.png')
  504.         send_command('wait '..rayke_duration..';input /p <bstar><bstar><bstar> <ldangle> Rayke: OFF <rdangle> <bstar><bstar><bstar> <call21>;')
  505.     elseif spell.name == 'Gambit' and not spell.interrupted then
  506.         send_command('@timers c "Gambit ['..spell.target.name..']" '..gambit_duration..' down spells/00136.png')
  507.         send_command('wait '..gambit_duration..';input /p <bstar><bstar><bstar> <ldangle> Gambit: OFF <rdangle> <bstar><bstar><bstar> <call21>;')
  508.     end
  509. end
  510.  
  511. -------------------------------------------------------------------------------------------------------------------
  512. -- Job-specific hooks for non-casting events.
  513. -------------------------------------------------------------------------------------------------------------------
  514.  
  515. -- Called when the player's status changes.
  516. function job_state_change(field, new_value, old_value)
  517.     classes.CustomDefenseGroups:clear()
  518.     classes.CustomDefenseGroups:append(state.Knockback.current)
  519.     classes.CustomDefenseGroups:append(state.Death.current)
  520.  
  521.     classes.CustomMeleeGroups:clear()
  522.     classes.CustomMeleeGroups:append(state.Knockback.current)
  523.     classes.CustomMeleeGroups:append(state.Death.current)
  524. end
  525.  
  526. function job_buff_change(buff,gain)
  527.     -- If we gain or lose any haste buffs, adjust which gear set we target.
  528.     --Embolden cape lock--
  529.     if buff == 'Embolden' then
  530.         if gain then
  531.             add_to_chat(122, 'On')
  532.             equip(sets.buff.Embolden)
  533.             disable('head','legs','back')          
  534.         else
  535.             add_to_chat(122, 'Off')
  536.             enable('head','legs','back')           
  537.             status_change(player.status)
  538.         end
  539.     end
  540. end
  541.    
  542. -- Handle notifications of general user state change.
  543. function job_state_change(stateField, newValue, oldValue)
  544.     if state.WeaponLock.value == true then
  545.         disable('main','sub')
  546.     else
  547.         enable('main','sub')
  548.     end
  549. end
  550.  
  551. -------------------------------------------------------------------------------------------------------------------
  552. -- User code that supplements standard library decisions.
  553. -------------------------------------------------------------------------------------------------------------------
  554.  
  555. -- Modify the default idle set after it was constructed.
  556. function customize_idle_set(idleSet)
  557.     if player.mpp < 51 then
  558.         idleSet = set_combine(idleSet, sets.latent_refresh)
  559.         end
  560.     if state.Knockback.value == true then
  561.         idleSet = set_combine(idleSet, sets.defense.Knockback)
  562.         end
  563.     if state.Death.value == true then
  564.         idleSet = set_combine(idleSet, sets.defense.Death)
  565.         end
  566.     if state.CP.current == 'on' then
  567.         equip(sets.CP)
  568.         disable('back')
  569.     else
  570.         enable('back')
  571.     end
  572.  
  573.     return idleSet
  574. end
  575.  
  576. -- Modify the default melee set after it was constructed.
  577. function customize_melee_set(meleeSet)
  578.     if state.Knockback.value == true then
  579.         meleeSet = set_combine(meleeSet, sets.defense.Knockback)
  580.         end
  581.     if state.Death.value == true then
  582.         meleeSet = set_combine(meleeSet, sets.defense.Death)
  583.         end
  584.  
  585.     return meleeSet
  586. end
  587.  
  588. function customize_defense_set(defenseSet)
  589.     if state.Knockback.value == true then
  590.         defenseSet = set_combine(defenseSet, sets.defense.Knockback)
  591.         end
  592.     if state.Death.value == true then
  593.         defenseSet = set_combine(defenseSet, sets.defense.Death)
  594.         end
  595.  
  596.     return defenseSet
  597. end
  598.  
  599. -- Function to display the current relevant user state when doing an update.
  600. -- Set eventArgs.handled to true if display was handled, and you don't want the default info shown.
  601. function display_current_job_state(eventArgs)
  602.     local msg = 'Melee'
  603.    
  604.     if state.CombatForm.has_value then
  605.         msg = msg .. ' (' .. state.CombatForm.value .. ')'
  606.     end
  607.    
  608.     msg = msg .. ': '
  609.    
  610.     msg = msg .. state.OffenseMode.value
  611.     if state.HybridMode.value ~= 'Normal' then
  612.         msg = msg .. '/' .. state.HybridMode.value
  613.     end
  614.     msg = msg .. ', WS: ' .. state.WeaponskillMode.value
  615.    
  616.     if state.DefenseMode.value ~= 'None' then
  617.         msg = msg .. ', ' .. 'Defense: ' .. state.DefenseMode.value .. ' (' .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ')'
  618.     end
  619.    
  620.     if state.Kiting.value == true then
  621.         msg = msg .. ', Kiting'
  622.     end
  623.    
  624.     msg = msg .. ', Rune: '..state.Runes.current ..''
  625.    
  626.    
  627.     add_to_chat(122, msg)
  628.  
  629.     eventArgs.handled = true
  630.    
  631. end
  632.  
  633. -- Called by the 'update' self-command.
  634. function job_update(cmdParams, eventArgs)
  635.  
  636. end
  637.  
  638. -------------------------------------------------------------------------------------------------------------------
  639. -- General hooks for other events.
  640. -------------------------------------------------------------------------------------------------------------------
  641. function job_get_spell_map(spell, default_spell_map)
  642.     if spell.skill == 'Blue Magic' then
  643.         for category,spell_list in pairs(blue_magic_maps) do
  644.             if spell_list:contains(spell.english) then
  645.                 return category
  646.             end
  647.         end
  648.     end
  649. end
  650.  
  651. -------------------------------------------------------------------------------------------------------------------
  652. -- User code that supplements self-commands.
  653. -------------------------------------------------------------------------------------------------------------------
  654. function define_rune_info()
  655.     rune_info = {
  656.         ["Ignis"]   = {damage="Fire", resistance="Ice"},
  657.         ["Gelus"]   = {damage="Ice", resistance="Wind"},
  658.         ["Flabra"]  = {damage="Wind", resistance="Earth"},
  659.         ["Tellus"]  = {damage="Earth", resistance="Lightning"},
  660.         ["Sulpor"]  = {damage="Lightning", resistance="Water"},
  661.         ["Unda"]    = {damage="Water", resistance="Fire"},
  662.         ["Lux"]     = {damage="Light", resistance="Darkness"},
  663.         ["Tenebrae"]= {damage="Darkness", resistance="Light"},
  664.     }
  665. end
  666.  
  667. function job_self_command(cmdParams, eventArgs)
  668.     if cmdParams[2] then
  669.         local tab = {
  670.             Ignis= "Ignis - [Resistance] Ice | Bind, Paralyze. [Damage] Fire",
  671.             Gelus= "Gelus - [Resistance] Wind | Gravity, Silence. [Damage] Ice.",
  672.             Flabra= "Flabra - [Resistance] Earth | Slow, Petrify. [Damage] Wind.",
  673.             Tellus= "Tellus - [Resistance] Lightning | Stun. [Damage] Earth.",
  674.             Sulpor= "Sulpor - [Resistance] Water | Poison. [Damage] Lightning.",
  675.             Unda= "Unda - [Resistance] Fire | Addle, Amnesia, Plague. [Damage] Water.",
  676.             Lux= "Lux - [Resistance] Dark | Bio, Curse, Doom, Sleep (Dark), Terror, Zombie. [Damage] Light.",
  677.             Tenebrae= "Tenebrae - [Resistance] Light | Charm, Dia, Sleep (Light). [Damage] Dark.",}
  678.         add_to_chat(7,tab[state.Runes.value])
  679.     end
  680.    
  681.     if cmdParams[1]:lower() == 'rune' then
  682.         send_command('@input /ja '..state.Runes.value..' <me>')
  683.     end
  684. end
  685.  
  686. -------------------------------------------------------------------------------------------------------------------
  687. -- Utility functions specific to this job.
  688. -------------------------------------------------------------------------------------------------------------------
  689.  
  690. -- Select default macro book on initial load or subjob change.
  691. function get_rune_obi_element()
  692.     weather_rune = buffactive[elements.rune_of[world.weather_element] or '']
  693.     day_rune = buffactive[elements.rune_of[world.day_element] or '']
  694.    
  695.     local found_rune_element
  696.    
  697.     if weather_rune and day_rune then
  698.         if weather_rune > day_rune then
  699.             found_rune_element = world.weather_element
  700.         else
  701.             found_rune_element = world.day_element
  702.         end
  703.     elseif weather_rune then
  704.         found_rune_element = world.weather_element
  705.     elseif day_rune then
  706.         found_rune_element = world.day_element
  707.     end
  708.    
  709.     return found_rune_element
  710. end
  711.  
  712. function get_obi(element)
  713.     if element and elements.obi_of[element] then
  714.         return (player.inventory[elements.obi_of[element]] or player.wardrobe[elements.obi_of[element]]) and elements.obi_of[element]
  715.     end
  716. end
  717.  
  718. -- Select default macro book on initial load or subjob change.
  719. function select_default_macro_book()
  720.     -- Default macro set/book: (set, book)
  721.     if player.sub_job == 'BLU' then
  722.         set_macro_page(2, 11)
  723.     else
  724.         set_macro_page(1, 11)
  725.     end
  726. end
  727.  
  728. function set_lockstyle()
  729.     send_command('wait 6;input /lockstyleset 10')
  730. end
  731.  
  732.  
  733. --[[ Notes:
  734.  
  735. --- Omen ---
  736. --- Source: http://www.ffxiah.com/forum/topic/37086/endeavoring-to-awaken-a-guide-to-rune-fencer/105/#3215221
  737.  
  738. General Stuff:  Helps to organize enemies, being able to tank while doing objectives is a huge help. Gambit and Rayke are great for some of those magic damage objectives,
  739.                 but I haven't done runs with mages yet so I haven't had to think about them for NMs/Bosses. Toggling in/out of DT gear can be an easy way to do the 10 cures for 500+ if you have a smaller crew.
  740.                 I'm still not crazy about WAR here since there's a lot of dispel, etc and Provoke is still garbage. /BLU might be a bad call due to buff absorb/dispels.
  741.                 /SAM, /DRK, and /NIN should all be quite fine, though you might prefer one over others depending on your boss of choice, strategy, playstyle, and experiences.
  742.  
  743. Floor 1:        Might as well use Ignis to resist Paralyze. Barblizz/Para.
  744.  
  745. Floor 2:        I use Sulpor for resisting Attack Down. Barwater.
  746.  
  747. Glassy Craver:  Sulpor helps against Promyvion Brume. No matter what, you're going to lose hate regularly, though you should try to get it back so it doesn't murder your support.
  748.                 I ride Hasso and focus on DDing while I tank so I can contribute even when I don't have hate. Barwater/Poison.
  749.  
  750. Glassy Gorger:  Lux for his drain attack. Don't use Temper, Phalanx, or Ice Spikes. Up to you and your group if you wanna drop other buffs, but I find it's not a big deal.
  751.                 He can copy Wards, but it shouldn't be a big deal (for instance, he has no weapon, so Battuta doesn't do anything for him). Don't underestimate Quadratic Continuum. Barblizz/Para.
  752.  
  753. Glassy Thinker: Lux to resist Sleep/Curse/Blind. Only buff I'd suggest against is Temper (unless your dispellers aren't super lazy), since he can steal buffs.
  754.                 If you're tanking and unsure you'll be able to turn in time during Pain Sync, just back tank him. Pain Sync doesn't seem to have an element, but is Breath Damage, and OFA also works.
  755.                 Don't even bother using Lunge for a quick MB cuz you'll probably fuck it up and kill everyone. I like Barfire/virus.
  756.  
  757. Floor 4:        You'll probably change runes if you care, though I definitely recommend either Ignis or Lux for the Fu path (mostly undead).
  758.                 Helps a melee group when you can self-Light and kill a Transcended Skeleton or Ghost with Lunge.
  759.  
  760. All Bosses:     Lux. Barfire/Amnesia, except Fu, where you'd probably want Barwater or whatever. /DRK can help, as Arcane Circle will reduce all damage taken (including fixed moves) by 5%,
  761.                 and increase damage output by 5%. I wouldn't suggest it for Fu though, unless you're planning some kind of Souleater shenanigans.
  762.  
  763. Kin:            Lux Pflug helps big time vs. Death Sentence. Only WS when he's casting if you really wanna play it safe. If he uses Target on you, just stop using hate generating stuff until you lose hate for a second.
  764.  
  765. Gin:            Lux Wards and OFA reduce Zero Hour. Not a hard fight at all.
  766.  
  767. Kei:            Haven't fought him yet but you'll still want Lux (except maybe for Gambit/Rayke). Kei's strategy is a bit specific to go into detail here. /DRK and an HP set could be very helpful with reducing his fixed damage.
  768.  
  769. Kyou:           Haven't bothered with him either, but I could see either Seigan or /NIN working well to deal with his added effects (or just bark at your support). Heard he's overall pretty tame though.
  770.  
  771. Fu:             There's a lot of ways to handle this guy. Just bear in mind that when he's crazy, even super DT sets won't save you. I rely on Seigan and Battuta,
  772.                 especially if the plan is to push him down so you can ride Battuta longer. Might actually want Ignis for this too cuz he does use powerful Blizzaga.
  773.                 As the tank, I usually pull him alone from behind with a lot of buffs that won't help him (Preludes, Barwater/sleep, Crusade, etc).
  774.    
  775. ]]--
RAW Paste Data