SHARE
TWEET

dnc.lua

a guest Mar 30th, 2019 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Original: Motenten / Modified: Arislan
  2. -- Haste/DW Detection Requires Gearinfo Addon
  3.  
  4. -------------------------------------------------------------------------------------------------------------------
  5. --  Keybinds
  6. -------------------------------------------------------------------------------------------------------------------
  7.  
  8. --  Modes:      [ F9 ]              Cycle Offense Modes
  9. --              [ CTRL+F9 ]         Cycle Hybrid Modes
  10. --              [ WIN+F9 ]          Cycle Weapon Skill Modes
  11. --              [ F10 ]             Emergency -PDT Mode
  12. --              [ ALT+F10 ]         Toggle Kiting Mode
  13. --              [ F11 ]             Emergency -MDT Mode
  14. --              [ F12 ]             Update Current Gear / Report Current Status
  15. --              [ CTRL+F12 ]        Cycle Idle Modes
  16. --              [ ALT+F12 ]         Cancel Emergency -PDT/-MDT Mode
  17. --              [ WIN+F ]           Toggle Closed Position (Facing) Mode
  18. --              [ WIN+C ]           Toggle Capacity Points Mode
  19. --
  20. --  Abilities:  [ CTRL+- ]          Primary step element cycle forward.
  21. --              [ CTRL+= ]          Primary step element cycle backward.
  22. --              [ ALT+- ]           Secondary step element cycle forward.
  23. --              [ ALT+= ]           Secondary step element cycle backward.
  24. --              [ CTRL+[ ]          Toggle step target type.
  25. --              [ CTRL+] ]          Toggle use secondary step.
  26. --              [ Numpad0 ]         Perform Current Step
  27. --
  28. --              [ CTRL+` ]          Saber Dance
  29. --              [ ALT+` ]           Chocobo Jig II
  30. --              [ ALT+[ ]           Contradance
  31. --              [ CTRL+Numlock ]    Reverse Flourish
  32. --              [ CTRL+Numpad/ ]    Berserk/Meditate
  33. --              [ CTRL+Numpad* ]    Warcry/Sekkanoki
  34. --              [ CTRL+Numpad- ]    Aggressor/Third Eye
  35. --              [ CTRL+Numpad+ ]    Climactic Flourish
  36. --              [ CTRL+NumpadEnter ]Building Flourish
  37. --              [ CTRL+Numpad0 ]    Sneak Attack
  38. --              [ CTRL+Numpad. ]    Trick Attack
  39. --
  40. --  Spells:     [ WIN+, ]           Utsusemi: Ichi
  41. --              [ WIN+. ]           Utsusemi: Ni
  42. --
  43. --  WS:         [ CTRL+Numpad7 ]    Exenterator
  44. --              [ CTRL+Numpad4 ]    Evisceration
  45. --              [ CTRL+Numpad5 ]    Rudra's Storm
  46. --              [ CTRL+Numpad6 ]    Pyrrhic Kleos
  47. --              [ CTRL+Numpad1 ]    Aeolian Edge
  48. --
  49. --
  50. --              (Global-Binds.lua contains additional non-job-related keybinds)
  51.  
  52.  
  53. -------------------------------------------------------------------------------------------------------------------
  54. --  Custom Commands (preface with /console to use these in macros)
  55. -------------------------------------------------------------------------------------------------------------------
  56.  
  57. --  gs c step                       Uses the currently configured step on the target, with either <t> or
  58. --                                  <stnpc> depending on setting.
  59. --  gs c step t                     Uses the currently configured step on the target, but forces use of <t>.
  60. --
  61. --  gs c cycle mainstep             Cycles through the available steps to use as the primary step when using
  62. --                                  one of the above commands.
  63. --  gs c cycle altstep              Cycles through the available steps to use for alternating with the
  64. --                                  configured main step.
  65. --  gs c toggle usealtstep          Toggles whether or not to use an alternate step.
  66. --  gs c toggle selectsteptarget    Toggles whether or not to use <stnpc> (as opposed to <t>) when using a step.
  67.  
  68.  
  69. -------------------------------------------------------------------------------------------------------------------
  70. -- Setup functions for this job.  Generally should not be modified.
  71. -------------------------------------------------------------------------------------------------------------------
  72.  
  73. -- Initialization function for this job file.
  74. function get_sets()
  75.     mote_include_version = 2
  76.  
  77.     -- Load and initialize the include file.
  78.     include('Mote-Include.lua')
  79. end
  80.  
  81.  
  82. -- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
  83. function job_setup()
  84.     state.Buff['Climactic Flourish'] = buffactive['climactic flourish'] or false
  85.     state.Buff['Sneak Attack'] = buffactive['sneak attack'] or false
  86.  
  87.     state.MainStep = M{['description']='Main Step', 'Box Step', 'Quickstep', 'Feather Step', 'Stutter Step'}
  88.     state.AltStep = M{['description']='Alt Step', 'Quickstep', 'Feather Step', 'Stutter Step', 'Box Step'}
  89.     state.UseAltStep = M(false, 'Use Alt Step')
  90.     state.SelectStepTarget = M(false, 'Select Step Target')
  91.     state.IgnoreTargetting = M(true, 'Ignore Targetting')
  92.  
  93.     state.ClosedPosition = M(false, 'Closed Position')
  94.  
  95.     state.CurrentStep = M{['description']='Current Step', 'Main', 'Alt'}
  96. --  state.SkillchainPending = M(false, 'Skillchain Pending')
  97.  
  98.     state.CP = M(false, "Capacity Points Mode")
  99.  
  100.     lockstyleset = 1
  101. end
  102.  
  103. -------------------------------------------------------------------------------------------------------------------
  104. -- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
  105. -------------------------------------------------------------------------------------------------------------------
  106.  
  107. -- Setup vars that are user-dependent.  Can override this function in a sidecar file.
  108. function user_setup()
  109.     state.OffenseMode:options('STP', 'Normal', 'LowAcc', 'MidAcc', 'HighAcc')
  110.     state.HybridMode:options('Normal', 'DT')
  111.     state.WeaponskillMode:options('Normal', 'Acc')
  112.     state.IdleMode:options('Normal', 'DT')
  113.  
  114.     -- Additional local binds
  115.     include('Global-Binds.lua') -- OK to remove this line
  116.  
  117.     send_command('lua l gearinfo')
  118.  
  119.     send_command('bind ^- gs c cycleback mainstep')
  120.     send_command('bind ^= gs c cycle mainstep')
  121.     send_command('bind !- gs c cycleback altstep')
  122.     send_command('bind != gs c cycle altstep')
  123.     send_command('bind ^] gs c toggle usealtstep')
  124.     send_command('bind ![ input /ja "Contradance" <me>')
  125.     send_command('bind ^` input /ja "Saber Dance" <me>')
  126.     send_command('bind !` input /ja "Chocobo Jig II" <me>')
  127.     send_command('bind @f gs c toggle ClosedPosition')
  128.     send_command('bind ^numlock input /ja "Reverse Flourish" <me>')
  129.  
  130.     send_command('bind @c gs c toggle CP')
  131.  
  132.     if player.sub_job == 'WAR' then
  133.         send_command('bind ^numpad/ input /ja "Berserk" <me>')
  134.         send_command('bind ^numpad* input /ja "Warcry" <me>')
  135.         send_command('bind ^numpad- input /ja "Aggressor" <me>')
  136.     elseif player.sub_job == 'SAM' then
  137.         send_command('bind ^numpad/ input /ja "Meditate" <me>')
  138.         send_command('bind ^numpad* input /ja "Sekkanoki" <me>')
  139.         send_command('bind ^numpad- input /ja "Third Eye" <me>')
  140.     elseif player.sub_job == 'THF' then
  141.         send_command('bind ^numpad0 input /ja "Sneak Attack" <me>')
  142.         send_command('bind ^numpad. input /ja "Trick Attack" <me>')
  143.     end
  144.  
  145.     send_command('bind ^numpad+ input /ja "Climactic Flourish" <me>')
  146.     send_command('bind ^numpadenter input /ja "Building Flourish" <me>')
  147.  
  148.     send_command('bind ^numpad7 input /ws "Exenterator" <t>')
  149.     send_command('bind ^numpad4 input /ws "Evisceration" <t>')
  150.     send_command('bind ^numpad5 input /ws "Rudra\'s Storm" <t>')
  151.     send_command('bind ^numpad6 input /ws "Pyrrhic Kleos" <t>')
  152.     send_command('bind ^numpad1 input /ws "Aeolian Edge" <t>')
  153.  
  154.     send_command('bind numpad0 gs c step t')
  155.  
  156.     --select_default_macro_book()
  157.     set_lockstyle()
  158.  
  159.     Haste = 0
  160.     DW_needed = 0
  161.     DW = false
  162.     moving = false
  163.     update_combat_form()
  164.     determine_haste_group()
  165. end
  166.  
  167.  
  168. -- Called when this job file is unloaded (eg: job change)
  169. function user_unload()
  170.     send_command('unbind ^-')
  171.     send_command('unbind ^=')
  172.     send_command('unbind !-')
  173.     send_command('unbind !=')
  174.     send_command('unbind ^]')
  175.     send_command('unbind ^[')
  176.     send_command('unbind ^]')
  177.     send_command('unbind ![')
  178.     send_command('unbind ^`')
  179.     send_command('unbind !`')
  180.     send_command('unbind ^,')
  181.     send_command('unbind @f')
  182.     send_command('unbind @c')
  183.     send_command('unbind ^numlock')
  184.     send_command('unbind ^numpad/')
  185.     send_command('unbind ^numpad*')
  186.     send_command('unbind ^numpad-')
  187.     send_command('unbind ^numpad+')
  188.     send_command('unbind ^numpadenter')
  189.     send_command('unbind ^numpad7')
  190.     send_command('unbind ^numpad4')
  191.     send_command('unbind ^numpad5')
  192.     send_command('unbind ^numpad6')
  193.     send_command('unbind ^numpad1')
  194.     send_command('unbind numpad0')
  195.     send_command('unbind ^numpad0')
  196.     send_command('unbind ^numpad.')
  197.  
  198.     send_command('unbind #`')
  199.     send_command('unbind #1')
  200.     send_command('unbind #2')
  201.     send_command('unbind #3')
  202.     send_command('unbind #4')
  203.     send_command('unbind #5')
  204.     send_command('unbind #6')
  205.     send_command('unbind #7')
  206.     send_command('unbind #8')
  207.     send_command('unbind #9')
  208.     send_command('unbind #0')
  209.  
  210.     send_command('lua u gearinfo')
  211.  
  212. end
  213.  
  214.  
  215. -- Define sets and vars used by this job file.
  216. function init_gear_sets()
  217.  
  218.     ------------------------------------------------------------------------------------------------
  219.     ---------------------------------------- Precast Sets ------------------------------------------
  220.     ------------------------------------------------------------------------------------------------
  221.  
  222.     -- Enmity set
  223.     sets.Enmity = {
  224.      --   ammo="Sapience Orb", --2
  225.       --  head="Halitus Helm", --8
  226.       --  body="Emet Harness +1", --10
  227.       --  hands="Horos Bangles +3", --9
  228.      --   feet="Ahosi Leggings", --7
  229.      --   neck="Unmoving Collar +1", --10
  230.         ear1="Brutal Earring", --4
  231.      --   ear2="Trux Earring", --5
  232.     --    ring1="Supershear Ring", --5
  233.      --   ring2="Eihwaz Ring", --5
  234.     --    back=gear.DNC_WTZ_Cape, --10
  235.     --    waist="Kasiri Belt", --3
  236.         }
  237.  
  238.     sets.precast.JA['Provoke'] = sets.Enmity
  239.     sets.precast.JA['No Foot Rise'] = {body="Horos Casaque +3"}
  240.     sets.precast.JA['Trance'] = {head="Horos Tiara +3"}
  241.  
  242.     sets.precast.Waltz = {
  243.      --   ammo="Yamarang", --5
  244.      --   head="Horos Tiara +3", --15
  245.         body="Maxixi Casaque +1", --19(8)
  246.      --   hands="Maxixi Bangles +1",
  247.      --   legs="Dashing Subligar", --10
  248.         feet="Maxixi Toeshoes +1", --14
  249.       --  neck="Unmoving Collar +1",
  250.         --ear1="Handler's Earring +1",
  251.      --   ear2="Enchntr. Earring +1",
  252.      --   ring1={name="Carb. Ring +1", bag="wardrobe3"},
  253.      --   ring2={name="Carb. Ring +1", bag="wardrobe4"},
  254.      --   back=gear.DNC_WTZ_Cape,
  255.         waist="Aristo Belt",
  256.         } -- Waltz Potency/CHR
  257.  
  258.     sets.precast.WaltzSelf = set_combine(sets.precast.Waltz, {
  259.         head="Mummu Bonnet +1", --(8)
  260.     --    ring1="Asklepian Ring", --(3)
  261.      --   ear1="Roundel Earring", --5
  262.         }) -- Waltz effects received
  263.  
  264.     sets.precast.Waltz['Healing Waltz'] = {}
  265.     sets.precast.Samba = {head="Maxixi Tiara +1", back=gear.DNC_TP_Cape}
  266.     sets.precast.Jig = {}
  267.  
  268.     sets.precast.Step = {
  269.      --   ammo="Yamarang",
  270.         head="Maxixi Tiara +1",
  271.         body="Maxixi Casaque +1",
  272.       --  hands="Maxixi Bangles +1",
  273.         legs="Mummu Kecks +1",
  274.      --   feet="Horos T. Shoes +3",
  275.      --   neck="Combatant's Torque",
  276.      --   ear1="Mache Earring +1",
  277.      --   ear2="Telos Earring",
  278.      --   ring1="Regal Ring",
  279.     --    ring2="Ramuh Ring +1",
  280.      --   waist="Olseni Belt",
  281.     --    back=gear.DNC_TP_Cape
  282.         }
  283.  
  284.     sets.precast.Step['Feather Step'] = set_combine(sets.precast.Step, {feet="Macu. Toeshoes +1"})
  285.     sets.precast.Flourish1 = {}
  286.     sets.precast.Flourish1['Animated Flourish'] = sets.Enmity
  287.  
  288.     sets.precast.Flourish1['Violent Flourish'] = {
  289.       --  ammo="Hydrocera",
  290.         head="Mummu Bonnet +1",
  291.      --   body="Horos Casaque +3",
  292.         hands="Mummu Wrists +1",
  293.         legs="Mummu Kecks +1",
  294.         feet="Mummu Gamash. +1",
  295.     --    neck="Sanctity Necklace",
  296.     --    ear1="Digni. Earring",
  297.     --    ear2="Hermetic Earring",
  298.     --    ring1={name="Stikini Ring +1", bag="wardrobe3"},
  299.      --   ring2="Weather. Ring +1",
  300.      --   waist="Eschan Stone",
  301.      --   back=gear.DNC_TP_Cape,
  302.         } -- Magic Accuracy
  303.  
  304.     sets.precast.Flourish1['Desperate Flourish'] = {
  305.      --   ammo="Yamarang",
  306.         head="Maxixi Tiara +1",
  307.         body="Maxixi Casaque +1",
  308.      --   hands="Maxixi Bangles +1",
  309.     --    legs=gear.Herc_WS_legs,
  310.         feet="Maxixi Toeshoes +1",
  311.      --   neck="Combatant's Torque",
  312.      --   ear1="Cessance Earring",
  313.      --   ear2="Telos Earring",
  314.      --   ring1="Regal Ring",
  315.      --   ring2="Ramuh Ring +1",
  316.      --   back=gear.DNC_TP_Cape,
  317.         } -- Accuracy
  318.  
  319.     sets.precast.Flourish2 = {}
  320.     sets.precast.Flourish2['Reverse Flourish'] = {}
  321.     sets.precast.Flourish3 = {}
  322.     sets.precast.Flourish3['Striking Flourish'] = {}
  323.     sets.precast.Flourish3['Climactic Flourish'] = {}
  324.  
  325.     sets.precast.FC = {
  326.      --   ammo="Sapience Orb",
  327.       --  head=gear.Herc_MAB_head, --7
  328.      --   body=gear.Taeon_FC_body, --8
  329.      --   hands="Leyline Gloves", --8
  330.      --   legs="Rawhide Trousers", --5
  331.      --   feet=gear.Herc_MAB_feet, --2
  332.      --   neck="Orunmila's Torque", --5
  333.         ear1="Loquacious Earring", --2
  334.      --   ear2="Enchntr. Earring +1", --2
  335.      --   ring2="Weather. Ring +1", --6(4)
  336.         }
  337.  
  338.     sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {
  339.      --   ammo="Impatiens",
  340.      --   body="Passion Jacket",
  341.      --   ring1="Lebeche Ring",
  342.         })
  343.  
  344.  
  345.     ------------------------------------------------------------------------------------------------
  346.     ------------------------------------- Weapon Skill Sets ----------------------------------------
  347.     ------------------------------------------------------------------------------------------------
  348.  
  349.     sets.precast.WS = {
  350.     --    ammo="Focal Orb",
  351.     --    head="Lilitu Headpiece",
  352.       --  body=gear.Herc_WS_body,
  353.      --   hands="Maxixi Bangles +1",
  354.      --   legs="Horos Tights +3",
  355.     --    feet="Lustra. Leggings +1",
  356.      --   neck="Fotia Gorget",
  357.      --   ear1="Ishvara Earring",
  358.         ear2="Moonshade Earring",
  359.      --   ring1="Regal Ring",
  360.       --  ring2="Ilabrat Ring",
  361.      --   back=gear.DNC_WS1_Cape,
  362.      --   waist="Fotia Belt",
  363.         } -- default set
  364.  
  365.     sets.precast.WS.Acc = set_combine(sets.precast.WS, {
  366.      --   ammo="Falcon Eye",
  367.      --   head="Dampening Tam",
  368.        --   hands="Maxixi Bangles +1",
  369.      --   legs="Meg. Chausses +2",
  370.      --   feet="Meg. Jam. +2",
  371.       --  ear2="Telos Earring",
  372.         })
  373.  
  374.     sets.precast.WS.Critical = {body="Meg. Cuirie +2"}
  375.  
  376.     sets.precast.WS['Exenterator'] = set_combine(sets.precast.WS, {
  377.      --   ammo="Yamarang",
  378.     --    head=gear.Adhemar_B_head,
  379.      --   body="Meg. Cuirie +2",
  380.      --   legs="Meg. Chausses +2",
  381.      --   feet="Meg. Jam. +2",
  382.      --   ear1="Sherida Earring",
  383.         ear2="Brutal Earring",
  384.       -- back=gear.DNC_WS2_Cape,
  385.         })
  386.  
  387.     sets.precast.WS['Exenterator'].Acc = set_combine(sets.precast.WS['Exenterator'], {
  388.     --    ammo="Falcon Eye",
  389.      --   head="Dampening Tam",
  390.      --   body="Horos Casaque +3",
  391.      --   ear2="Telos Earring",
  392.         })
  393.  
  394.     sets.precast.WS['Pyrrhic Kleos'] = set_combine(sets.precast.WS, {
  395.      --   ammo="Cheruski Needle",
  396.     --    head="Lustratio Cap +1",
  397.     --    body="Horos Casaque +3",
  398.      --   hands=gear.Adhemar_B_hands,
  399.      --   legs="Samnuha Tights",
  400.      --   feet=gear.Herc_TA_feet,
  401.       --  ear1="Sherida Earring",
  402.       --  ear2="Mache Earring +1",
  403.         ring2="Epona's Ring",
  404.      --   back=gear.DNC_WS2_Cape,
  405.         })
  406.  
  407.     sets.precast.WS['Pyrrhic Kleos'].Acc = set_combine(sets.precast.WS['Pyrrhic Kleos'], {
  408.      --   ammo="Falcon Eye",
  409.      --   head="Dampening Tam",
  410.       --  hands=gear.Adhemar_B_hands,
  411.      --   legs=gear.Herc_WS_legs,
  412.      --   feet=gear.Herc_STP_feet,
  413.      --   ring2="Ramuh Ring +1",
  414.         })
  415.  
  416.     sets.precast.WS['Evisceration'] = set_combine(sets.precast.WS, {
  417.      --   ammo="Charis Feather",
  418.      --   head="Lustratio Cap +1",
  419.      --   body="Abnoba Kaftan",
  420.         hands="Mummu Wrists +1",
  421.      --   legs="Lustr. Subligar +1",
  422.      --   feet=gear.Herc_STP_feet,
  423.      --   ear1="Sherida Earring",
  424.      --   ear2="Mache Earring +1",
  425.         ring2="Mummu Ring",
  426.      --   back=gear.DNC_WS3_Cape,
  427.         })
  428.  
  429.     sets.precast.WS['Evisceration'].Acc = set_combine(sets.precast.WS['Evisceration'], {
  430.      --   ammo="Falcon Eye",
  431.      --   head="Dampening Tam",
  432.      --   body="Horos Casaque +3",
  433.      --   legs="Meg. Chausses +2",
  434.         feet="Maxixi Toeshoes +1",
  435.     --    ring1="Regal Ring",
  436.         })
  437.  
  438.     sets.precast.WS['Rudra\'s Storm'] = set_combine(sets.precast.WS, {
  439.         ammo="Charis Feather",
  440.     --    neck="Caro Necklace",
  441.      --   ear1="Sherida Earring",
  442.      --   waist="Grunfeld Rope",
  443.         })
  444.  
  445.     sets.precast.WS['Rudra\'s Storm'].Acc = set_combine(sets.precast.WS['Rudra\'s Storm'], {
  446.     --    ammo="Falcon Eye",
  447.     --    legs=gear.Herc_WS_legs,
  448.      --   feet=gear.Herc_STP_feet,
  449.      --   ear2="Telos Earring",
  450.         })
  451.  
  452.     sets.precast.WS['Aeolian Edge'] = {
  453.     --    ammo="Pemphredo Tathlum",
  454.      --   head=gear.Herc_MAB_head,
  455.     --    body="Samnuha Coat",
  456.     --    hands="Maxixi Bangles +1",
  457.     --    legs="Horos Tights +3",
  458.     --    feet=gear.Herc_MAB_feet,
  459.      --   neck="Baetyl Pendant",
  460.     --    ear1="Crematio Earring",
  461.      --   ear2="Friomisi Earring",
  462.    --     ring1={name="Shiva Ring +1", bag="wardrobe3"},
  463.    --     ring2={name="Shiva Ring +1", bag="wardrobe4"},
  464.     --    back="Argocham. Mantle",
  465.     --    waist="Eschan Stone",
  466.         }
  467.  
  468.     sets.precast.Skillchain = {
  469.     --    hands="Macu. Bangles +1",
  470.         }
  471.  
  472.  
  473.     ------------------------------------------------------------------------------------------------
  474.     ---------------------------------------- Midcast Sets ------------------------------------------
  475.     ------------------------------------------------------------------------------------------------
  476.  
  477.     sets.midcast.FastRecast = sets.precast.FC
  478.  
  479.     sets.midcast.SpellInterrupt = {
  480.     --    ammo="Impatiens", --10
  481.     --    ring1="Evanescence Ring", --5
  482.         }
  483.  
  484.     sets.midcast.Utsusemi = sets.midcast.SpellInterrupt
  485.  
  486.  
  487.     ------------------------------------------------------------------------------------------------
  488.     ----------------------------------------- Idle Sets --------------------------------------------
  489.     ------------------------------------------------------------------------------------------------
  490.  
  491.     sets.resting = {}
  492.  
  493.     sets.idle = {
  494.     ammo="Charis Feather",
  495.     head="Mummu Bonnet +1",
  496.     body="Maxixi Casaque +1",
  497.     hands="Mummu Wrists +1",
  498.     legs="Mummu Kecks +1",
  499.     feet="Mummu Gamash. +1",
  500.     neck="Charis Necklace",
  501.     waist="Dynamic Belt",
  502.     left_ear="Brutal Earring",
  503.     right_ear="Suppanomimi",
  504.     left_ring="Rajas Ring",
  505.     right_ring="Epona's Ring",
  506.     back=gear.DNC_TP_Cape,
  507.         }
  508.  
  509.     sets.idle.DT = set_combine(sets.idle, {
  510.      --   ammo="Staunch Tathlum +1", --3/3
  511.      --   head="Turms Cap +1",
  512.      --   body="Horos Casaque +3", --6/0
  513.     --    hands="Turms Mittens +1",
  514.     --    legs="Meg. Chausses +2", --6/0
  515.     --    feet="Turms Leggings +1",
  516.      --   neck="Loricate Torque +1", --6/6
  517.      --   ear1="Genmei Earring", --2/0
  518.      --   ear2="Etiolation Earring", --0/3
  519.      --   ring1="Gelatinous Ring +1", --7/(-1)
  520.      --   ring2="Defending Ring", --10/10
  521.      --   back="Moonlight Cape", --6/6
  522.       --  waist="Flume Belt +1", --4/0
  523.         })
  524.  
  525.     sets.idle.Town = set_combine(sets.idle, {
  526.      --   ammo="Yamarang",
  527.      --   head=gear.Adhemar_B_head,
  528.     --    body="Horos Casaque +3",
  529.      --   hands="Maxixi Bangles +1",
  530.     --    legs="Horos Tights +3",
  531.     --    neck="Combatant's Torque",
  532.     --    ear1="Sherida Earring",
  533.     --    ear2="Telos Earring",
  534.    --     back=gear.DNC_TP_Cape,
  535.     --    waist="Windbuffet Belt +1",
  536.         })
  537.  
  538.     sets.idle.Weak = sets.idle.DT
  539.  
  540.  
  541.     ------------------------------------------------------------------------------------------------
  542.     ---------------------------------------- Defense Sets ------------------------------------------
  543.     ------------------------------------------------------------------------------------------------
  544.  
  545.     sets.defense.PDT = sets.idle.DT
  546.     sets.defense.MDT = sets.idle.DT
  547.  
  548.     sets.Kiting = {feet="Skd. Jambeaux +1"}
  549.  
  550.  
  551.     ------------------------------------------------------------------------------------------------
  552.     ---------------------------------------- Engaged Sets ------------------------------------------
  553.     ------------------------------------------------------------------------------------------------
  554.  
  555.     -- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
  556.     -- sets if more refined versions aren't defined.
  557.     -- If you create a set with both offense and defense modes, the offense mode should be first.
  558.     -- EG: sets.engaged.Dagger.Accuracy.Evasion
  559.  
  560.     sets.engaged = {
  561.     ammo="Charis Feather",
  562.     head="Mummu Bonnet +1",
  563.     body="Maxixi Casaque +1",
  564.     hands="Mummu Wrists +1",
  565.     legs="Mummu Kecks +1",
  566.     feet="Mummu Gamash. +1",
  567.     neck="Charis Necklace",
  568.     waist="Dynamic Belt",
  569.     left_ear="Brutal Earring",
  570.     right_ear="Suppanomimi",
  571.     left_ring="Rajas Ring",
  572.     right_ring="Epona's Ring",
  573.     back=gear.DNC_TP_Cape,
  574.         }
  575.  
  576.     sets.engaged.LowAcc = set_combine(sets.engaged, {
  577.      --   head="Dampening Tam",
  578.      --   neck="Combatant's Torque",
  579.          left_ear="Brutal Earring",
  580.     right_ear="Suppanomimi",
  581.         })
  582.  
  583.     sets.engaged.MidAcc = set_combine(sets.engaged.LowAcc, {
  584.      --   ammo="Falcon Eye",
  585.      --   ear2="Telos Earring",
  586.      --   ring1={name="Chirich Ring +1", bag="wardrobe3"},
  587.     --   ring2="Ilabrat Ring",
  588.      --   waist="Kentarch Belt +1",
  589.          left_ear="Brutal Earring",
  590.     right_ear="Suppanomimi",
  591.         })
  592.  
  593.     sets.engaged.HighAcc = set_combine(sets.engaged.MidAcc, {
  594.         body="Maxixi Casaque +1",
  595.      --   legs="Horos Tights +3",
  596.      --   feet=gear.Herc_STP_feet,
  597.      --   ear2="Mache Earring +1",
  598.      --   ring1="Regal Ring",
  599.      --   ring2="Ramuh Ring +1",
  600.     --    waist="Olseni Belt",
  601.         left_ear="Brutal Earring",
  602.     right_ear="Suppanomimi",
  603.         })
  604.  
  605.     sets.engaged.STP = set_combine(sets.engaged, {
  606.     --   ring1={name="Chirich Ring +1", bag="wardrobe3"},
  607.      --   ring2={name="Chirich Ring +1", bag="wardrobe4"},
  608.          left_ear="Brutal Earring",
  609.     right_ear="Suppanomimi",
  610.         })
  611.  
  612.     -- * DNC Native DW Trait: 30% DW
  613.     -- * DNC Job Points DW Gift: 5% DW
  614.  
  615.     -- No Magic Haste (74% DW to cap)
  616.     sets.engaged.DW = {
  617.      --   ammo="Yamarang",
  618.      --   head=gear.Adhemar_B_head,
  619.      --   body="Macu. Casaque +1", --11
  620.      --   hands=gear.Adhemar_B_hands,
  621.      --   legs="Samnuha Tights",
  622.      --   feet=gear.Taeon_DW_feet, --9
  623.         neck="Charis Necklace", --5
  624.      --   ear1="Eabani Earring", --4
  625.         ear2="Suppanomimi", --5
  626.      --   ring1="Hetairoi Ring",
  627.         ring2="Epona's Ring",
  628.      --   back=gear.DNC_TP_Cape,
  629.         waist="Reiki Yotai", --7
  630.             left_ear="Brutal Earring",
  631.         } -- 41%
  632.  
  633.     sets.engaged.DW.LowAcc = set_combine(sets.engaged.DW, {
  634.      --   head="Dampening Tam",
  635.       --  neck="Combatant's Torque",
  636.           left_ear="Brutal Earring",
  637.     right_ear="Suppanomimi",
  638.         })
  639.  
  640.     sets.engaged.DW.MidAcc = set_combine(sets.engaged.DW.LowAcc, {
  641.         head="Maxixi Tiara +1", --8
  642.      --   ring1={name="Chirich Ring +1", bag="wardrobe3"},
  643.      --   ring2="Ilabrat Ring",
  644.      --   waist="Kentarch Belt +1",
  645.          left_ear="Brutal Earring",
  646.     right_ear="Suppanomimi",
  647.         })
  648.  
  649.     sets.engaged.DW.HighAcc = set_combine(sets.engaged.DW.MidAcc, {
  650.         body="Maxixi Casaque +1",
  651.      --   legs="Horos Tights +3",
  652.      --   feet=gear.Herc_STP_feet,
  653.      --   ear2="Mache Earring +1",
  654.       --  ring1="Regal Ring",
  655.       --  ring2="Ramuh Ring +1",
  656.      --   waist="Olseni Belt",
  657.          left_ear="Brutal Earring",
  658.     right_ear="Suppanomimi",
  659.         })
  660.  
  661.     sets.engaged.DW.STP = set_combine(sets.engaged.DW, {
  662.      --   ring1={name="Chirich Ring +1", bag="wardrobe3"},
  663.      --   ring2={name="Chirich Ring +1", bag="wardrobe4"},
  664.          left_ear="Brutal Earring",
  665.     right_ear="Suppanomimi",
  666.         })
  667.  
  668.     -- 15% Magic Haste (67% DW to cap)
  669.     sets.engaged.DW.LowHaste = {
  670.     --    ammo="Yamarang",
  671.     --    head=gear.Adhemar_B_head,
  672.     --    body="Macu. Casaque +1", --11
  673.     --    hands=gear.Adhemar_B_hands,
  674.     --    legs="Samnuha Tights",
  675.     --    feet=gear.Herc_TA_feet,
  676.         neck="Charis Necklace", --5
  677.      --   ear1="Eabani Earring", --4
  678.          left_ear="Brutal Earring",
  679.         ear2="Suppanomimi", --5
  680.       --  ring1="Hetairoi Ring",
  681.         ring2="Epona's Ring",
  682.      --   back=gear.DNC_TP_Cape,
  683.         waist="Reiki Yotai", --7
  684.         } -- 32%
  685.  
  686.     sets.engaged.DW.LowAcc.LowHaste = set_combine(sets.engaged.DW.LowHaste, {
  687.       --  head="Dampening Tam",
  688.      --   neck="Combatant's Torque",
  689.          left_ear="Brutal Earring",
  690.     right_ear="Suppanomimi",
  691.         })
  692.  
  693.     sets.engaged.DW.MidAcc.LowHaste = set_combine(sets.engaged.DW.LowAcc.LowHaste, {
  694.         head="Maxixi Tiara +1", --8
  695.       --  body="Horos Casaque +3",
  696.      --   ring1={name="Chirich Ring +1", bag="wardrobe3"},
  697.       --  ring2="Ilabrat Ring",
  698.       --  waist="Kentarch Belt +1",
  699.           left_ear="Brutal Earring",
  700.     right_ear="Suppanomimi",
  701.         })
  702.  
  703.     sets.engaged.DW.HighAcc.LowHaste = set_combine(sets.engaged.DW.MidAcc.LowHaste, {
  704.         body="Maxixi Casaque +1",
  705.       --  legs="Horos Tights +3",
  706.       -- feet=gear.Herc_STP_feet,
  707.       --  ear2="Mache Earring +1",
  708.       --  ring1="Regal Ring",
  709.      --   ring2="Ramuh Ring +1",
  710.      --   waist="Olseni Belt",
  711.          left_ear="Brutal Earring",
  712.     right_ear="Suppanomimi",
  713.         })
  714.  
  715.     sets.engaged.DW.STP.LowHaste = set_combine(sets.engaged.DW.LowHaste, {
  716.       --  ring1={name="Chirich Ring +1", bag="wardrobe3"},
  717.       --  ring2={name="Chirich Ring +1", bag="wardrobe4"},
  718.           left_ear="Brutal Earring",
  719.     right_ear="Suppanomimi",
  720.         })
  721.  
  722.     -- 30% Magic Haste (56% DW to cap)
  723.     sets.engaged.DW.MidHaste = {
  724.      --   ammo="Yamarang",
  725.     --    head=gear.Adhemar_B_head,
  726.     --    body=gear.Adhemar_B_body, --6
  727.      --   hands=gear.Adhemar_B_hands,
  728.      --   legs="Samnuha Tights",
  729.      --   feet=gear.Herc_TA_feet,
  730.      --   neck="Anu Torque",
  731.       --  ear1="Eabani Earring", --4
  732.           left_ear="Brutal Earring",
  733.         ear2="Suppanomimi", --5
  734.       --  ring1="Hetairoi Ring",
  735.         ring2="Epona's Ring",
  736.     --    back=gear.DNC_TP_Cape,
  737.         waist="Reiki Yotai", --7
  738.         } -- 22%
  739.  
  740.     sets.engaged.DW.LowAcc.MidHaste = set_combine(sets.engaged.DW.MidHaste, {
  741.       --  head="Dampening Tam",
  742.      --   neck="Combatant's Torque",
  743.          left_ear="Brutal Earring",
  744.     right_ear="Suppanomimi",
  745.         })
  746.  
  747.     sets.engaged.DW.MidAcc.MidHaste = set_combine(sets.engaged.DW.LowAcc.MidHaste, {
  748.         head="Maxixi Tiara +1", --8
  749.     --    body="Horos Casaque +3",
  750.     --    ring1={name="Chirich Ring +1", bag="wardrobe3"},
  751.     --    ring2="Ilabrat Ring",
  752.     --    waist="Kentarch Belt +1",
  753.         left_ear="Brutal Earring",
  754.     right_ear="Suppanomimi",
  755.         })
  756.  
  757.     sets.engaged.DW.HighAcc.MidHaste = set_combine(sets.engaged.DW.MidAcc.MidHaste, {
  758.         body="Maxixi Casaque +1",
  759.        -- legs="Horos Tights +3",
  760.        -- feet=gear.Herc_STP_feet,
  761.     --    ear2="Mache Earring +1",
  762.     --    ring1="Regal Ring",
  763.     --    ring2="Ramuh Ring +1",
  764.      --   waist="Olseni Belt",
  765.          left_ear="Brutal Earring",
  766.     right_ear="Suppanomimi",
  767.         })
  768.  
  769.     sets.engaged.DW.STP.MidHaste = set_combine(sets.engaged.DW.MidHaste, {
  770.      --   ring1={name="Chirich Ring +1", bag="wardrobe3"},
  771.       --  ring2={name="Chirich Ring +1", bag="wardrobe4"},
  772.           left_ear="Brutal Earring",
  773.     right_ear="Suppanomimi",
  774.         })
  775.  
  776.     -- 35% Magic Haste (51% DW to cap)
  777.     sets.engaged.DW.HighHaste = {
  778.      --   ammo="Yamarang",
  779.      --   head=gear.Adhemar_B_head,
  780.      --   body=gear.Adhemar_B_body, --6
  781.      --   hands=gear.Adhemar_B_hands,
  782.      --   legs="Samnuha Tights",
  783.      --   feet=gear.Herc_TA_feet,
  784.     --    neck="Anu Torque",
  785.     --    ear1="Eabani Earring", --4
  786.     right_ear="Suppanomimi",
  787.         ear2="Brutal Earring",
  788.      --  ring1="Hetairoi Ring",
  789.         ring2="Epona's Ring",
  790.     --    back=gear.DNC_TP_Cape,
  791.       --  waist="Windbuffet Belt +1",
  792.       } -- 10% Gear
  793.  
  794.     sets.engaged.DW.LowAcc.HighHaste = set_combine(sets.engaged.DW.HighHaste, {
  795.       --  head="Dampening Tam",
  796.      --   neck="Combatant's Torque",
  797.       --  waist="Kentarch Belt +1",
  798.           left_ear="Brutal Earring",
  799.     right_ear="Suppanomimi",
  800.         })
  801.  
  802.     sets.engaged.DW.MidAcc.HighHaste = set_combine(sets.engaged.DW.LowAcc.HighHaste, {
  803.       --  body="Horos Casaque +3",
  804.       --  ring1={name="Chirich Ring +1", bag="wardrobe3"},
  805.      --   ring2="Ilabrat Ring",
  806.          left_ear="Brutal Earring",
  807.     right_ear="Suppanomimi",
  808.         })
  809.  
  810.     sets.engaged.DW.HighAcc.HighHaste = set_combine(sets.engaged.DW.MidAcc.HighHaste, {
  811.         head="Maxixi Tiara +1", --8
  812.         body="Maxixi Casaque +1",
  813.      --   legs="Horos Tights +3",
  814.     --    feet=gear.Herc_STP_feet,
  815.     --    ear2="Mache Earring +1",
  816.    --     ring1="Regal Ring",
  817.    --     ring2="Ramuh Ring +1",
  818.      --   waist="Olseni Belt",
  819.          left_ear="Brutal Earring",
  820.     right_ear="Suppanomimi",
  821.         })
  822.  
  823.     sets.engaged.DW.STP.HighHaste = set_combine(sets.engaged.DW.HighHaste, {
  824.       --  ring1={name="Chirich Ring +1", bag="wardrobe3"},
  825.       --  ring2={name="Chirich Ring +1", bag="wardrobe4"},
  826.      --   waist="Kentarch Belt +1",
  827.          left_ear="Brutal Earring",
  828.     right_ear="Suppanomimi",
  829.         })
  830.  
  831.     -- 45% Magic Haste (36% DW to cap)
  832.     sets.engaged.DW.MaxHaste = {
  833.       --  ammo="Yamarang",
  834.      --   head=gear.Adhemar_B_head,
  835.      --   body="Horos Casaque +3",
  836.      --   hands=gear.Adhemar_B_hands,
  837.      --   legs="Samnuha Tights",
  838.      --   feet=gear.Herc_TA_feet,
  839.      --   neck="Anu Torque",
  840.      --   ear1="Sherida Earring",
  841.     left_ear="Brutal Earring",
  842.     right_ear="Suppanomimi",
  843.      --   ring1="Hetairoi Ring",
  844.         ring2="Epona's Ring",
  845.      --   back=gear.DNC_TP_Cape,
  846.      --   waist="Windbuffet Belt +1",
  847.         } -- 0%
  848.  
  849.     sets.engaged.DW.LowAcc.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, {
  850.      --   head="Dampening Tam",
  851.     --    neck="Combatant's Torque",
  852.     --    ear2="Telos Earring",
  853.     --    waist="Kentarch Belt +1",
  854.         left_ear="Brutal Earring",
  855.     right_ear="Suppanomimi",
  856.         })
  857.  
  858.     sets.engaged.DW.MidAcc.MaxHaste = set_combine(sets.engaged.DW.LowAcc.MaxHaste, {
  859.      --   ear1="Cessance Earring",
  860.      --   ring1={name="Chirich Ring +1", bag="wardrobe3"},
  861.      --   ring2="Ilabrat Ring",
  862.          left_ear="Brutal Earring",
  863.     right_ear="Suppanomimi",
  864.         })
  865.  
  866.     sets.engaged.DW.HighAcc.MaxHaste = set_combine(sets.engaged.DW.MidAcc.MaxHaste, {
  867.         head="Maxixi Tiara +1", --8
  868.         body="Maxixi Casaque +1",
  869.      --   legs="Horos Tights +3",
  870.      --   feet=gear.Herc_STP_feet,
  871.       --  ear2="Mache Earring +1",
  872.      --   ring1="Regal Ring",
  873.      --   ring2="Ramuh Ring +1",
  874.      --   waist="Olseni Belt",
  875.          left_ear="Brutal Earring",
  876.     right_ear="Suppanomimi",
  877.         })
  878.  
  879.     sets.engaged.DW.STP.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, {
  880.      --   ear2="Telos Earring",
  881.     --    ring1={name="Chirich Ring +1", bag="wardrobe3"},
  882.      --   ring2={name="Chirich Ring +1", bag="wardrobe4"},
  883.       --  waist="Kentarch Belt +1",
  884.           left_ear="Brutal Earring",
  885.     right_ear="Suppanomimi",
  886.         })
  887.  
  888.     ------------------------------------------------------------------------------------------------
  889.     ---------------------------------------- Hybrid Sets -------------------------------------------
  890.     ------------------------------------------------------------------------------------------------
  891.  
  892.     sets.engaged.Hybrid = {
  893.         head=gear.Adhemar_D_head, --4/0
  894.         body="Horos Casaque +3", --6/0
  895.       --  neck="Loricate Torque +1", --6/6
  896.      --   ring1="Moonlight Ring", --5/5
  897.      --   ring2="Defending Ring", --10/10
  898.         }
  899.  
  900.     sets.engaged.DT = set_combine(sets.engaged, sets.engaged.Hybrid)
  901.     sets.engaged.LowAcc.DT = set_combine(sets.engaged.LowAcc, sets.engaged.Hybrid)
  902.     sets.engaged.MidAcc.DT = set_combine(sets.engaged.MidAcc, sets.engaged.Hybrid)
  903.     sets.engaged.HighAcc.DT = set_combine(sets.engaged.HighAcc, sets.engaged.Hybrid)
  904.     sets.engaged.STP.DT = set_combine(sets.engaged.STP, sets.engaged.Hybrid)
  905.  
  906.     sets.engaged.DW.DT = set_combine(sets.engaged.DW, sets.engaged.Hybrid)
  907.     sets.engaged.DW.LowAcc.DT = set_combine(sets.engaged.DW.LowAcc, sets.engaged.Hybrid)
  908.     sets.engaged.DW.MidAcc.DT = set_combine(sets.engaged.DW.MidAcc, sets.engaged.Hybrid)
  909.     sets.engaged.DW.HighAcc.DT = set_combine(sets.engaged.DW.HighAcc, sets.engaged.Hybrid)
  910.     sets.engaged.DW.STP.DT = set_combine(sets.engaged.DW.STP, sets.engaged.Hybrid)
  911.  
  912.     sets.engaged.DW.DT.LowHaste = set_combine(sets.engaged.DW.LowHaste, sets.engaged.Hybrid)
  913.     sets.engaged.DW.LowAcc.DT.LowHaste = set_combine(sets.engaged.DW.LowAcc.LowHaste, sets.engaged.Hybrid)
  914.     sets.engaged.DW.MidAcc.DT.LowHaste = set_combine(sets.engaged.DW.MidAcc.LowHaste, sets.engaged.Hybrid)
  915.     sets.engaged.DW.HighAcc.DT.LowHaste = set_combine(sets.engaged.DW.HighAcc.LowHaste, sets.engaged.Hybrid)
  916.     sets.engaged.DW.STP.DT.LowHaste = set_combine(sets.engaged.DW.STP.LowHaste, sets.engaged.Hybrid)
  917.  
  918.     sets.engaged.DW.DT.MidHaste = set_combine(sets.engaged.DW.MidHaste, sets.engaged.Hybrid)
  919.     sets.engaged.DW.LowAcc.DT.MidHaste = set_combine(sets.engaged.DW.LowAcc.MidHaste, sets.engaged.Hybrid)
  920.     sets.engaged.DW.MidAcc.DT.MidHaste = set_combine(sets.engaged.DW.MidAcc.MidHaste, sets.engaged.Hybrid)
  921.     sets.engaged.DW.HighAcc.DT.MidHaste = set_combine(sets.engaged.DW.HighAcc.MidHaste, sets.engaged.Hybrid)
  922.     sets.engaged.DW.STP.DT.MidHaste = set_combine(sets.engaged.DW.STP.MidHaste, sets.engaged.Hybrid)
  923.  
  924.     sets.engaged.DW.DT.HighHaste = set_combine(sets.engaged.DW.HighHaste, sets.engaged.Hybrid)
  925.     sets.engaged.DW.LowAcc.DT.HighHaste = set_combine(sets.engaged.DW.LowAcc.HighHaste, sets.engaged.Hybrid)
  926.     sets.engaged.DW.MidAcc.DT.HighHaste = set_combine(sets.engaged.DW.MidAcc.HighHaste, sets.engaged.Hybrid)
  927.     sets.engaged.DW.HighAcc.DT.HighHaste = set_combine(sets.engaged.DW.HighAcc.HighHaste, sets.engaged.Hybrid)
  928.     sets.engaged.DW.STP.DT.HighHaste = set_combine(sets.engaged.DW.HighHaste.STP, sets.engaged.Hybrid)
  929.  
  930.     sets.engaged.DW.DT.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, sets.engaged.Hybrid)
  931.     sets.engaged.DW.LowAcc.DT.MaxHaste = set_combine(sets.engaged.DW.LowAcc.MaxHaste, sets.engaged.Hybrid)
  932.     sets.engaged.DW.MidAcc.DT.MaxHaste = set_combine(sets.engaged.DW.MidAcc.MaxHaste, sets.engaged.Hybrid)
  933.     sets.engaged.DW.HighAcc.DT.MaxHaste = set_combine(sets.engaged.DW.HighAcc.MaxHaste, sets.engaged.Hybrid)
  934.     sets.engaged.DW.STP.DT.MaxHaste = set_combine(sets.engaged.DW.STP.MaxHaste, sets.engaged.Hybrid)
  935.  
  936.  
  937.     ------------------------------------------------------------------------------------------------
  938.     ---------------------------------------- Special Sets ------------------------------------------
  939.     ------------------------------------------------------------------------------------------------
  940.  
  941.     sets.buff['Saber Dance'] = {}
  942.     sets.buff['Fan Dance'] = {}
  943.     sets.buff['Climactic Flourish'] = {} --body="Meg. Cuirie +2"}
  944.     sets.buff['Closed Position'] = {}
  945.  
  946.     sets.buff.Doom = {
  947.      --   neck="Nicander's Necklace", --20
  948.       --  ring1={name="Eshmun's Ring", bag="wardrobe3"}, --20
  949.       --  ring2={name="Eshmun's Ring", bag="wardrobe4"}, --20
  950.       --  waist="Gishdubar Sash", --10
  951.         }
  952.  
  953.     sets.CP = {}
  954.     --sets.Reive = {neck="Ygnas's Resolve +1"}
  955.  
  956. end
  957.  
  958.  
  959. -------------------------------------------------------------------------------------------------------------------
  960. -- Job-specific hooks for standard casting events.
  961. -------------------------------------------------------------------------------------------------------------------
  962.  
  963. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  964. -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
  965. function job_precast(spell, action, spellMap, eventArgs)
  966.     --auto_presto(spell)
  967.     if spellMap == 'Utsusemi' then
  968.         if buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)'] then
  969.             cancel_spell()
  970.             add_to_chat(123, '**!! '..spell.english..' Canceled: [3+ IMAGES] !!**')
  971.             eventArgs.handled = true
  972.             return
  973.         elseif buffactive['Copy Image'] or buffactive['Copy Image (2)'] then
  974.             send_command('cancel 66; cancel 444; cancel Copy Image; cancel Copy Image (2)')
  975.         end
  976.     end
  977. end
  978.  
  979. function job_post_precast(spell, action, spellMap, eventArgs)
  980.     if spell.type == "WeaponSkill" then
  981.         if state.Buff['Sneak Attack'] == true then
  982.             equip(sets.precast.WS.Critical)
  983.         end
  984.         if state.Buff['Climactic Flourish'] then
  985.             equip(sets.buff['Climactic Flourish'])
  986.         end
  987.     end
  988.     if spell.type=='Waltz' and spell.english:startswith('Curing') and spell.target.type == 'SELF' then
  989.         equip(sets.precast.WaltzSelf)
  990.     end
  991. end
  992.  
  993. -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
  994. function job_aftercast(spell, action, spellMap, eventArgs)
  995.     -- Weaponskills wipe SATA.  Turn those state vars off before default gearing is attempted.
  996.     if spell.type == 'WeaponSkill' and not spell.interrupted then
  997.         state.Buff['Sneak Attack'] = false
  998.     end
  999. end
  1000.  
  1001. -------------------------------------------------------------------------------------------------------------------
  1002. -- Job-specific hooks for non-casting events.
  1003. -------------------------------------------------------------------------------------------------------------------
  1004.  
  1005. -- Called when a player gains or loses a buff.
  1006. -- buff == buff gained or lost
  1007. -- gain == true if the buff was gained, false if it was lost.
  1008. function job_buff_change(buff,gain)
  1009.     if buff == 'Saber Dance' or buff == 'Climactic Flourish' or buff == 'Fan Dance' then
  1010.         handle_equipping_gear(player.status)
  1011.     end
  1012.  
  1013. --    if buffactive['Reive Mark'] then
  1014. --        if gain then
  1015. --            equip(sets.Reive)
  1016. --            disable('neck')
  1017. --        else
  1018. --            enable('neck')
  1019. --        end
  1020. --    end
  1021.  
  1022.     if buff == "doom" then
  1023.         if gain then
  1024.             equip(sets.buff.Doom)
  1025.     --        send_command('@input /p Doomed.')
  1026.              disable('ring1','ring2','waist')
  1027.         else
  1028.             enable('ring1','ring2','waist')
  1029.             handle_equipping_gear(player.status)
  1030.         end
  1031.     end
  1032.  
  1033. end
  1034.  
  1035. -------------------------------------------------------------------------------------------------------------------
  1036. -- User code that supplements standard library decisions.
  1037. -------------------------------------------------------------------------------------------------------------------
  1038.  
  1039. -- Called by the 'update' self-command, for common needs.
  1040. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  1041. function job_handle_equipping_gear(playerStatus, eventArgs)
  1042.     update_combat_form()
  1043.     determine_haste_group()
  1044. end
  1045.  
  1046. function job_update(cmdParams, eventArgs)
  1047.     handle_equipping_gear(player.status)
  1048. end
  1049.  
  1050. function update_combat_form()
  1051.     if DW == true then
  1052.         state.CombatForm:set('DW')
  1053.     elseif DW == false then
  1054.         state.CombatForm:reset()
  1055.     end
  1056. end
  1057.  
  1058. function get_custom_wsmode(spell, spellMap, defaut_wsmode)
  1059.     local wsmode
  1060.  
  1061.     if state.Buff['Sneak Attack'] then
  1062.         wsmode = 'SA'
  1063.     end
  1064.  
  1065.     return wsmode
  1066. end
  1067.  
  1068. function customize_idle_set(idleSet)
  1069.     if state.CP.current == 'on' then
  1070.         equip(sets.CP)
  1071.         disable('back')
  1072.     else
  1073.         enable('back')
  1074.     end
  1075.  
  1076.     return idleSet
  1077. end
  1078.  
  1079. function customize_melee_set(meleeSet)
  1080.     --if state.Buff['Climactic Flourish'] then
  1081.     --    meleeSet = set_combine(meleeSet, sets.buff['Climactic Flourish'])
  1082.     --end
  1083.     if state.ClosedPosition.value == true then
  1084.         meleeSet = set_combine(meleeSet, sets.buff['Closed Position'])
  1085.     end
  1086.  
  1087.     return meleeSet
  1088. end
  1089.  
  1090. -- Handle auto-targetting based on local setup.
  1091. function job_auto_change_target(spell, action, spellMap, eventArgs)
  1092.     if spell.type == 'Step' then
  1093.         if state.IgnoreTargetting.value == true then
  1094.             state.IgnoreTargetting:reset()
  1095.             eventArgs.handled = true
  1096.         end
  1097.  
  1098.         eventArgs.SelectNPCTargets = state.SelectStepTarget.value
  1099.     end
  1100. end
  1101.  
  1102.  
  1103. -- Function to display the current relevant user state when doing an update.
  1104. -- Set eventArgs.handled to true if display was handled, and you don't want the default info shown.
  1105. function display_current_job_state(eventArgs)
  1106.     local cf_msg = ''
  1107.     if state.CombatForm.has_value then
  1108.         cf_msg = ' (' ..state.CombatForm.value.. ')'
  1109.     end
  1110.  
  1111.     local m_msg = state.OffenseMode.value
  1112.     if state.HybridMode.value ~= 'Normal' then
  1113.         m_msg = m_msg .. '/' ..state.HybridMode.value
  1114.     end
  1115.  
  1116.     local ws_msg = state.WeaponskillMode.value
  1117.  
  1118.     local s_msg = state.MainStep.current
  1119.     if state.UseAltStep.value == true then
  1120.         s_msg = s_msg .. '/'..state.AltStep.current
  1121.     end
  1122.  
  1123.     local d_msg = 'None'
  1124.     if state.DefenseMode.value ~= 'None' then
  1125.         d_msg = state.DefenseMode.value .. state[state.DefenseMode.value .. 'DefenseMode'].value
  1126.     end
  1127.  
  1128.     local i_msg = state.IdleMode.value
  1129.  
  1130.     local msg = ''
  1131.     if state.Kiting.value then
  1132.         msg = msg .. ' Kiting: On |'
  1133.     end
  1134.  
  1135.     add_to_chat(002, '| ' ..string.char(31,210).. 'Melee' ..cf_msg.. ': ' ..string.char(31,001)..m_msg.. string.char(31,002)..  ' |'
  1136.         ..string.char(31,207).. ' WS: ' ..string.char(31,001)..ws_msg.. string.char(31,002)..  ' |'
  1137.         ..string.char(31,060).. ' Step: '  ..string.char(31,001)..s_msg.. string.char(31,002)..  ' |'
  1138.         ..string.char(31,004).. ' Defense: ' ..string.char(31,001)..d_msg.. string.char(31,002)..  ' |'
  1139.         ..string.char(31,008).. ' Idle: ' ..string.char(31,001)..i_msg.. string.char(31,002)..  ' |'
  1140.         ..string.char(31,002)..msg)
  1141.  
  1142.     eventArgs.handled = true
  1143. end
  1144.  
  1145.  
  1146. -------------------------------------------------------------------------------------------------------------------
  1147. -- User self-commands.
  1148. -------------------------------------------------------------------------------------------------------------------
  1149.  
  1150. -------------------------------------------------------------------------------------------------------------------
  1151. -- Utility functions specific to this job.
  1152. -------------------------------------------------------------------------------------------------------------------
  1153.  
  1154. function determine_haste_group()
  1155.     classes.CustomMeleeGroups:clear()
  1156.     if DW == true then
  1157.         if DW_needed <= 1 then
  1158.             classes.CustomMeleeGroups:append('MaxHaste')
  1159.         elseif DW_needed > 1 and DW_needed <= 9 then
  1160.             classes.CustomMeleeGroups:append('HighHaste')
  1161.         elseif DW_needed > 9 and DW_needed <= 21 then
  1162.             classes.CustomMeleeGroups:append('MidHaste')
  1163.         elseif DW_needed > 21 and DW_needed <= 39 then
  1164.             classes.CustomMeleeGroups:append('LowHaste')
  1165.         elseif DW_needed > 39 then
  1166.             classes.CustomMeleeGroups:append('')
  1167.         end
  1168.     end
  1169. end
  1170.  
  1171. function job_self_command(cmdParams, eventArgs)
  1172.     if cmdParams[1] == 'step' then
  1173.         if cmdParams[2] == 't' then
  1174.             state.IgnoreTargetting:set()
  1175.         end
  1176.  
  1177.         local doStep = ''
  1178.         if state.UseAltStep.value == true then
  1179.             doStep = state[state.CurrentStep.current..'Step'].current
  1180.             state.CurrentStep:cycle()
  1181.         else
  1182.             doStep = state.MainStep.current
  1183.         end
  1184.  
  1185.         send_command('@input /ja "'..doStep..'" <t>')
  1186.     end
  1187.  
  1188.     gearinfo(cmdParams, eventArgs)
  1189. end
  1190.  
  1191. function gearinfo(cmdParams, eventArgs)
  1192.     if cmdParams[1] == 'gearinfo' then
  1193.         if type(tonumber(cmdParams[2])) == 'number' then
  1194.             if tonumber(cmdParams[2]) ~= DW_needed then
  1195.             DW_needed = tonumber(cmdParams[2])
  1196.             DW = true
  1197.             end
  1198.         elseif type(cmdParams[2]) == 'string' then
  1199.             if cmdParams[2] == 'false' then
  1200.                 DW_needed = 0
  1201.                 DW = false
  1202.               end
  1203.         end
  1204.         if type(tonumber(cmdParams[3])) == 'number' then
  1205.               if tonumber(cmdParams[3]) ~= Haste then
  1206.                   Haste = tonumber(cmdParams[3])
  1207.             end
  1208.         end
  1209.         if type(cmdParams[4]) == 'string' then
  1210.             if cmdParams[4] == 'true' then
  1211.                 moving = true
  1212.             elseif cmdParams[4] == 'false' then
  1213.                 moving = false
  1214.             end
  1215.         end
  1216.         if not midaction() then
  1217.             job_update()
  1218.         end
  1219.     end
  1220. end
  1221.  
  1222.  
  1223. -- Automatically use Presto for steps when it's available and we have less than 3 finishing moves
  1224. function job_pretarget(spell, action, spellMap, eventArgs)
  1225.     if spell.type == 'Step' then
  1226.         local allRecasts = windower.ffxi.get_ability_recasts()
  1227.         local prestoCooldown = allRecasts[236]
  1228.         local under3FMs = not buffactive['Finishing Move 3'] and not buffactive['Finishing Move 4'] and not buffactive['Finishing Move 5']
  1229.  
  1230.         if player.main_job_level >= 77 and prestoCooldown < 1 and under3FMs then
  1231.             cast_delay(1.1)
  1232.             send_command('input /ja "Presto" <me>')
  1233.         end
  1234.     end
  1235. end
  1236.  
  1237. windower.register_event('zone change',
  1238.     function()
  1239.         send_command('gi ugs true')
  1240.     end
  1241. )
  1242.  
  1243. -- Select default macro book on initial load or subjob change.
  1244. function select_default_macro_book()
  1245.     --Default macro set/book: (set, book)
  1246.     if player.sub_job == 'WAR' then
  1247.       set_macro_page(1, 4)
  1248.     elseif player.sub_job == 'THF' then
  1249.       set_macro_page(1, 4)
  1250.     elseif player.sub_job == 'NIN' then
  1251.       set_macro_page(1, 4)
  1252.    elseif player.sub_job == 'RUN' then
  1253.       set_macro_page(1, 4)
  1254.    elseif player.sub_job == 'SAM' then
  1255.       set_macro_page(1, 4)
  1256.     else
  1257.         set_macro_page(1, 4)
  1258.     end
  1259. end
  1260.  
  1261. function set_lockstyle()
  1262.     send_command('wait 2; input /lockstyleset ' .. lockstyleset)
  1263. 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