SHARE
TWEET

RUN.lua

Zylakitty Dec 27th, 2018 195 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Original: Motenten / Modified: Arislan
  2.  
  3. -------------------------------------------------------------------------------------------------------------------
  4. --  Keybinds
  5. -------------------------------------------------------------------------------------------------------------------
  6.  
  7. --  Modes:      [ F9 ]              Cycle Offense Modes
  8. --              [ CTRL+F9 ]         Cycle Hybrid Modes
  9. --              [ WIN+F9 ]          Cycle Weapon Skill Modes
  10. --              [ F10 ]             Emergency -PDT Mode
  11. --              [ ALT+F10 ]         Toggle Kiting Mode
  12. --              [ F11 ]             Emergency -MDT Mode
  13. --              [ CTRL+F11 ]        Cycle Magic Defense Modes
  14. --              [ F12 ]             Update Current Gear / Report Current Status
  15. --              [ CTRL+F12 ]        Cycle Idle Modes
  16. --              [ ALT+F12 ]         Cancel Emergency -PDT/-MDT Mode
  17. --              [ WIN+H ]           Toggle Charm Defense Mods
  18. --              [ WIN+D ]           Toggle Death Defense Mods
  19. --              [ WIN+K ]           Toggle Knockback Defense Mods
  20. --              [ WIN+C ]           Toggle Capacity Points Mode
  21. --
  22. --  Spells      [ ALT+w ]           Crusade
  23. --              [ CTRL+w ]          Foil
  24. --              [ ALT+q ]           Regen IV
  25. --              [ ALT+e ]           Blink
  26. --              [ ALT+r ]           Refresh
  27. --              [ ALT+t ]           Aquaveil
  28. --              [ ALT+y ]           Phalanx
  29. --              [ CTRL+y ]          Cocoon
  30. --              [ ALT+u ]           Stoneskin
  31. --              [ ALT+o ]           Shock Spikes
  32. --              [ Alt+numpad/ ]     Utsusemi: Ichi
  33. --              [ CTRL+numpad/ ]    Utsusemi: Ni
  34. --
  35. --  Abilities:  [ CTRL+` ]          Use current Rune
  36. --              [ CTRL+[ ]          Valiance
  37. --              [ ALT+[ ]           Vallation
  38. --              [ WIN+[ ]           Gambit
  39. --              [ CTRL+] ]          Pflug
  40. --              [ ALT+] ]           Rayke
  41. --              [ WIN+] ]           Embolden
  42. --              [ CTRL+p ]          Liement
  43. --              [ ALT+p ]           All for One
  44. --              [ CTRL+- ]          Rune element cycle forward.
  45. --              [ CTRL+= ]          Rune element cycle backward.
  46. --              [ CTRL+Numpad/ ]    Berserk/Meditate/Souleater
  47. --              [ ALT+Numpad/ ]     Defender
  48. --              [ CTRL+Numpad* ]    Warcry/Sekkanoki/Last Resort
  49. --              [ ALT+Numpad* ]     Third Eye
  50. --              [ CTRL+Numpad- ]    Aggressor/Hasso/Weapon Bash
  51. --              [ AlT+Numpad- ]     Seigan/Arcane Circle
  52. --
  53. --  Weapons:    [ CTRL+G ]          Cycles between available greatswords
  54. --              [ CTRL+W ]          Toggle Weapon Lock
  55. --
  56. --  WS:         [ CTRL+Numpad8 ]    Resolution
  57. --              [ CTRL+Numpad7 ]    Dimidiation
  58. --              [ CTRL+Numpad9 ]    Ground Strike
  59. --              [ ALT+Numpad9 ]     Spinning Slash
  60. --              [ CTRL+Numpad1 ]    Herculean Slash
  61. --              [ CTRL+Numpad2 ]    Shockwave
  62.  
  63.  
  64. -------------------------------------------------------------------------------------------------------------------
  65. --  Custom Commands (preface with /console to use these in macros)
  66. -------------------------------------------------------------------------------------------------------------------
  67.  
  68.  
  69. --  gs c rune                       Uses current rune
  70. --  gs c cycle Runes                Cycles forward through rune elements
  71. --  gs c cycleback Runes            Cycles backward through rune elements
  72.  
  73.  
  74. -------------------------------------------------------------------------------------------------------------------
  75. -- Setup functions for this job.  Generally should not be modified.
  76. -------------------------------------------------------------------------------------------------------------------
  77.  
  78. -- Initialization function for this job file.
  79. function get_sets()
  80.     mote_include_version = 2
  81.  
  82.     -- Load and initialize the include file.
  83.     include('Mote-Include.lua')
  84. end
  85.  
  86. -- Setup vars that are user-independent.
  87. function job_setup()
  88.     -- /BLU Spell Maps
  89.     blue_magic_maps = {}
  90.  
  91.     blue_magic_maps.Enmity = S{'Blank Gaze', 'Geist Wall', 'Jettatura', 'Soporific',
  92.         'Poison Breath', 'Blitzstrahl', 'Sheep Song', 'Chaotic Eye'}
  93.     blue_magic_maps.Cure = S{'Wild Carrot'}
  94.     blue_magic_maps.Buffs = S{'Cocoon', 'Refueling'}
  95.  
  96.     rayke_duration = 47
  97.     gambit_duration = 96
  98.  
  99.     lockstyleset = 1
  100.  
  101. end
  102.  
  103. -------------------------------------------------------------------------------------------------------------------
  104. -- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
  105. -------------------------------------------------------------------------------------------------------------------
  106.  
  107. function user_setup()
  108.     state.OffenseMode:options('Normal', 'HighAcc')
  109.     state.WeaponskillMode:options('Normal', 'Acc')
  110.     state.HybridMode:options('Normal', 'DT')
  111.     state.CastingMode:options('Normal', 'Resistant')
  112.     state.IdleMode:options('Normal', 'DT')
  113.     state.PhysicalDefenseMode:options('PDT', 'Parry', 'HP')
  114.     state.MagicalDefenseMode:options('MDT', 'Status')
  115.    
  116.     state.WeaponLock = M(false, 'Weapon Lock')    
  117.     state.Greatsword = M{['description']='Current Weapon', 'Aettir'}
  118.     state.Charm = M(false, 'Charm Resistance')
  119.     state.Knockback = M(false, 'Knockback')
  120.     state.Death = M(false, "Death Resistance")
  121.     state.CP = M(false, "Capacity Points Mode")
  122.  
  123.     state.Runes = M{['description']='Runes', 'Ignis', 'Gelus', 'Flabra', 'Tellus', 'Sulpor', 'Unda', 'Lux', 'Tenebrae'}
  124.    
  125.     -- Additional local binds
  126.     send_command('bind ^` input //gs c rune')
  127.     send_command('bind !` input /ja "Vivacious Pulse" <me>')
  128.     send_command('bind @] input /ja "Embolden" <me>')
  129.     send_command('bind @[ input /ja "Gambit" <t>')
  130.     send_command('bind ^] input /ja "Pflug" <me>')
  131.     send_command('bind ^[ input /ja "Valiance" <me>')
  132.     send_command('bind !] input /ja "Rayke" <me>')
  133.     send_command('bind ![ input /ja "Vallation" <me>')
  134.     send_command('bind ^p input /ja "Liement" <me>')
  135.     send_command('bind !p input /ja "One for All" <me>')   
  136.     send_command('bind ^- gs c cycleback Runes')
  137.     send_command('bind ^= gs c cycle Runes')
  138.     send_command('bind ^f11 gs c cycle MagicalDefenseMode')
  139.     send_command('bind @c gs c toggle CP')
  140.     send_command('bind @g gs c cycle Greatsword')
  141.     send_command('bind @h gs c toggle Charm')
  142.     send_command('bind @k gs c toggle Knockback')
  143.     send_command('bind @d gs c toggle Death')
  144.     send_command('bind !q input /ma "Regen IV" <me>')
  145.     send_command('bind !w input /ma "Crusade" <me>')
  146.     send_command('bind ^w input /ma "Foil" <me>')
  147.     send_command('bind !e input /ma "Blink" <me>')
  148.     send_command('bind !r input /ma "Refresh" <stpc>')
  149.     send_command('bind !t input /ma "Aquaveil" <me>')
  150.     send_command('bind !y input /ma "Phalanx" <me>')
  151.     send_command('bind !u input /ma "Stoneskin" <me>')
  152.     send_command('bind !o input /ma "Shock Spikes" <me>')
  153.     send_command('bind ^z input /item "Echo Drops" <me>')  
  154.     send_command('bind ^x input /item "Remedy" <me>')
  155.     send_command('bind ^c input /item "Holy Water" <me>')  
  156.    
  157.     send_command('bind @w gs c toggle WeaponLock')
  158.     send_command('bind @c gs c toggle CP')
  159.  
  160.     if player.sub_job == 'WAR' then
  161.         send_command('bind ^numpad/ input /ja "Berserk" <me>')
  162.         send_command('bind ^numpad* input /ja "Warcry" <me>')
  163.         send_command('bind ^numpad- input /ja "Aggressor" <me>')
  164.         send_command('bind !numpad/ input /ja "Defender" <me>')
  165.         send_command('bind !. input /item "Silent Oil" <me>')
  166.         send_command('bind !, input /item "Prism Powder" <me>')
  167.     elseif player.sub_job == 'DRK' then
  168.         send_command('bind ^numpad/ input /ja "Souleater" <me>')
  169.         send_command('bind ^numpad* input /ja "Last Resort" <me>')
  170.         send_command('bind ^numpad- input /ja "Weapon Bash" <me>')
  171.         send_command('bind !numpad- input /ja "Arcane Circle" <me>')
  172.         send_command('bind !. input /item "Silent Oil" <me>')
  173.         send_command('bind !, input /item "Prism Powder" <me>')
  174.     elseif player.sub_job == 'SAM' then
  175.         send_command('bind ^numpad/ input /ja "Meditate" <me>')
  176.         send_command('bind ^numpad* input /ja "Sekkanoki" <me>')
  177.         send_command('bind ^numpad- input /ja "Hasso" <me>')
  178.         send_command('bind !numpad* input /ja "Third Eye" <me>')
  179.         send_command('bind !numpad- input /ja "Seigan" <me>')  
  180.         send_command('bind !. input /item "Silent Oil" <me>')
  181.         send_command('bind !, input /item "Prism Powder" <me>')
  182.     elseif player.sub_job == "NIN" then
  183.         send_command('bind !. input /ma "Monomi: Ichi" <me>')
  184.         send_command('bind !, input /ma "Tonko: Ni" <me>')
  185.         send_command('bind !numpad+ input /ma "Utsusemi: Ichi" <me>')
  186.         send_command('bind ^numpad+ input /ma "Utsusemi: Ni" <me>')
  187.     elseif player.sub_job == 'DNC' then
  188.         send_command('bind !. input /ja "Spectral Jig" <me>')
  189.     elseif player.sub_job == 'WHM' then
  190.         send_command('bind !. input /ma "Sneak" <me>')
  191.         send_command('bind !, input /ma "Invisible" <me>')
  192.     elseif player.sub_job == 'BLU' then
  193.         send_command('bind ^y input /ma "Cocoon" <me>')
  194.         send_command('bind !. input /item "Silent Oil" <me>')
  195.         send_command('bind !, input /item "Prism Powder" <me>')    
  196.     end
  197.  
  198.     send_command('bind ^numpad8 input /ws "Resolution" <t>')
  199.     send_command('bind ^numpad7 input /ws "Dimidiation" <t>')
  200.     send_command('bind ^numpad9 input /ws "Ground Strike" <t>')
  201.     send_command('bind !numpad9 input /ws "Spinning Slash" <t>')
  202.     send_command('bind ^numpad1 input /ws "Herculean Slash" <t>')
  203.     send_command('bind ^numpad2 input /ws "Shockwave" <t>')
  204.    
  205.     select_default_macro_book()
  206.     set_lockstyle()
  207. end
  208.  
  209. function user_unload()
  210.     send_command('unbind ^`')
  211.     send_command('unbind !`')
  212.     send_command('unbind !.')
  213.     send_command('unbind !,')  
  214.     send_command('unbind ^numpad+')
  215.     send_command('unbind !numpad+')    
  216.     send_command('unbind ^-')
  217.     send_command('unbind ^=')
  218.     send_command('unbind ^]')
  219.     send_command('unbind ^[')
  220.     send_command('unbind !]')
  221.     send_command('unbind ![')
  222.     send_command('unbind @]')
  223.     send_command('unbind @[')
  224.     send_command('unbind ^p')
  225.     send_command('unbind !p')  
  226.     send_command('unbind ^f11')
  227.     send_command('unbind @c')
  228.     send_command('unbind @h')
  229.     send_command('unbind @g')
  230.     send_command('unbind @k')
  231.     send_command('unbind @d')
  232.     send_command('unbind !q')
  233.     send_command('unbind !w')
  234.     send_command('unbind ^w')  
  235.     send_command('unbind !e')
  236.     send_command('unbind !r')
  237.     send_command('unbind !t')
  238.     send_command('unbind !y')
  239.     send_command('unbind ^y')  
  240.     send_command('unbind !u')  
  241.     send_command('unbind !o')
  242.     send_command('unbind ^,')
  243.     send_command('unbind @w')
  244.     send_command('unbind ^numpad/')
  245.     send_command('unbind ^numpad*')
  246.     send_command('unbind ^numpad-')
  247.     send_command('unbind ^numpad7')
  248.     send_command('unbind ^numpad9')
  249.     send_command('unbind !numpad9')
  250.     send_command('unbind ^numpad2')
  251.     send_command('unbind ^numpad1')
  252.     send_command('unbind @numpad*')
  253.     send_command('unbind ^z')
  254.     send_command('unbind ^x')
  255.     send_command('unbind ^c')  
  256.  
  257.     send_command('unbind #`')
  258.     send_command('unbind #1')
  259.     send_command('unbind #2')
  260.     send_command('unbind #3')
  261.     send_command('unbind #4')
  262.     send_command('unbind #5')
  263.     send_command('unbind #6')
  264.     send_command('unbind #7')
  265.     send_command('unbind #8')
  266.     send_command('unbind #9')
  267.     send_command('unbind #0')
  268. end
  269.  
  270. -- Define sets and vars used by this job file.
  271. function init_gear_sets()
  272.  
  273.     ------------------------------------------------------------------------------------------------
  274.     ---------------------------------------- Precast Sets ------------------------------------------
  275.     ------------------------------------------------------------------------------------------------
  276.  
  277.     -- Enmity sets
  278.     sets.Enmity = {
  279.         ammo="Sapience Orb", --2
  280.         head="Halitus Helm", --8
  281.         body="Emet Harness +1", --10
  282.         hands="Kurys Gloves", --9
  283.         legs="Eri. Leg Guards +1", --7
  284.         feet="Erilaz Greaves +1",--6
  285.         neck="Unmoving Collar +1", --10
  286.         ear1="Cryptic Earring", --4
  287.         ear2="Friomisi Earring", --2
  288.         ring1="Supershear Ring", --5
  289.         ring2="Eihwaz Ring", --5
  290.         back="Evasionist's Cape", --4
  291.         waist="Kasiri Belt", --3
  292.         }
  293.  
  294.     sets.Enmity.HP = set_combine(sets.Enmity, {
  295.         })
  296.  
  297.     sets.precast.JA['Vallation'] = set_combine(sets.Enmity, {body="Runeist's Coat +3", legs="Futhark Trousers +1", back="Ogma's Cape"})
  298.     sets.precast.JA['Valiance'] = sets.precast.JA['Vallation']
  299.     sets.precast.JA['Pflug'] = set_combine(sets.Enmity, {feet="Runeist's Boots +3"})
  300.     sets.precast.JA['Battuta'] = set_combine(sets.Enmity, {head="Fu. Bandeau +1"})
  301.     sets.precast.JA['Liement'] = set_combine(sets.Enmity, {body="Futhark Coat +1"})
  302.  
  303.     sets.precast.JA['Lunge'] = {
  304.         ammo="Ghastly Tathlum",
  305.         head={ name="Herculean Helm", augments={'"Mag.Atk.Bns."+22','Weapon skill damage +4%','Rng.Acc.+2','Rng.Atk.+10',}},
  306.         body={ name="Samnuha Coat", augments={'Mag. Acc.+12','"Mag.Atk.Bns."+12','"Dual Wield"+3',}},
  307.         hands={ name="Leyline Gloves", augments={'Accuracy+15','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Fast Cast"+3',}},
  308.         legs={ name="Herculean Trousers", augments={'Mag. Acc.+20 "Mag.Atk.Bns."+20','"Store TP"+5','INT+6','Mag. Acc.+15','"Mag.Atk.Bns."+10',}},
  309.         feet={ name="Herculean Boots", augments={'Mag. Acc.+19 "Mag.Atk.Bns."+19','STR+3','"Mag.Atk.Bns."+13',}},
  310.         neck="Sanctity Necklace",
  311.         waist="Eschan Stone",
  312.         left_ear="Friomisi Earring",
  313.         right_ear="Hecate's Earring",
  314.         left_ring="Shiva Ring +1",
  315.         right_ring="Shiva Ring +1",
  316.         back={ name="Evasionist's Cape", augments={'Enmity+4','"Embolden"+14','"Dbl.Atk."+2','Damage taken-3%',}},
  317.         }
  318.  
  319.     sets.precast.JA['Swipe'] = sets.precast.JA['Lunge']
  320.     sets.precast.JA['Gambit'] = {hands="Runeist's Mitons +3"}
  321.     sets.precast.JA['Rayke'] = {feet="Futhark Boots +1"}
  322.     sets.precast.JA['Elemental Sforzo'] = set_combine(sets.Enmity, {body="Futhark Coat +1"})
  323.     sets.precast.JA['Swordplay'] = set_combine(sets.Enmity, {hands="Futhark Mitons +1"})
  324.    
  325.     sets.precast.JA['Vivacious Pulse'] = set_combine(sets.Enmity, {
  326.         head="Erilaz Galea +1",
  327.         legs="Rune. Trousers +3",
  328.         neck="Incanter's Torque",
  329.         ear1="Beatific Earring",
  330.         ring1="Globidonta Ring",
  331.         waist="Bishop's Sash",
  332.         back="Merciful Cape",
  333.         })
  334.  
  335.     sets.precast.JA['One For All'] = set_combine(sets.Enmity, {})
  336.     sets.precast.JA['Provoke'] = sets.Enmity
  337.  
  338.     -- Fast cast sets for spells
  339.     sets.precast.FC = {
  340.         ammo="Sapience Orb",
  341.         head={ name="Carmine Mask", augments={'Accuracy+15','Mag. Acc.+10','"Fast Cast"+3',}},
  342.         body={ name="Taeon Tabard", augments={'Accuracy+19 Attack+19','"Fast Cast"+5','Phalanx +3',}},
  343.         hands={ name="Leyline Gloves", augments={'Accuracy+15','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Fast Cast"+3',}},
  344.         legs={ name="Rawhide Trousers", augments={'MP+50','"Fast Cast"+5','"Refresh"+1',}},
  345.         feet={ name="Carmine Greaves +1", augments={'HP+80','MP+80','Phys. dmg. taken -4',}},
  346.         neck="Orunmila's Torque",
  347.         waist="Austerity Belt",
  348.         left_ear="Loquac. Earring",
  349.         right_ear="Etiolation Earring",
  350.         left_ring="Rahab Ring",
  351.         right_ring="Kishar Ring",
  352.         back={ name="Evasionist's Cape", augments={'Enmity+4','"Embolden"+14','"Dbl.Atk."+2','Damage taken-3%',}},
  353.         }
  354.  
  355.     sets.precast.FC.HP = set_combine(sets.precast.FC, {
  356.         head="Rune. Bandeau +3",
  357.         body="Runeist's Coat +3",
  358.         ear1="Odnowa Earring",
  359.         ear2="Odnowa Earring +1",
  360.         ring1="Moonbeam Ring",
  361.         waist="Oneiros Belt",
  362.         })
  363.  
  364.     sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {
  365.         legs="Futhark Trousers +1",
  366.         waist="Siegel Sash",
  367.         })
  368.  
  369.     sets.precast.FC.Cure = set_combine(sets.precast.FC, {ammo="Impatiens", ear2="Mendi. Earring"})
  370.  
  371.     sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {
  372.         ammo="Impatiens",
  373.         body="Passion Jacket",
  374.         neck="Magoraga Beads",
  375.         ring1="Lebeche Ring",
  376.         waist="Rumination Sash",
  377.         })
  378.  
  379.  
  380.     ------------------------------------------------------------------------------------------------
  381.     ------------------------------------- Weapon Skill Sets ----------------------------------------
  382.     ------------------------------------------------------------------------------------------------
  383.  
  384.     sets.precast.WS = {
  385.         ammo="Seething Bomblet",
  386.         head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
  387.         body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
  388.         hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
  389.         legs={ name="Herculean Trousers", augments={'Accuracy+25','"Triple Atk."+3','DEX+4',}},
  390.         feet={ name="Herculean Boots", augments={'Accuracy+28','"Triple Atk."+3','DEX+1',}},
  391.         neck="Fotia Gorget",
  392.         waist="Fotia Belt",
  393.         left_ear="Sherida Earring",
  394.         right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +25',}},
  395.         left_ring="Epona's Ring",
  396.         right_ring="Niqmaddu Ring",
  397.         back={ name="Evasionist's Cape", augments={'Enmity+4','"Embolden"+14','"Dbl.Atk."+2','Damage taken-3%',}},
  398.         }
  399.  
  400.     sets.precast.WS.Acc = set_combine(sets.precast.WS, {
  401.         })
  402.  
  403.     sets.precast.WS['Resolution'] = set_combine(sets.precast.WS, {
  404.         })
  405.        
  406.     sets.precast.WS['Resolution'].Acc = set_combine(sets.precast.WS['Resolution'], {
  407.         })
  408.    
  409.     sets.precast.WS['Dimidiation'] = set_combine(sets.precast.WS, {
  410.         })
  411.        
  412.     sets.precast.WS['Dimidiation'].Acc = set_combine(sets.precast.WS['Dimidiation'], {
  413.         })
  414.  
  415.     sets.precast.WS['Herculean Slash'] = sets.precast.JA['Lunge']
  416.  
  417.     sets.precast.WS['Savage Blade'] = set_combine(sets.precast.WS, {
  418.         })
  419.  
  420.     sets.precast.WS['Sanguine Blade'] = {
  421.         }
  422.  
  423.     sets.precast.WS['True Strike'] = sets.precast.WS['Resolution']
  424.  
  425.     sets.precast.WS['True Strike'] = sets.precast.WS['Savage Blade']
  426.     sets.precast.WS['Judgment'] = sets.precast.WS['Savage Blade']
  427.     sets.precast.WS['Black Halo'] = sets.precast.WS['Savage Blade']
  428.  
  429.     sets.precast.WS['Flash Nova'] = set_combine(sets.precast.WS['Sanguine Blade'], {
  430.         })
  431.  
  432.     sets.precast.WS['Upheaval'] = sets.precast.WS['Resolution']
  433.     sets.precast.WS['Fell Cleave'] = sets.precast.WS['Savage Blade']
  434.  
  435.     sets.precast.WS['Full Break'] = {
  436.         }
  437.    
  438.     sets.precast.WS['Shockwave'] = {
  439.         }
  440.  
  441.  
  442.     ------------------------------------------------------------------------------------------------
  443.     ---------------------------------------- Midcast Sets ------------------------------------------
  444.     ------------------------------------------------------------------------------------------------
  445.  
  446.     sets.midcast.FastRecast = sets.precast.FC
  447.  
  448.     sets.midcast.SpellInterrupt = {
  449.         ammo="Impatiens", --10
  450.         hands="Regal Gauntlets", --10
  451.         legs="Carmine Cuisses +1", --20
  452.         ring1="Evanescence Ring", --5
  453.         waist="Rumination Sash", --10
  454.         }
  455.  
  456.     sets.midcast.Cure = {
  457.     ammo="Hydrocera",
  458.     head={ name="Dampening Tam", augments={'DEX+10','Accuracy+15','Mag. Acc.+15','Quadruple Attack +3',}},
  459.     body={ name="Taeon Tabard", augments={'Accuracy+19 Attack+19','"Fast Cast"+5','Phalanx +3',}},
  460.     hands="Aya. Manopolas +2",
  461.     legs={ name="Carmine Cuisses +1", augments={'Accuracy+20','Attack+12','"Dual Wield"+6',}},
  462.     feet="Meg. Jam. +1",
  463.     neck="Phalaina Locket",
  464.     waist="Chuq'aba Belt",
  465.     left_ear="Loquac. Earring",
  466.     right_ear="Etiolation Earring",
  467.     left_ring="Kunaji Ring",
  468.     right_ring="Levia. Ring",
  469.     back="Solemnity Cape",
  470.         }
  471.  
  472.     sets.midcast['Enhancing Magic'] = {
  473.     ammo="Yamarang",
  474.     head={ name="Carmine Mask", augments={'Accuracy+15','Mag. Acc.+10','"Fast Cast"+3',}},
  475.     body={ name="Taeon Tabard", augments={'Accuracy+19 Attack+19','"Fast Cast"+5','Phalanx +3',}},
  476.     hands={ name="Leyline Gloves", augments={'Accuracy+15','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Fast Cast"+3',}},
  477.     legs={ name="Carmine Cuisses +1", augments={'Accuracy+20','Attack+12','"Dual Wield"+6',}},
  478.     feet={ name="Herculean Boots", augments={'Accuracy+28','"Triple Atk."+3','DEX+1',}},
  479.     neck="Orunmila's Torque",
  480.     waist="Flume Belt",
  481.     left_ear="Loquac. Earring",
  482.     right_ear="Etiolation Earring",
  483.     left_ring="Kishar Ring",
  484.     right_ring="Prolix Ring",
  485.     back={ name="Evasionist's Cape", augments={'Enmity+4','"Embolden"+14','"Dbl.Atk."+2','Damage taken-3%',}},
  486.         }
  487.  
  488.     sets.midcast.EnhancingDuration = set_combine(sets.midcast['Enhancing Magic'], {
  489.         head="Erilaz Galea +1",
  490.         hands="Regal Gauntlets",
  491.         legs="Futhark Trousers +1",
  492.         })
  493.  
  494.     sets.midcast['Temper'] = set_combine(sets.midcast['Enhancing Magic'], {
  495.         main="Pukulatmuj +1",
  496.         sub="Pukulatmuj",
  497.         head="Carmine Mask",
  498.         body="Manasa Chasuble",
  499.         hands="Runeist's Mitons +3",
  500.         legs="Carmine Cuisses +1",
  501.         })
  502.  
  503.     sets.midcast['Phalanx'] = set_combine(sets.midcast['Enhancing Magic'], {
  504.         head="Fu. Bandeau +1", --5
  505.         body={ name="Taeon Tabard", augments={'Accuracy+19 Attack+19','"Fast Cast"+5','Phalanx +3',}}, 
  506.         })
  507.  
  508.     sets.midcast['Regen'] = set_combine(sets.midcast['Enhancing Magic'], {
  509.         head="Rune. Bandeau +3",
  510.         legs={ name="Taeon Tights", augments={'"Regen" potency+3',}},
  511.         })
  512.                
  513.     sets.midcast.Refresh = set_combine(sets.midcast['Enhancing Magic'], {waist="Gishdubar Sash"})
  514.    
  515.     sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {waist="Siegel Sash"})
  516.    
  517.     sets.midcast.Protect = set_combine(sets.midcast['Enhancing Magic'], {ring2="Sheltered Ring"})
  518.    
  519.     sets.midcast.Shell = sets.midcast.Protect
  520.  
  521.     sets.midcast['Divine Magic'] = {
  522.         ammo="Yamarang",
  523.         legs="Rune. Trousers +3",
  524.         neck="Incanter's Torque",
  525.         ring1="Stikini Ring",
  526.         ring2="Stikini Ring",
  527.         waist="Bishop's Sash",
  528.         }
  529.  
  530.     sets.midcast.Flash = sets.Enmity
  531.     sets.midcast.Foil = sets.Enmity
  532.     sets.midcast.Utsusemi = sets.midcast.SpellInterrupt
  533.    
  534.     sets.midcast['Blue Magic'] = {}
  535.     sets.midcast['Blue Magic'].Enmity = sets.Enmity
  536.     sets.midcast['Blue Magic'].Cure = sets.midcast.Cure
  537.     sets.midcast['Blue Magic'].Buff = sets.midcast['Enhancing Magic']
  538.  
  539.    
  540.     ------------------------------------------------------------------------------------------------
  541.     ----------------------------------------- Idle Sets --------------------------------------------
  542.     ------------------------------------------------------------------------------------------------
  543.  
  544.     sets.idle = {
  545.         ammo="Staunch Tathlum",
  546.         head={ name="Herculean Helm", augments={'AGI+14','VIT+1','"Refresh"+2','Accuracy+20 Attack+20','Mag. Acc.+5 "Mag.Atk.Bns."+5',}},
  547.         body="Runeist's Coat +2",
  548.         hands="Kurys Gloves",
  549.         legs={ name="Rawhide Trousers", augments={'MP+50','"Fast Cast"+5','"Refresh"+1',}},
  550.         feet="Aya. Gambieras +2",
  551.         neck="Sanctity Necklace",
  552.         waist="Flume Belt",
  553.         left_ear="Ethereal Earring",
  554.         right_ear="Infused Earring",
  555.         left_ring={ name="Dark Ring", augments={'Magic dmg. taken -3%','Phys. dmg. taken -6%',}},
  556.         right_ring="Defending Ring",
  557.         back={ name="Evasionist's Cape", augments={'Enmity+4','"Embolden"+14','"Dbl.Atk."+2','Damage taken-3%',}},
  558.         }
  559.  
  560.     sets.idle.DT = {
  561.         ammo="Staunch Tathlum",
  562.         head="Aya. Zucchetto +2",
  563.         body="Ayanmo Corazza +2",
  564.         hands="Aya. Manopolas +2",
  565.         legs="Eri. Leg Guards +1",
  566.         feet="Aya. Gambieras +2",
  567.         neck="Loricate Torque +1",
  568.         waist="Flume Belt",
  569.         left_ear="Ethereal Earring",
  570.         right_ear="Etiolation Earring",
  571.         left_ring={ name="Dark Ring", augments={'Magic dmg. taken -3%','Phys. dmg. taken -6%',}},
  572.         right_ring="Defending Ring",
  573.         back={ name="Evasionist's Cape", augments={'Enmity+4','"Embolden"+14','"Dbl.Atk."+2','Damage taken-3%',}},
  574.         }
  575.  
  576.     sets.idle.Weak = sets.idle.DT
  577.     sets.Kiting = {legs="Carmine Cuisses +1"}
  578.  
  579.  
  580.     ------------------------------------------------------------------------------------------------
  581.     ---------------------------------------- Defense Sets ------------------------------------------
  582.     ------------------------------------------------------------------------------------------------
  583.  
  584.     sets.defense.Charm = {
  585.         neck="Unmoving Collar +1",
  586.         ear2="Arete del Luna +1",
  587.         ring1="Wuji Ring",
  588.         back="Solemnity Cape",
  589.         }
  590.  
  591.     sets.defense.Knockback = {back="Repulse Mantle"}
  592.     sets.defense.Death = {body="Samnuha Coat", ring1="Warden's Ring", ring2="Eihwaz Ring"}
  593.  
  594.     sets.defense.PDT = {
  595.         ammo="Staunch Tathlum",
  596.         head="Aya. Zucchetto +2",
  597.         body="Ayanmo Corazza +2",
  598.         hands="Aya. Manopolas +2",
  599.         legs="Aya. Cosciales +2",
  600.         feet="Aya. Gambieras +2",
  601.         neck="Loricate Torque +1",
  602.         waist="Flume Belt",
  603.         left_ear="Ethereal Earring",
  604.         right_ear="Etiolation Earring",
  605.         left_ring={ name="Dark Ring", augments={'Magic dmg. taken -3%','Phys. dmg. taken -6%',}},
  606.         right_ring="Defending Ring",
  607.         back={ name="Evasionist's Cape", augments={'Enmity+4','"Embolden"+14','"Dbl.Atk."+2','Damage taken-3%',}},
  608.         }
  609.    
  610.     sets.defense.MDT = {
  611.         ammo="Staunch Tathlum",
  612.         head="Aya. Zucchetto +2",
  613.         body="Ayanmo Corazza +2",
  614.         hands="Aya. Manopolas +2",
  615.         legs="Aya. Cosciales +2",
  616.         feet="Aya. Gambieras +2",
  617.         neck="Loricate Torque +1",
  618.         waist="Flume Belt",
  619.         left_ear="Ethereal Earring",
  620.         right_ear="Etiolation Earring",
  621.         left_ring={ name="Dark Ring", augments={'Magic dmg. taken -3%','Phys. dmg. taken -6%',}},
  622.         right_ring="Defending Ring",
  623.         back="Reiki Cloak",
  624.         }
  625.  
  626.     sets.defense.Status = {
  627.         sub="Mensch Strap +1", --5/0
  628.         ammo="Staunch Tathlum", --2/2
  629.         head=gear.Herc_DT_head, --3/3
  630.         body="Ayanmo Corazza +2", --6/6
  631.         hands="Erilaz Gauntlets +1",
  632.         legs="Rune. Trousers +3", --5/0
  633.         feet="Erilaz Greaves +1", --5/0
  634.         neck="Loricate Torque +1", --6/6
  635.         ear1="Genmei Earring", --2/0
  636.         ear2="Hearty Earring",
  637.         ring1="Gelatinous Ring +1", --7/(-1)
  638.         ring2="Defending Ring", --10/10
  639.         back=gear.RUN_HP_Cape,
  640.         waist="Engraved Belt",
  641.         }
  642.    
  643.     sets.defense.HP = {
  644.         sub="Refined Grip +1", --3/3
  645.         ammo="Staunch Tathlum", --2/2
  646.         head=gear.Adhemar_D_head, --3/0
  647.         body="Runeist's Coat +3",
  648.         hands="Runeist's Mitons +3", --3/0
  649.         legs="Eri. Leg Guards +1", --7/0
  650.         feet="Turms Leggings",
  651.         neck="Loricate Torque +1", --6/6
  652.         ear1="Odnowa Earring", --0/1
  653.         ear2="Odnowa Earring +1", --0/2
  654.         ring1="Moonbeam Ring", --4/4
  655.         ring2="Defending Ring", --10/10
  656.         back="Moonbeam Cape", --5/5
  657.         waist="Flume Belt +1", --4/0
  658.         }
  659.  
  660.     sets.defense.Parry = {
  661.         sub="Refined Grip +1", --3/3
  662.         ammo="Staunch Tathlum", --2/2
  663.         head=gear.Herc_DT_head, --3/3
  664.         body="Meg. Cuirie +2", --8/0
  665.         hands="Turms Mittens",
  666.         legs="Eri. Leg Guards +1", --7/0
  667.         feet="Turms Leggings",
  668.         neck="Loricate Torque +1", --6/6
  669.         ear1="Odnowa Earring", --0/1
  670.         ear2="Odnowa Earring +1", --0/2
  671.         ring1="Gelatinous Ring +1", --7/(-1)
  672.         ring2="Defending Ring", --10/10
  673.         back=gear.RUN_HP_Cape,
  674.         waist="Flume Belt +1", --4/0
  675.         }
  676.  
  677.     ------------------------------------------------------------------------------------------------
  678.     ---------------------------------------- Engaged Sets ------------------------------------------
  679.     ------------------------------------------------------------------------------------------------
  680.  
  681.     sets.engaged = {
  682.         ammo="Yamarang",
  683.         head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
  684.         body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
  685.         hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
  686.         legs={ name="Herculean Trousers", augments={'Accuracy+25','"Triple Atk."+3','DEX+4',}},
  687.         feet={ name="Herculean Boots", augments={'Accuracy+28','"Triple Atk."+3','DEX+1',}},
  688.         neck="Clotharius Torque",
  689.         waist="Windbuffet Belt +1",
  690.         left_ear="Sherida Earring",
  691.         right_ear="Cessance Earring",
  692.         left_ring="Niqmaddu Ring",
  693.         right_ring="Epona's Ring",
  694.         back={ name="Evasionist's Cape", augments={'Enmity+4','"Embolden"+14','"Dbl.Atk."+2','Damage taken-3%',}},
  695.         }
  696.  
  697.     sets.engaged.HighAcc = set_combine(sets.engaged, {
  698.         ammo="Yamarang",
  699.         head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
  700.         body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
  701.         hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
  702.         legs="Meg. Chausses +2",
  703.         feet="Meg. Jam. +2",
  704.         neck="Iqabi Necklace",
  705.         waist="Kentarch Belt +1",
  706.         left_ear="Mache Earring",
  707.         right_ear="Mache Earring",
  708.         left_ring="Ramuh Ring +1",
  709.         right_ring="Niqmaddu Ring",
  710.          back={ name="Evasionist's Cape", augments={'Enmity+4','"Embolden"+14','"Dbl.Atk."+2','Damage taken-3%',}},
  711.         })
  712.  
  713.     sets.engaged.Aftermath = {
  714.         head="Aya. Zucchetto +2",
  715.         body="Turms Harness",
  716.         neck="Anu Torque",
  717.         ear2="Telos Earring",
  718.         ring1="Ilabrat Ring",
  719.         waist="Kentarch Belt +1",
  720.         }
  721.  
  722.  
  723.     ------------------------------------------------------------------------------------------------
  724.     ---------------------------------------- Hybrid Sets -------------------------------------------
  725.     ------------------------------------------------------------------------------------------------
  726.  
  727.     sets.engaged.DT = {
  728.         --sub="Mensch Strap +1", --5/0
  729.         ammo="Yamarang",
  730.         head=gear.Adhemar_D_head, --3/0
  731.         body="Ayanmo Corazza +2", --6/6
  732.         --hands=gear.Herc_DT_hands, --7/5
  733.         hands=gear.Adhemar_B_hands,
  734.         legs="Meg. Chausses +2", --6/0
  735.         feet=gear.Herc_TA_feet,
  736.         neck="Loricate Torque +1", --6/6
  737.         ear1="Sherida Earring",
  738.         ear2="Brutal Earring",
  739.         ring1="Moonbeam Ring",  --4/4
  740.         ring2="Defending Ring", --10/10
  741.         back=gear.RUN_TP_Cape,
  742.         waist="Ioskeha Belt",
  743.         }
  744.    
  745.     sets.engaged.HighAcc.DT = set_combine(sets.engaged.DT, {
  746.         hands="Runeist's Mitons +3", --3/0
  747.         feet=gear.Herc_STP_feet,
  748.         ear1="Cessance Earring",
  749.         })
  750.  
  751.     sets.engaged.Aftermath.DT = {
  752.         head="Aya. Zucchetto +2",
  753.         body="Turms Harness",
  754.         legs="Samnuha Tights",
  755.         feet="Carmine Greaves +1",
  756.         neck="Loricate Torque +1",
  757.         ear2="Telos Earring",
  758.         waist="Flume Belt +1",
  759.         }
  760.  
  761.     ------------------------------------------------------------------------------------------------
  762.     ---------------------------------------- Special Sets ------------------------------------------
  763.     ------------------------------------------------------------------------------------------------
  764.  
  765.     sets.buff.Doom = {ring1="Eshmun's Ring", ring2="Eshmun's Ring", waist="Gishdubar Sash"}
  766.  
  767.     sets.Embolden = set_combine(sets.midcast.EnhancingDuration, {back="Evasionist's Cape"})
  768.     sets.CP = {back="Aptitude Mantle +1"}
  769.     sets.Reive = {neck="Ygnas's Resolve +1"}
  770.  
  771. end
  772.  
  773. -------------------------------------------------------------------------------------------------------------------
  774. -- Job-specific hooks for standard casting events.
  775. -------------------------------------------------------------------------------------------------------------------
  776.  
  777. function job_precast(spell, action, spellMap, eventArgs)
  778.     if state.PhysicalDefenseMode.value == 'HP' then
  779.         eventArgs.handled = true
  780.         if spell.action_type == 'Magic' then
  781.             if spell.English == 'Flash' or spell.English == 'Foil' or spell.English == 'Stun'
  782.                 or blue_magic_maps.Enmity:contains(spell.english) then
  783.                 equip(sets.Enmity.HP)
  784.             else
  785.                 equip(sets.precast.FC.HP)
  786.             end
  787.         elseif spell.action_type == 'Ability' then
  788.             equip(sets.Enmity.HP)
  789.         end
  790.     end
  791.     if spell.english == 'Lunge' then
  792.         local abil_recasts = windower.ffxi.get_ability_recasts()
  793.         if abil_recasts[spell.recast_id] > 0 then
  794.             send_command('input /jobability "Swipe" <t>')
  795. --            add_to_chat(122, '***Lunge Aborted: Timer on Cooldown -- Downgrading to Swipe.***')
  796.             eventArgs.cancel = true
  797.             return
  798.         end
  799.     end
  800.     if spell.english == 'Valiance' then
  801.         local abil_recasts = windower.ffxi.get_ability_recasts()
  802.         if abil_recasts[spell.recast_id] > 0 then
  803.             send_command('input /jobability "Vallation" <me>')
  804.             eventArgs.cancel = true
  805.             return
  806.         elseif spell.english == 'Valiance' and buffactive['vallation'] then
  807.             cast_delay(0.2)
  808.             send_command('cancel Vallation') -- command requires 'cancel' add-on to work
  809.         end
  810.     end
  811.     if spellMap == 'Utsusemi' then
  812.         if buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)'] then
  813.             cancel_spell()
  814.             add_to_chat(123, '**!! '..spell.english..' Canceled: [3+ IMAGES] !!**')
  815.             eventArgs.handled = true
  816.             return
  817.         elseif buffactive['Copy Image'] or buffactive['Copy Image (2)'] then
  818.             send_command('cancel 66; cancel 444; cancel Copy Image; cancel Copy Image (2)')
  819.         end
  820.     end
  821. end
  822.  
  823. function job_midcast(spell, action, spellMap, eventArgs)
  824.     if state.PhysicalDefenseMode.value == 'HP' and spell.action_type == 'Magic' then
  825.         eventArgs.handled = true
  826.         equip(sets.Enmity.HP)
  827.     end
  828. end
  829.  
  830. -- Run after the default midcast() is done.
  831. -- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
  832. function job_post_midcast(spell, action, spellMap, eventArgs)
  833.     if spell.english == 'Lunge' or spell.english == 'Swipe' then
  834.         local obi = get_obi(get_rune_obi_element())
  835.         if obi then
  836.             equip({waist=obi})
  837.         end
  838.     end
  839.     if spell.skill == 'Enhancing Magic' and classes.NoSkillSpells:contains(spell.english) then
  840.         equip(sets.midcast.EnhancingDuration)
  841.         if spellMap == 'Refresh' then
  842.             equip(sets.midcast.Refresh)
  843.         end
  844.     end
  845.     -- If DefenseMode is active, apply that gear over midcast
  846.     -- choices.  Precast is allowed through for fast cast on
  847.     -- spells, but we want to return to def gear before there's
  848.     -- time for anything to hit us.
  849.     -- Exclude Job Abilities from this restriction, as we probably want
  850.     -- the enhanced effect of whatever item of gear applies to them,
  851.     -- and only one item should be swapped out.
  852.     --if state.DefenseMode.value ~= 'None' and spell.type ~= 'JobAbility' then
  853.     --    handle_equipping_gear(player.status)
  854.     --    eventArgs.handled = true
  855.     --end
  856. end
  857.  
  858. function job_aftercast(spell, action, spellMap, eventArgs)
  859.     if spell.name == 'Rayke' and not spell.interrupted then
  860.         send_command('@timers c "Rayke ['..spell.target.name..']" '..rayke_duration..' down spells/00136.png')
  861.         send_command('wait '..rayke_duration..';input /p Rayke: OFF <call21>;')
  862.     elseif spell.name == 'Gambit' and not spell.interrupted then
  863.         send_command('@timers c "Gambit ['..spell.target.name..']" '..gambit_duration..' down spells/00136.png')
  864.         send_command('wait '..gambit_duration..';input /p Gambit: OFF <call21>;')
  865.     end
  866. end
  867.  
  868. -------------------------------------------------------------------------------------------------------------------
  869. -- Job-specific hooks for non-casting events.
  870. -------------------------------------------------------------------------------------------------------------------
  871.  
  872. -- Called when the player's status changes.
  873. function job_state_change(field, new_value, old_value)
  874.     classes.CustomDefenseGroups:clear()
  875.     classes.CustomDefenseGroups:append(state.Charm.current)
  876.     classes.CustomDefenseGroups:append(state.Knockback.current)
  877.     classes.CustomDefenseGroups:append(state.Death.current)
  878.  
  879.     classes.CustomMeleeGroups:clear()
  880.     classes.CustomMeleeGroups:append(state.Charm.current)
  881.     classes.CustomMeleeGroups:append(state.Knockback.current)
  882.     classes.CustomMeleeGroups:append(state.Death.current)
  883. end
  884.  
  885. function job_buff_change(buff,gain)
  886.     -- If we gain or lose any haste buffs, adjust which gear set we target.
  887. --    if buffactive['Reive Mark'] then
  888. --        if gain then          
  889. --            equip(sets.Reive)
  890. --            disable('neck')
  891. --        else
  892. --            enable('neck')
  893. --        end
  894. --    end
  895.  
  896.     if buff == "doom" then
  897.         if gain then          
  898.             equip(sets.buff.Doom)
  899.             send_command('@input /p Doomed.')
  900.              disable('ring1','ring2','waist')
  901.         else
  902.             enable('ring1','ring2','waist')
  903.             handle_equipping_gear(player.status)
  904.         end
  905.     end
  906.  
  907.     if buff == 'Embolden' then
  908.         if gain then
  909.             equip(sets.Embolden)
  910.             disable('head','legs','back')            
  911.         else
  912.             enable('head','legs','back')            
  913.             status_change(player.status)
  914.         end
  915.     end
  916.  
  917.     if buff:startswith('Aftermath') then
  918.         state.Buff.Aftermath = gain
  919.         customize_melee_set()
  920.         handle_equipping_gear(player.status)
  921.     end
  922.  
  923.     if buff == 'Battuta' and not gain then
  924.         status_change(player.status)
  925.     end
  926.  
  927. end
  928.    
  929. -- Handle notifications of general user state change.
  930. function job_state_change(stateField, newValue, oldValue)
  931.     if state.WeaponLock.value == true then
  932.         disable('main','sub')
  933.     else
  934.         enable('main','sub')
  935.     end
  936. end
  937.  
  938. -------------------------------------------------------------------------------------------------------------------
  939. -- User code that supplements standard library decisions.
  940. -------------------------------------------------------------------------------------------------------------------
  941.  
  942. -- Modify the default idle set after it was constructed.
  943. function customize_idle_set(idleSet)
  944.     if player.mpp < 51 then
  945.         idleSet = set_combine(idleSet, sets.latent_refresh)
  946.     end
  947.     if state.Charm.value == true then
  948.         idleSet = set_combine(idleSet, sets.defense.Charm)
  949.     end    
  950.     if state.Knockback.value == true then
  951.         idleSet = set_combine(idleSet, sets.defense.Knockback)
  952.     end
  953.     if state.Death.value == true then
  954.         idleSet = set_combine(idleSet, sets.defense.Death)
  955.     end
  956.  
  957.     if state.Greatsword.current == 'Epeolatry' then
  958.         equip({main="Epeolatry"})
  959.     elseif state.Greatsword.current == 'Lionheart' then
  960.         equip({main="Lionheart"})
  961.     elseif state.Greatsword.current == 'Aettir' then
  962.         equip({main="Aettir"})
  963.     end
  964.  
  965.     --if state.CP.current == 'on' then
  966.     --    equip(sets.CP)
  967.     --    disable('back')
  968.     --else
  969.     --    enable('back')
  970.     --end
  971.  
  972.     return idleSet
  973. end
  974.  
  975. -- Modify the default melee set after it was constructed.
  976. function customize_melee_set(meleeSet)
  977.      if buffactive['Aftermath: Lv.3'] and player.equipment.main == "Epeolatry"
  978.         and state.DefenseMode.value == 'None' then
  979.         if state.HybridMode.value == "DT" then
  980.             meleeSet = set_combine(meleeSet, sets.engaged.Aftermath.DT)
  981.         else
  982.             meleeSet = set_combine(meleeSet, sets.engaged.Aftermath)
  983.         end
  984.     end
  985.     if state.Charm.value == true then
  986.         meleeSet = set_combine(meleeSet, sets.defense.Charm)
  987.     end
  988.     if state.Knockback.value == true then
  989.         meleeSet = set_combine(meleeSet, sets.defense.Knockback)
  990.     end
  991.     if state.Death.value == true then
  992.         meleeSet = set_combine(meleeSet, sets.defense.Death)
  993.     end
  994.  
  995.     return meleeSet
  996. end
  997.  
  998. function customize_defense_set(defenseSet)
  999.     if buffactive['Battuta'] then
  1000.         defenseSet = set_combine(defenseSet, sets.defense.Parry)
  1001.     end
  1002.     if state.Charm.value == true then
  1003.         defenseSet = set_combine(defenseSet, sets.defense.Charm)
  1004.     end
  1005.     if state.Knockback.value == true then
  1006.         defenseSet = set_combine(defenseSet, sets.defense.Knockback)
  1007.     end
  1008.     if state.Death.value == true then
  1009.         defenseSet = set_combine(defenseSet, sets.defense.Death)
  1010.     end
  1011.  
  1012.     return defenseSet
  1013. end
  1014.  
  1015. -- Function to display the current relevant user state when doing an update.
  1016. -- Set eventArgs.handled to true if display was handled, and you don't want the default info shown.
  1017. function display_current_job_state(eventArgs)
  1018.     local msg = '[ Melee'
  1019.    
  1020.     if state.CombatForm.has_value then
  1021.         msg = msg .. ' (' .. state.CombatForm.value .. ')'
  1022.     end
  1023.    
  1024.     msg = msg .. ': '
  1025.    
  1026.     msg = msg .. state.OffenseMode.value
  1027.     if state.HybridMode.value ~= 'Normal' then
  1028.         msg = msg .. '/' .. state.HybridMode.value
  1029.     end
  1030.     msg = msg .. ' ][ WS: ' .. state.WeaponskillMode.value .. ' ]'
  1031.    
  1032.     if state.DefenseMode.value ~= 'None' then
  1033.         msg = msg .. '[ Defense: ' .. state.DefenseMode.value .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ' ]'
  1034.     end
  1035.    
  1036.     if state.Charm.value == true then
  1037.         msg = msg .. '[ Charm ]'
  1038.     end
  1039.  
  1040.     if state.Knockback.value == true then
  1041.         msg = msg .. '[ Knockback ]'
  1042.     end
  1043.    
  1044.     if state.Death.value == true then
  1045.         msg = msg .. '[ Death ]'
  1046.     end
  1047.  
  1048.     if state.Kiting.value then
  1049.         msg = msg .. '[ Kiting Mode ]'
  1050.     end
  1051.    
  1052.     msg = msg .. '[ *' .. state.Runes.current .. '* ]'
  1053.    
  1054.     add_to_chat(060, msg)
  1055.  
  1056.     eventArgs.handled = true
  1057. end
  1058.  
  1059. -------------------------------------------------------------------------------------------------------------------
  1060. -- General hooks for other events.
  1061. -------------------------------------------------------------------------------------------------------------------
  1062. function job_get_spell_map(spell, default_spell_map)
  1063.     if spell.skill == 'Blue Magic' then
  1064.         for category,spell_list in pairs(blue_magic_maps) do
  1065.             if spell_list:contains(spell.english) then
  1066.                 return category
  1067.             end
  1068.         end
  1069.     end
  1070. end
  1071.  
  1072. -------------------------------------------------------------------------------------------------------------------
  1073. -- User code that supplements self-commands.
  1074. -------------------------------------------------------------------------------------------------------------------
  1075. function job_self_command(cmdParams, eventArgs)
  1076.     if cmdParams[1]:lower() == 'rune' then
  1077.         send_command('@input /ja '..state.Runes.value..' <me>')
  1078.     end
  1079. end
  1080.  
  1081. -------------------------------------------------------------------------------------------------------------------
  1082. -- Utility functions specific to this job.
  1083. -------------------------------------------------------------------------------------------------------------------
  1084.  
  1085. -- Select default macro book on initial load or subjob change.
  1086. function select_default_macro_book()
  1087.     -- Default macro set/book: (set, book)
  1088.     if player.sub_job == 'BLU' then
  1089.         set_macro_page(1, 5)
  1090.     elseif player.sub_job == 'SAM' then
  1091.         set_macro_page(2, 5)
  1092.     elseif player.sub_job == 'DRK' then
  1093.         set_macro_page(3, 5)
  1094.     elseif player.sub_job == 'WAR' then
  1095.         set_macro_page(4, 5)
  1096.     elseif player.sub_job == 'WHM' then
  1097.         set_macro_page(5, 5)
  1098.     else
  1099.         set_macro_page(7, 5)
  1100.     end
  1101. end
  1102.  
  1103. function set_lockstyle()
  1104.     send_command('wait 2; input /lockstyleset ' .. lockstyleset)
  1105. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top