Simple Lua Request

Langues: JP EN DE FR
users online
Forum » FFXI » Jobs » Dancer » Simple Lua Request
Simple Lua Request
Offline
Posts: 15
By Fatigue 2020-06-10 05:42:48
Link | Citer | R
 
Hello,

I currently use the LUA in the Last Dance guide on the link above.

It does a bit too much for my taste, I feel like I lack too much control, but there are two things it does I really love. It auto uses Presto for me when it's beneficial. Then it also detects the appropriate curing waltz to use which I love, as it saves me macros.

Something it doesn't seem to have, unless I'm missing it, is a set for Climatic Flourish Rudra's Storm.

It also prevents me from using //gs disable on items to use like an Endorsement ring I have to unload gearinfo, and there are too many hotkeys that I can't figure out how to unbind and just too many things for a controller user.

I was wondering if anyone had a LUA that had the following things:

Auto Detect Waltz Tier.

Auto Use Presto

3 Gear Swaps on a single Hotkey, Accuracy, Normal and DT.

A Climactic Rudra's Storm Weaponskill Set

A Regular Weaponskill Set.

Then all of the job abilities and things.

Then at most maybe another toggle for levels of haste. Preferably with the ability to bind it to a key I like, like the num pad keys. I can't seem to be able to unbind the F10-12 keys to something else.

I'd still love it for things like //gs disable to work and to have full control, rather than things being automated.

If you have something close to that, or wouldn't mind making that I'd definitely be appreciative and if you like I can certainly reward you for your time and effort if you're on Asura.
 Bahamut.Kageniai
Offline
Serveur: Bahamut
Game: FFXI
user: Godssin
Posts: 20
By Bahamut.Kageniai 2020-06-10 08:01:27
Link | Citer | R
 
Honestly would be pretty easy to modify the one you have now. Though honestly you'd be way better off leaving haste management to Gearinfo than toggling yourself. This is because if your haste falls off and the WHM gives you haste 1 and you don't notice and you think it's haste 2 it'll mess things up, and you're not 100% sure what everyones BRD gear looks like for marches I'm sure. Small things like that make it more annoying. Modifying yours would be the least effort way to make this happen so go ahead and post it and I'll see what I can do for ya.
Offline
Posts: 15
By Fatigue 2020-06-10 08:18:08
Link | Citer | R
 
Thank you very much. I don't know how to effectively give it to you, so I uploaded it into a Google Docs.

https://docs.google.com/document/d/1eJq4UUxRQo2Ei1408wVgVNR9S4-VIjMPQPgx6ZIK_e8/edit?usp=sharing

I tried using GearInfo, but the inability to like swap to an endorsement ring without unloading it is really annoying. Also, the ability to not use //gs disable I find obnoxious. I generally only play in small groups with friends, I'm not a fan of "Optimal party" setups for content, so I feel I'd be able to manage swapping haste levels. If you feel its better to leave that on, then thats fine, is there a way to have better control over it? It took me a bit of research just to figure out how to install it.

Unfortunately, right now I don't have the gear options to take advantage of different haste levels anyway, so its just the same items copy and pasted into different haste and acc levels for later use.

Ideally I was hoping to make it so Num1 would change between Norm, Acc and DT. Num2 would change between haste levels and whatever you feel is important for progressive num keys.

I don't really use the step function built into the lua, I just macro the steps.
 Bahamut.Kageniai
Offline
Serveur: Bahamut
Game: FFXI
user: Godssin
Posts: 20
By Bahamut.Kageniai 2020-06-10 08:21:24
Link | Citer | R
 
Wait you don't use the number pad to move? I'll have a look here and see what I can do for ya lol gimmi a bit.
Offline
Posts: 15
By Fatigue 2020-06-10 08:43:07
Link | Citer | R
 
No, I play with a controller. No Rush at all, I appreciate the help!
 Bahamut.Kageniai
Offline
Serveur: Bahamut
Game: FFXI
user: Godssin
Posts: 20
By Bahamut.Kageniai 2020-06-10 08:46:05
Link | Citer | R
 
I've found a workaround for gearinfo. Do you still want it out or are you fine with it?
 Bahamut.Kageniai
Offline
Serveur: Bahamut
Game: FFXI
user: Godssin
Posts: 20
By Bahamut.Kageniai 2020-06-10 08:56:10
Link | Citer | R
 
Err so looking thru this. All I'd really need to do is change some sets and keybinds.

I added Endorsement Ring to this list so it locks your gear too.
Code
function check_gear()
    if no_swap_gear:contains(player.equipment.left_ring) then
        disable("ring1")
    else
        enable("ring1")
    end
    if no_swap_gear:contains(player.equipment.right_ring) then
        disable("ring2")
    else
        enable("ring2")
    end
end
Code
no_swap_gear = S{"Warp Ring", "Dim. Ring (Dem)", "Dim. Ring (Holla)", "Dim. Ring (Mea)",
              "Trizek Ring", "Echad Ring", "Facility Ring", "Capacity Ring","Endorsement Ring"}


Here's the climactic code. So it'll equip climactic set instead of WS set when clim is up. I can change that to equip WS+Climactic because that makes a ton more sense tho.
Code
function job_post_precast(spell, action, spellMap, eventArgs)
    if spell.type == "WeaponSkill" then
        if state.Buff['Sneak Attack'] == true then
            equip(sets.precast.WS.Critical)
        end
        if state.Buff['Climactic Flourish'] then
            equip(sets.buff['Climactic Flourish'])
        end
    end
end
Code
sets.buff['Climactic Flourish'] = {head="Maculele Tiara +1"}



It seems everything you want is already here you just weren't sure what little things to change for your particular use or how to use them.
 Bahamut.Kageniai
Offline
Serveur: Bahamut
Game: FFXI
user: Godssin
Posts: 20
By Bahamut.Kageniai 2020-06-10 09:09:09
Link | Citer | R
 
My only worry is when you get to higher end content without proper haste you're gonna be super gimped so I'm gonna make the decision to keep it in. If you wanna remove it go ahead but I wont. I will make it a 3 mode toggle tho since that's definitely what you want. It would be a ton of effort to make that one button also switch you to DT when outside of combat as well though. Your idle outside of a mage job should be DT and regen anyways so that shouldn't matter too much anyways.
Offline
Posts: 15
By Fatigue 2020-06-10 09:31:57
Link | Citer | R
 
Sorry for the late response! Was trying ambuscade, thank you!

Does it matter where I copy and paste the climatic set at?

And okay, the endorsement ring was the big annoyance I kept running into, but now I see where to add exceptions so thats awesome, ty. I can keep the haste thing.

I'm not too worried about swapping to DT outside of combat, my idle set is mostly DT gear anyway, minus the boots which are speed boost which will probably get me killed, but oh well.
 Bahamut.Kageniai
Offline
Serveur: Bahamut
Game: FFXI
user: Godssin
Posts: 20
By Bahamut.Kageniai 2020-06-10 09:37:59
Link | Citer | R
 
Here, I made it more simple. Add Rudra's Storms climactic set to sets.precast.WS['Rudra\'s Storm'].Clim = {} which is on line 593. The rest should be good to go out of the box since I didn't change any sets, just reduced the amount and added your 1 button toggle. num1 should change sets for ya. I removed some keybinds you said you didn't use as well.
Code
-- Original: Motenten / Modified: Arislan
-- Haste/DW Detection Requires Gearinfo Addon


-------------------------------------------------------------------------------------------------------------------
--  Keybinds
-------------------------------------------------------------------------------------------------------------------


--  Modes:      [ F9 ]              Cycle Offense Modes
--              [ CTRL+F9 ]         Cycle Hybrid Modes
--              [ WIN+F9 ]          Cycle Weapon Skill Modes
--              [ F10 ]             Emergency -PDT Mode
--              [ ALT+F10 ]         Toggle Kiting Mode
--              [ F11 ]             Emergency -MDT Mode
--              [ F12 ]             Update Current Gear / Report Current Status
--              [ CTRL+F12 ]        Cycle Idle Modes
--              [ ALT+F12 ]         Cancel Emergency -PDT/-MDT Mode
--              [ WIN+F ]           Toggle Closed Position (Facing) Mode
--              [ WIN+C ]           Toggle Capacity Points Mode
--
--  Abilities:  [ CTRL+- ]          Primary step element cycle forward.
--              [ CTRL+= ]          Primary step element cycle backward.
--              [ ALT+- ]           Secondary step element cycle forward.
--              [ ALT+= ]           Secondary step element cycle backward.
--              [ CTRL+[ ]          Toggle step target type.
--              [ CTRL+] ]          Toggle use secondary step.
--              [ Numpad0 ]         Perform Current Step
--
--              [ CTRL+` ]          Saber Dance
--              [ ALT+` ]           Chocobo Jig II
--              [ ALT+[ ]           Contradance
--              [ CTRL+Numlock ]    Reverse Flourish
--              [ CTRL+Numpad/ ]    Berserk/Meditate
--              [ CTRL+Numpad* ]    Warcry/Sekkanoki
--              [ CTRL+Numpad- ]    Aggressor/Third Eye
--              [ CTRL+Numpad+ ]    Climactic Flourish
--              [ CTRL+NumpadEnter ]Building Flourish
--              [ CTRL+Numpad0 ]    Sneak Attack
--              [ CTRL+Numpad. ]    Trick Attack
--
--  Spells:     [ WIN+, ]           Utsusemi: Ichi
--              [ WIN+. ]           Utsusemi: Ni
--
--  WS:         [ CTRL+Numpad7 ]    Exenterator
--              [ CTRL+Numpad4 ]    Evisceration
--              [ CTRL+Numpad5 ]    Rudra's Storm
--              [ CTRL+Numpad6 ]    Pyrrhic Kleos
--              [ CTRL+Numpad1 ]    Aeolian Edge
--
--
--              (Global-Binds.lua contains additional non-job-related keybinds)




-------------------------------------------------------------------------------------------------------------------
--  Custom Commands (preface with /console to use these in macros)
-------------------------------------------------------------------------------------------------------------------


--  gs c step                       Uses the currently configured step on the target, with either <t> or
--                                  <stnpc> depending on setting.
--  gs c step t                     Uses the currently configured step on the target, but forces use of <t>.
--
--  gs c cycle mainstep             Cycles through the available steps to use as the primary step when using
--                                  one of the above commands.
--  gs c cycle altstep              Cycles through the available steps to use for alternating with the
--                                  configured main step.
--  gs c toggle usealtstep          Toggles whether or not to use an alternate step.
--  gs c toggle selectsteptarget    Toggles whether or not to use <stnpc> (as opposed to <t>) when using a step.




-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job.  Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------


-- Initialization function for this job file.
function get_sets()
    mote_include_version = 2


    -- Load and initialize the include file.
    include('Mote-Include.lua')
end




-- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
function job_setup()
    state.Buff['Climactic Flourish'] = buffactive['climactic flourish'] or false
    state.Buff['Sneak Attack'] = buffactive['sneak attack'] or false


    state.MainStep = M{['description']='Main Step', 'Box Step', 'Quickstep', 'Feather Step', 'Stutter Step'}
    state.AltStep = M{['description']='Alt Step', 'Quickstep', 'Feather Step', 'Stutter Step', 'Box Step'}
    state.UseAltStep = M(false, 'Use Alt Step')
    state.SelectStepTarget = M(false, 'Select Step Target')
    state.IgnoreTargetting = M(true, 'Ignore Targetting')


    state.ClosedPosition = M(false, 'Closed Position')


    state.CurrentStep = M{['description']='Current Step', 'Main', 'Alt'}
--  state.SkillchainPending = M(false, 'Skillchain Pending')


    state.CP = M(false, "Capacity Points Mode")


    no_swap_gear = S{"Warp Ring", "Dim. Ring (Dem)", "Dim. Ring (Holla)", "Dim. Ring (Mea)",
              "Trizek Ring", "Echad Ring", "Facility Ring", "Capacity Ring","Endorsement Ring"}


    lockstyleset = 20
end


-------------------------------------------------------------------------------------------------------------------
-- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
-------------------------------------------------------------------------------------------------------------------


-- Setup vars that are user-dependent.  Can override this function in a sidecar file.
function user_setup()
    state.OffenseMode:options('Normal', 'ACC', 'DT')
    state.HybridMode:options('Normal', 'DT')
    state.WeaponskillMode:options('Normal', 'Acc')
    state.IdleMode:options('Normal', 'DT')


    -- Additional local binds




    send_command('lua l gearinfo')
	send_command('bind num1 gs c cycle OffenseMode')


    send_command('bind @c gs c toggle CP')


    if player.sub_job == 'WAR' then
        send_command('bind ^numpad/ input /ja "Berserk" <me>')
        send_command('bind ^numpad* input /ja "Warcry" <me>')
        send_command('bind ^numpad- input /ja "Aggressor" <me>')
    elseif player.sub_job == 'SAM' then
        send_command('bind ^numpad/ input /ja "Meditate" <me>')
        send_command('bind ^numpad* input /ja "Sekkanoki" <me>')
        send_command('bind ^numpad- input /ja "Third Eye" <me>')
    elseif player.sub_job == 'THF' then
        send_command('bind ^numpad0 input /ja "Sneak Attack" <me>')
        send_command('bind ^numpad. input /ja "Trick Attack" <me>')
    end


    send_command('bind numpad0 gs c step t')


    select_default_macro_book()
    set_lockstyle()


    state.Auto_Kite = M(false, 'Auto_Kite')
    Haste = 0
    DW_needed = 0
    DW = false
    moving = false
    update_combat_form()
    determine_haste_group()
end




-- Called when this job file is unloaded (eg: job change)
function user_unload()
    send_command('unbind ^-')
    send_command('unbind ^=')
    send_command('unbind !-')
    send_command('unbind !=')
    send_command('unbind ^]')
    send_command('unbind ^[')
    send_command('unbind ^]')
    send_command('unbind ![')
    send_command('unbind ^`')
    send_command('unbind !`')
    send_command('unbind ^,')
    send_command('unbind @f')
    send_command('unbind @c')
    send_command('unbind ^numlock')
    send_command('unbind ^numpad/')
    send_command('unbind ^numpad*')
    send_command('unbind ^numpad-')
    send_command('unbind ^numpad+')
    send_command('unbind ^numpadenter')
    send_command('unbind ^numpad7')
    send_command('unbind ^numpad4')
    send_command('unbind ^numpad5')
    send_command('unbind ^numpad6')
    send_command('unbind ^numpad1')
    send_command('unbind numpad0')
    send_command('unbind ^numpad0')
    send_command('unbind ^numpad.')


    send_command('unbind #`')
    send_command('unbind #1')
    send_command('unbind #2')
    send_command('unbind #3')
    send_command('unbind #4')
    send_command('unbind #5')
    send_command('unbind #6')
    send_command('unbind #7')
    send_command('unbind #8')
    send_command('unbind #9')
    send_command('unbind #0')


    send_command('lua u gearinfo')
end




-- Define sets and vars used by this job file.
function init_gear_sets()


    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Precast Sets ------------------------------------------
    ------------------------------------------------------------------------------------------------


    -- Enmity set
    sets.Enmity = {
        ammo="Sapience Orb", --2
        head="Halitus Helm", --8
        body="Emet Harness +1", --10
        hands="Horos Bangles +3", --9
        feet="Ahosi Leggings", --7
        neck="Unmoving Collar +1", --10
        ear1="Cryptic Earring", --4
        ear2="Trux Earring", --5
        ring1="Supershear Ring", --5
        ring2="Eihwaz Ring", --5
        back=gear.DNC_WTZ_Cape, --10
        waist="Kasiri Belt", --3
        }


    sets.precast.JA['Provoke'] = sets.Enmity
    sets.precast.JA['No Foot Rise'] = {body="Horos Casaque +3"}
    sets.precast.JA['Trance'] = {head="Horos Tiara +3"}


    sets.precast.Waltz = {


    ammo="Ginsen",
    head="Maxixi Tiara +1",
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands="Maxixi Bangles +2",
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet="Maxixi Shoes +1",
    neck="Etoile Gorget",
    waist="Aristo Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Carb. Ring",
    right_ring="Carb. Ring",
    back={ name="Toetapper Mantle", augments={'"Store TP"+4','"Dual Wield"+1','"Rev. Flourish"+26',}},


        } -- Waltz Potency/CHR


    sets.precast.WaltzSelf = set_combine(sets.precast.Waltz, {
        head="Mummu Bonnet +2", --(8)
        ring1="Asklepian Ring", --(3)
        ear1="Roundel Earring", --5
        }) -- Waltz effects received


    sets.precast.Waltz['Healing Waltz'] = {}
    sets.precast.Samba = {head="Maxixi Tiara +1", back=gear.DNC_TP_Cape}
    sets.precast.Jig = {legs="Horos Tights +3", feet="Maxixi Toeshoes +1"}


    sets.precast.Step = {


    ammo="Ginsen",
    head="Malignance Chapeau",
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands="Maxixi Bangles +2",
    legs="Malignance Tights",
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Etoile Gorget",
    waist="Grunfeld Rope",
    left_ear="Assuage Earring",
    right_ear="Digni. Earring",
    left_ring="Varar Ring +1",
    right_ring="Varar Ring +1",
    back={ name="Toetapper Mantle", augments={'"Store TP"+4','"Dual Wield"+1','"Rev. Flourish"+26',}},


        }


    sets.precast.Step['Feather Step'] = set_combine(sets.precast.Step, {feet="Macu. Toeshoes +1"})
    sets.precast.Flourish1 = {}
    sets.precast.Flourish1['Animated Flourish'] = sets.Enmity


    sets.precast.Flourish1['Violent Flourish'] = {
        ammo="Hydrocera",
        head="Mummu Bonnet +2",
        body="Horos Casaque +3",
        hands="Mummu Wrists +2",
        legs="Mummu Kecks +2",
        feet="Mummu Gamash. +2",
        neck="Etoile Gorget +1",
        ear1="Digni. Earring",
        ear2="Enchntr. Earring +1",
        ring1="Metamor. Ring +1",
        ring2="Weather. Ring +1",
        waist="Eschan Stone",
        back=gear.DNC_TP_Cape,
        } -- Magic Accuracy


    sets.precast.Flourish1['Desperate Flourish'] = {
        ammo="C. Palug Stone",
        head="Maxixi Tiara +3",
        body="Maxixi Casaque +3",
        hands="Maxixi Bangles +3",
        legs=gear.Herc_WS_legs,
        feet="Maxixi Toeshoes +3",
        neck="Etoile Gorget +1",
        ear1="Cessance Earring",
        ear2="Telos Earring",
        ring1="Regal Ring",
        ring2={name="Chirich Ring +1", bag="wardrobe4"},
        back=gear.DNC_TP_Cape,
        } -- Accuracy


    sets.precast.Flourish2 = {}
    sets.precast.Flourish2['Reverse Flourish'] = {hands="Macu. Bangles +1",    back={ name="Toetapper Mantle", augments={'"Store TP"+4','"Dual Wield"+1','"Rev. Flourish"+26',}},}
    sets.precast.Flourish3 = {}
    sets.precast.Flourish3['Striking Flourish'] = {body="Macu. Casaque +1"}
    sets.precast.Flourish3['Climactic Flourish'] = {head="Maculele Tiara +1",}


    sets.precast.FC = {
        ammo="Sapience Orb",
        head=gear.Herc_MAB_head, --7
        body=gear.Taeon_FC_body, --8
        hands="Leyline Gloves", --8
        legs="Rawhide Trousers", --5
        feet=gear.Herc_MAB_feet, --2
        neck="Orunmila's Torque", --5
        ear1="Loquacious Earring", --2
        ear2="Enchntr. Earring +1", --2
        ring2="Weather. Ring +1", --6(4)
        }


    sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {
        ammo="Impatiens",
        body="Passion Jacket",
        ring1="Lebeche Ring",
        })




    ------------------------------------------------------------------------------------------------
    ------------------------------------- Weapon Skill Sets ----------------------------------------
    ------------------------------------------------------------------------------------------------


    sets.precast.WS = {


    ammo="Charis Feather",
    head={ name="Herculean Helm", augments={'Attack+22','Weapon skill damage +5%','STR+5','Accuracy+11',}},
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands="Maxixi Bangles +2",
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Herculean Boots", augments={'Attack+29','Weapon skill damage +4%','STR+6','Accuracy+13',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Petrov Ring",
    right_ring="Apate Ring",
    back="Bleating Mantle",


        } -- default set


    sets.precast.WS.Acc = set_combine(sets.precast.WS, {
   
    ammo="Charis Feather",
    head={ name="Herculean Helm", augments={'Attack+22','Weapon skill damage +5%','STR+5','Accuracy+11',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands="Maxixi Bangles +2",
    legs="Horos Tights +3",
    feet={ name="Lustra. Leggings +1", augments={'Attack+20','STR+8','"Dbl.Atk."+3',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Ishvara Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Petrov Ring",
    right_ring="Apate Ring",
    back={ name="Toetapper Mantle", augments={'"Store TP"+4','"Dual Wield"+1','"Rev. Flourish"+26',}},


        })


    sets.precast.WS.Critical = {body="Meg. Cuirie +2"}


    sets.precast.WS['Exenterator'] = set_combine(sets.precast.WS, {
   
     ammo="Charis Feather",
    head={ name="Herculean Helm", augments={'Attack+22','Weapon skill damage +5%','STR+5','Accuracy+11',}},
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands="Maxixi Bangles +2",
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Herculean Boots", augments={'Attack+29','Weapon skill damage +4%','STR+6','Accuracy+13',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Apate Ring",
    right_ring="Begrudging Ring",
    back="Bleating Mantle",


        })


    sets.precast.WS['Exenterator'].Acc = set_combine(sets.precast.WS['Exenterator'], {
  
    ammo="Charis Feather",
    head={ name="Herculean Helm", augments={'Attack+22','Weapon skill damage +5%','STR+5','Accuracy+11',}},
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands="Maxixi Bangles +2",
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Herculean Boots", augments={'Attack+29','Weapon skill damage +4%','STR+6','Accuracy+13',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Apate Ring",
    right_ring="Begrudging Ring",
    back="Bleating Mantle",


        })


    sets.precast.WS['Pyrrhic Kleos'] = set_combine(sets.precast.WS, {
  
    ammo="Charis Feather",
    head={ name="Lustratio Cap +1", augments={'Attack+20','STR+8','"Dbl.Atk."+3',}},
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Lustra. Leggings +1", augments={'Attack+20','STR+8','"Dbl.Atk."+3',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",


        })


    sets.precast.WS['Pyrrhic Kleos'].Acc = set_combine(sets.precast.WS['Pyrrhic Kleos'], {
   
    ammo="Charis Feather",
    head={ name="Lustratio Cap +1", augments={'Attack+20','STR+8','"Dbl.Atk."+3',}},
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Lustra. Leggings +1", augments={'Attack+20','STR+8','"Dbl.Atk."+3',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",


        })


    sets.precast.WS['Evisceration'] = set_combine(sets.precast.WS, {
    
     ammo="Charis Feather",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands="Maxixi Bangles +2",
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Herculean Boots", augments={'Attack+29','Weapon skill damage +4%','STR+6','Accuracy+13',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Apate Ring",
    right_ring="Begrudging Ring",
    back="Bleating Mantle",


        })


    sets.precast.WS['Evisceration'].Acc = set_combine(sets.precast.WS['Evisceration'], {
    
     ammo="Charis Feather",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands="Maxixi Bangles +2",
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Herculean Boots", augments={'Attack+29','Weapon skill damage +4%','STR+6','Accuracy+13',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Apate Ring",
    right_ring="Begrudging Ring",
    back="Bleating Mantle",


        })


    sets.precast.WS['Rudra\'s Storm'] = set_combine(sets.precast.WS, {
    
    ammo="Charis Feather",
    head="Maculele Tiara +1",
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands="Maxixi Bangles +2",
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Herculean Boots", augments={'Attack+29','Weapon skill damage +4%','STR+6','Accuracy+13',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Petrov Ring",
    right_ring="Apate Ring",
    back="Bleating Mantle",


        })


    sets.precast.WS['Rudra\'s Storm'].Acc = set_combine(sets.precast.WS['Rudra\'s Storm'], {
    
    ammo="Charis Feather",
    head={ name="Herculean Helm", augments={'Attack+22','Weapon skill damage +5%','STR+5','Accuracy+11',}},
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands="Maxixi Bangles +2",
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Herculean Boots", augments={'Attack+29','Weapon skill damage +4%','STR+6','Accuracy+13',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Petrov Ring",
    right_ring="Apate Ring",
    back="Bleating Mantle",


        })
		
	sets.precast.WS['Rudra\'s Storm'].Clim = {}


    sets.precast.WS['Aeolian Edge'] = {
   
    ammo="Pemphredo Tathlum",
    head="Malignance Chapeau",
    body={ name="Samnuha Coat", augments={'Mag. Acc.+13','"Mag.Atk.Bns."+14','"Fast Cast"+3','"Dual Wield"+4',}},
    hands="Maxixi Bangles +2",
    legs="Horos Tights +3",
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Fotia Gorget",
    waist="Eschan Stone",
    left_ear="Ishvara Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Petrov Ring",
    right_ring="Apate Ring",
    back={ name="Toetapper Mantle", augments={'"Store TP"+4','"Dual Wield"+1','"Rev. Flourish"+26',}},


        }


    sets.precast.Skillchain = {
        hands="Macu. Bangles +1",
        }


    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Midcast Sets ------------------------------------------
    ------------------------------------------------------------------------------------------------


    sets.midcast.FastRecast = sets.precast.FC


    sets.midcast.SpellInterrupt = {
        ammo="Impatiens", --10
        ring1="Evanescence Ring", --5
        }


    sets.midcast.Utsusemi = sets.midcast.SpellInterrupt


    ------------------------------------------------------------------------------------------------
    ----------------------------------------- Idle Sets --------------------------------------------
    ------------------------------------------------------------------------------------------------


    sets.resting = {}


    sets.idle = {
   
    ammo="Ginsen",
    head="Malignance Chapeau",
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs="Malignance Tights",
    feet="Tandava Crackows",
    neck="Etoile Gorget",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Archon Ring",
    right_ring="Vocane Ring",
    back="Bleating Mantle",


        }


    sets.idle.DT = set_combine(sets.idle, {
  
    ammo="Ginsen",
    head="Malignance Chapeau",
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands="Maxixi Bangles +2",
    legs="Malignance Tights",
    feet="Tandava Crackows",
    neck="Dampener's Torque",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Archon Ring",
    right_ring="Vocane Ring",
    back="Archon Cape",


        })


    sets.idle.Town = set_combine(sets.idle, {
   
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet="Tandava Crackows",
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",


        })


    sets.idle.Weak = sets.idle.DT


    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Defense Sets ------------------------------------------
    ------------------------------------------------------------------------------------------------


    sets.defense.PDT = sets.idle.DT
    sets.defense.MDT = sets.idle.DT


    sets.Kiting = {feet="Skd. Jambeaux +1"}


    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Engaged Sets ------------------------------------------
    ------------------------------------------------------------------------------------------------


    -- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
    -- sets if more refined versions aren't defined.
    -- If you create a set with both offense and defense modes, the offense mode should be first.
    -- EG: sets.engaged.Dagger.Accuracy.Evasion


    sets.engaged = {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        }


    sets.engaged.LowAcc = {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        }


    -- * DNC Native DW Trait: 30% DW
    -- * DNC Job Points DW Gift: 5% DW


    -- No Magic Haste (74% DW to cap)
    sets.engaged.DW = {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        } -- 41%


    sets.engaged.DW.ACC = set_combine(sets.engaged.DW, {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        })


    -- 15% Magic Haste (67% DW to cap)
    sets.engaged.DW.LowHaste = {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        } -- 32%


    sets.engaged.DW.ACC.LowHaste = set_combine(sets.engaged.DW.LowHaste, {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        })


    -- 30% Magic Haste (56% DW to cap)
    sets.engaged.DW.MidHaste = {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        } -- 22%


    sets.engaged.DW.ACC.MidHaste = set_combine(sets.engaged.DW.MidHaste, {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        })


    -- 35% Magic Haste (51% DW to cap)
    sets.engaged.DW.HighHaste = {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
      } -- 10% Gear


    sets.engaged.DW.ACC.HighHaste = set_combine(sets.engaged.DW.HighHaste, {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        })


    -- 45% Magic Haste (36% DW to cap)
    sets.engaged.DW.MaxHaste = {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        } -- 0%


    sets.engaged.DW.ACC.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        })


    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Hybrid Sets -------------------------------------------
    ------------------------------------------------------------------------------------------------


    sets.engaged.DT = {
        head=gear.Adhemar_D_head, --4/0
        body="Ashera Harness", --7/7
        neck="Loricate Torque +1", --6/6
        ring1="Moonlight Ring", --5/5
        ring2="Defending Ring", --10/10
        }


    sets.engaged.DW.DT = sets.engaged.DT


    sets.engaged.DW.DT.LowHaste = sets.engaged.DT


    sets.engaged.DW.DT.MidHaste = sets.engaged.DT


    sets.engaged.DW.DT.HighHaste = sets.engaged.DT


    sets.engaged.DW.DT.MaxHaste = sets.engaged.DT




    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Special Sets ------------------------------------------
    ------------------------------------------------------------------------------------------------


    sets.buff['Saber Dance'] = {legs="Horos Tights +3"}
    sets.buff['Fan Dance'] = {body="Horos Bangles +3"}
    sets.buff['Climactic Flourish'] = {head="Maculele Tiara +1"} --body="Meg. Cuirie +2"}
    sets.buff['Closed Position'] = {feet="Horos T. Shoes +3"}


    sets.buff.Doom = {
        neck="Nicander's Necklace", --20
        ring1={name="Eshmun's Ring", bag="wardrobe3"}, --20
        ring2={name="Eshmun's Ring", bag="wardrobe4"}, --20
        waist="Gishdubar Sash", --10
        }


    sets.CP = {back="Mecisto. Mantle"}
    --sets.Reive = {neck="Ygnas's Resolve +1"}


end




-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------


-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
-- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
function job_precast(spell, action, spellMap, eventArgs)
    --auto_presto(spell)
    if spellMap == 'Utsusemi' then
        if buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)'] then
            cancel_spell()
            add_to_chat(123, '**!! '..spell.english..' Canceled: [3+ IMAGES] !!**')
            eventArgs.handled = true
            return
        elseif buffactive['Copy Image'] or buffactive['Copy Image (2)'] then
            send_command('cancel 66; cancel 444; cancel Copy Image; cancel Copy Image (2)')
        end
    end
end


function job_post_precast(spell, action, spellMap, eventArgs)
	if buffactive['Climactic Flourish'] and spell.english:contains("Rudra's Storm") then
		equip(sets.precast.WS["Rudra's Storm"].Clim)
	elseif spell.english:contains("Rudra's Storm") then
		equip(sets.precast.WS["Rudra's Storm"])
	end
    if spell.type=='Waltz' and spell.english:startswith('Curing') and spell.target.type == 'SELF' then
        equip(sets.precast.WaltzSelf)
    end
end


-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
function job_aftercast(spell, action, spellMap, eventArgs)
    -- Weaponskills wipe SATA.  Turn those state vars off before default gearing is attempted.
    if spell.type == 'WeaponSkill' and not spell.interrupted then
        state.Buff['Sneak Attack'] = false
    end
end


-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------


-- Called when a player gains or loses a buff.
-- buff == buff gained or lost
-- gain == true if the buff was gained, false if it was lost.
function job_buff_change(buff,gain)
    if buff == 'Saber Dance' or buff == 'Climactic Flourish' or buff == 'Fan Dance' then
        handle_equipping_gear(player.status)
    end


--    if buffactive['Reive Mark'] then
--        if gain then
--            equip(sets.Reive)
--            disable('neck')
--        else
--            enable('neck')
--        end
--    end


    if buff == "doom" then
        if gain then
            equip(sets.buff.Doom)
            send_command('@input /p Doomed.')
             disable('ring1','ring2','waist')
        else
            enable('ring1','ring2','waist')
            handle_equipping_gear(player.status)
        end
    end


end


-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------


-- Called by the 'update' self-command, for common needs.
-- Set eventArgs.handled to true if we don't want automatic equipping of gear.
function job_handle_equipping_gear(playerStatus, eventArgs)
    check_gear()
    update_combat_form()
    determine_haste_group()
    check_moving()
end


function job_update(cmdParams, eventArgs)
    handle_equipping_gear(player.status)
end


function update_combat_form()
    if DW == true then
        state.CombatForm:set('DW')
    elseif DW == false then
        state.CombatForm:reset()
    end
end


function get_custom_wsmode(spell, spellMap, defaut_wsmode)
    local wsmode


    if state.Buff['Sneak Attack'] then
        wsmode = 'SA'
    end


    return wsmode
end


function customize_idle_set(idleSet)
    if state.CP.current == 'on' then
        equip(sets.CP)
        disable('back')
    else
        enable('back')
    end
    if state.Auto_Kite.value == true then
       idleSet = set_combine(idleSet, sets.Kiting)
    end


    return idleSet
end


function customize_melee_set(meleeSet)
    --if state.Buff['Climactic Flourish'] then
    --    meleeSet = set_combine(meleeSet, sets.buff['Climactic Flourish'])
    --end
    if state.ClosedPosition.value == true then
        meleeSet = set_combine(meleeSet, sets.buff['Closed Position'])
    end


    return meleeSet
end


-- Handle auto-targetting based on local setup.
function job_auto_change_target(spell, action, spellMap, eventArgs)
    if spell.type == 'Step' then
        if state.IgnoreTargetting.value == true then
            state.IgnoreTargetting:reset()
            eventArgs.handled = true
        end


        eventArgs.SelectNPCTargets = state.SelectStepTarget.value
    end
end




-- Function to display the current relevant user state when doing an update.
-- Set eventArgs.handled to true if display was handled, and you don't want the default info shown.
function display_current_job_state(eventArgs)
    local cf_msg = ''
    if state.CombatForm.has_value then
        cf_msg = ' (' ..state.CombatForm.value.. ')'
    end


    local m_msg = state.OffenseMode.value
    if state.HybridMode.value ~= 'Normal' then
        m_msg = m_msg .. '/' ..state.HybridMode.value
    end


    local ws_msg = state.WeaponskillMode.value


    local s_msg = state.MainStep.current
    if state.UseAltStep.value == true then
        s_msg = s_msg .. '/'..state.AltStep.current
    end


    local d_msg = 'None'
    if state.DefenseMode.value ~= 'None' then
        d_msg = state.DefenseMode.value .. state[state.DefenseMode.value .. 'DefenseMode'].value
    end


    local i_msg = state.IdleMode.value


    local msg = ''
    if state.Kiting.value then
        msg = msg .. ' Kiting: On |'
    end


    add_to_chat(002, '| ' ..string.char(31,210).. 'Melee' ..cf_msg.. ': ' ..string.char(31,001)..m_msg.. string.char(31,002)..  ' |'
        ..string.char(31,207).. ' WS: ' ..string.char(31,001)..ws_msg.. string.char(31,002)..  ' |'
        ..string.char(31,060).. ' Step: '  ..string.char(31,001)..s_msg.. string.char(31,002)..  ' |'
        ..string.char(31,004).. ' Defense: ' ..string.char(31,001)..d_msg.. string.char(31,002)..  ' |'
        ..string.char(31,008).. ' Idle: ' ..string.char(31,001)..i_msg.. string.char(31,002)..  ' |'
        ..string.char(31,002)..msg)


    eventArgs.handled = true
end




-------------------------------------------------------------------------------------------------------------------
-- User self-commands.
-------------------------------------------------------------------------------------------------------------------


-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------


function determine_haste_group()
    classes.CustomMeleeGroups:clear()
    if DW == true then
        if DW_needed <= 1 then
            classes.CustomMeleeGroups:append('MaxHaste')
        elseif DW_needed > 1 and DW_needed <= 9 then
            classes.CustomMeleeGroups:append('HighHaste')
        elseif DW_needed > 9 and DW_needed <= 21 then
            classes.CustomMeleeGroups:append('MidHaste')
        elseif DW_needed > 21 and DW_needed <= 39 then
            classes.CustomMeleeGroups:append('LowHaste')
        elseif DW_needed > 39 then
            classes.CustomMeleeGroups:append('')
        end
    end
end


function job_self_command(cmdParams, eventArgs)
    if cmdParams[1] == 'step' then
        if cmdParams[2] == 't' then
            state.IgnoreTargetting:set()
        end


        local doStep = ''
        if state.UseAltStep.value == true then
            doStep = state[state.CurrentStep.current..'Step'].current
            state.CurrentStep:cycle()
        else
            doStep = state.MainStep.current
        end


        send_command('@input /ja "'..doStep..'" <t>')
    end


    gearinfo(cmdParams, eventArgs)
end


function gearinfo(cmdParams, eventArgs)
    if cmdParams[1] == 'gearinfo' then
        if type(tonumber(cmdParams[2])) == 'number' then
            if tonumber(cmdParams[2]) ~= DW_needed then
            DW_needed = tonumber(cmdParams[2])
            DW = true
            end
        elseif type(cmdParams[2]) == 'string' then
            if cmdParams[2] == 'false' then
                DW_needed = 0
                DW = false
            end
        end
        if type(tonumber(cmdParams[3])) == 'number' then
            if tonumber(cmdParams[3]) ~= Haste then
                Haste = tonumber(cmdParams[3])
            end
        end
        if type(cmdParams[4]) == 'string' then
            if cmdParams[4] == 'true' then
                moving = true
            elseif cmdParams[4] == 'false' then
                moving = false
            end
        end
        if not midaction() then
            job_update()
        end
    end
end




-- Automatically use Presto for steps when it's available and we have less than 3 finishing moves
function job_pretarget(spell, action, spellMap, eventArgs)
    if spell.type == 'Step' then
        local allRecasts = windower.ffxi.get_ability_recasts()
        local prestoCooldown = allRecasts[236]
        local under3FMs = not buffactive['Finishing Move 3'] and not buffactive['Finishing Move 4'] and not buffactive['Finishing Move 5']


        if player.main_job_level >= 77 and prestoCooldown < 1 and under3FMs then
            cast_delay(1.1)
            send_command('input /ja "Presto" <me>')
        end
    end
end


function check_moving()
    if state.DefenseMode.value == 'None'  and state.Kiting.value == false then
        if state.Auto_Kite.value == false and moving then
            state.Auto_Kite:set(true)
        elseif state.Auto_Kite.value == true and moving == false then
            state.Auto_Kite:set(false)
        end
    end
end


function check_gear()
    if no_swap_gear:contains(player.equipment.left_ring) then
        disable("ring1")
    else
        enable("ring1")
    end
    if no_swap_gear:contains(player.equipment.right_ring) then
        disable("ring2")
    else
        enable("ring2")
    end
end


windower.register_event('zone change',
    function()
        if no_swap_gear:contains(player.equipment.left_ring) then
            enable("ring1")
            equip(sets.idle)
        end
        if no_swap_gear:contains(player.equipment.right_ring) then
            enable("ring2")
            equip(sets.idle)
        end
    end
)


-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
    -- Default macro set/book: (set, book)
    if player.sub_job == 'WAR' then
        set_macro_page(1, 4)
    elseif player.sub_job == 'THF' then
        set_macro_page(1, 4)
    elseif player.sub_job == 'NIN' then
        set_macro_page(1, 4)
    elseif player.sub_job == 'RUN' then
        set_macro_page(1, 4)
    elseif player.sub_job == 'SAM' then
        set_macro_page(1, 4)
    else
        set_macro_page(1, 4)
    end
end


function set_lockstyle()
    send_command('wait 2; input /lockstyleset ' .. lockstyleset)
end
Offline
Posts: 15
By Fatigue 2020-06-10 09:40:39
Link | Citer | R
 
Oh my gosh, you're amazing. Thank you so much! Is there anything I can do for you in return?
 Bahamut.Kageniai
Offline
Serveur: Bahamut
Game: FFXI
user: Godssin
Posts: 20
By Bahamut.Kageniai 2020-06-10 09:43:03
Link | Citer | R
 
Don't worry about it I enjoy this. If something doesn't work lemme know.
Offline
Posts: 15
By Fatigue 2020-06-10 10:33:34
Link | Citer | R
 
Bahamut.Kageniai said: »
Here, I made it more simple. Add Rudra's Storms climactic set to sets.precast.WS['Rudra\'s Storm'].Clim = {} which is on line 593. The rest should be good to go out of the box since I didn't change any sets, just reduced the amount and added your 1 button toggle. num1 should change sets for ya. I removed some keybinds you said you didn't use as well.

Hm, 1 isn't actually doing anything, but F9 does cycle through them, which I can work with. I thought maybe it was the GLobal-Binds and Geo-Binds but I deleted those and still the same.

Also, I'm not sure where the actual DT and Acc sets are in the lua to change.

Edit: I found the DT set, thank you, the acc one Im not too sure on.

Also, I'm terribly sorry there was one other function that was in there that isn't anymore. The Toggle: Closed Position button,which swaps my horos boots (+21 stp when attacking face) with Herc boots +6 TA. Is there a way to bind that to to windows V instead?
 Bahamut.Kageniai
Offline
Serveur: Bahamut
Game: FFXI
user: Godssin
Posts: 20
By Bahamut.Kageniai 2020-06-10 14:34:27
Link | Citer | R
 
The actual bind is part of motes globals. I tried adding a different bind but I may have messed it up. I'll look at it more when I wake up in a few hours. I can do the closed position swap bind for you as well then. But I'm gonna finish sleeping first.
 Bahamut.Kageniai
Offline
Serveur: Bahamut
Game: FFXI
user: Godssin
Posts: 20
By Bahamut.Kageniai 2020-06-10 14:35:56
Link | Citer | R
 
Also any sets.engaged.DW.ACC set is an accuracy set.
 Bahamut.Kageniai
Offline
Serveur: Bahamut
Game: FFXI
user: Godssin
Posts: 20
By Bahamut.Kageniai 2020-06-11 04:18:24
Link | Citer | R
 
Closed Position toggle is now back in. Lines 760, 789, 824, 859, 894, 929 are all ACC sets. DT is 951.
Code
-- Original: Motenten / Modified: Arislan / Modified: Kageniai
-- Haste/DW Detection Requires Gearinfo Addon
 
 
-------------------------------------------------------------------------------------------------------------------
--  Keybinds
-------------------------------------------------------------------------------------------------------------------
 
 
--  Modes:      [ F9 ]              Cycle Offense Modes
--              [ CTRL+F9 ]         Cycle Hybrid Modes
--              [ WIN+F9 ]          Cycle Weapon Skill Modes
--              [ F10 ]             Emergency -PDT Mode
--              [ ALT+F10 ]         Toggle Kiting Mode
--              [ F11 ]             Emergency -MDT Mode
--              [ F12 ]             Update Current Gear / Report Current Status
--              [ CTRL+F12 ]        Cycle Idle Modes
--              [ ALT+F12 ]         Cancel Emergency -PDT/-MDT Mode
--              [ WIN+F ]           Toggle Closed Position (Facing) Mode
--              [ WIN+C ]           Toggle Capacity Points Mode
--
--  Abilities:  [ CTRL+- ]          Primary step element cycle forward.
--              [ CTRL+= ]          Primary step element cycle backward.
--              [ ALT+- ]           Secondary step element cycle forward.
--              [ ALT+= ]           Secondary step element cycle backward.
--              [ CTRL+[ ]          Toggle step target type.
--              [ CTRL+] ]          Toggle use secondary step.
--              [ Numpad0 ]         Perform Current Step
--
--              [ CTRL+` ]          Saber Dance
--              [ ALT+` ]           Chocobo Jig II
--              [ ALT+[ ]           Contradance
--              [ CTRL+Numlock ]    Reverse Flourish
--              [ CTRL+Numpad/ ]    Berserk/Meditate
--              [ CTRL+Numpad* ]    Warcry/Sekkanoki
--              [ CTRL+Numpad- ]    Aggressor/Third Eye
--              [ CTRL+Numpad+ ]    Climactic Flourish
--              [ CTRL+NumpadEnter ]Building Flourish
--              [ CTRL+Numpad0 ]    Sneak Attack
--              [ CTRL+Numpad. ]    Trick Attack
--
--  Spells:     [ WIN+, ]           Utsusemi: Ichi
--              [ WIN+. ]           Utsusemi: Ni
--
--  WS:         [ CTRL+Numpad7 ]    Exenterator
--              [ CTRL+Numpad4 ]    Evisceration
--              [ CTRL+Numpad5 ]    Rudra's Storm
--              [ CTRL+Numpad6 ]    Pyrrhic Kleos
--              [ CTRL+Numpad1 ]    Aeolian Edge
--
--
--              (Global-Binds.lua contains additional non-job-related keybinds)
 
 
 
 
-------------------------------------------------------------------------------------------------------------------
--  Custom Commands (preface with /console to use these in macros)
-------------------------------------------------------------------------------------------------------------------
 
 
--  gs c step                       Uses the currently configured step on the target, with either <t> or
--                                  <stnpc> depending on setting.
--  gs c step t                     Uses the currently configured step on the target, but forces use of <t>.
--
--  gs c cycle mainstep             Cycles through the available steps to use as the primary step when using
--                                  one of the above commands.
--  gs c cycle altstep              Cycles through the available steps to use for alternating with the
--                                  configured main step.
--  gs c toggle usealtstep          Toggles whether or not to use an alternate step.
--  gs c toggle selectsteptarget    Toggles whether or not to use <stnpc> (as opposed to <t>) when using a step.
 
 
 
 
-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job.  Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
 
 
-- Initialization function for this job file.
function get_sets()
    mote_include_version = 2
 
 
    -- Load and initialize the include file.
    include('Mote-Include.lua')
end
 
 
 
 
-- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
function job_setup()
    state.Buff['Climactic Flourish'] = buffactive['climactic flourish'] or false
    state.Buff['Sneak Attack'] = buffactive['sneak attack'] or false
 
 
    state.MainStep = M{['description']='Main Step', 'Box Step', 'Quickstep', 'Feather Step', 'Stutter Step'}
    state.AltStep = M{['description']='Alt Step', 'Quickstep', 'Feather Step', 'Stutter Step', 'Box Step'}
    state.UseAltStep = M(false, 'Use Alt Step')
    state.SelectStepTarget = M(false, 'Select Step Target')
    state.IgnoreTargetting = M(true, 'Ignore Targetting')
 
 
    state.ClosedPosition = M(false, 'Closed Position')
 
 
    state.CurrentStep = M{['description']='Current Step', 'Main', 'Alt'}
--  state.SkillchainPending = M(false, 'Skillchain Pending')
 
 
    state.CP = M(false, "Capacity Points Mode")
 
 
    no_swap_gear = S{"Warp Ring", "Dim. Ring (Dem)", "Dim. Ring (Holla)", "Dim. Ring (Mea)",
              "Trizek Ring", "Echad Ring", "Facility Ring", "Capacity Ring","Endorsement Ring"}
 
 
    lockstyleset = 20
end
 
 
-------------------------------------------------------------------------------------------------------------------
-- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
-------------------------------------------------------------------------------------------------------------------
 
 
-- Setup vars that are user-dependent.  Can override this function in a sidecar file.
function user_setup()
    state.OffenseMode:options('Normal', 'ACC', 'DT')
    state.HybridMode:options('Normal', 'DT')
    state.WeaponskillMode:options('Normal', 'Acc')
    state.IdleMode:options('Normal', 'DT')
 
 
    -- Additional local binds
 
 
 
 
    send_command('lua l gearinfo')
    send_command('bind numpad1 gs c cycle OffenseMode')
	    send_command('bind @v gs c toggle ClosedPosition')
 
 
    send_command('bind @c gs c toggle CP')
 
 
    if player.sub_job == 'WAR' then
        send_command('bind ^numpad/ input /ja "Berserk" <me>')
        send_command('bind ^numpad* input /ja "Warcry" <me>')
        send_command('bind ^numpad- input /ja "Aggressor" <me>')
    elseif player.sub_job == 'SAM' then
        send_command('bind ^numpad/ input /ja "Meditate" <me>')
        send_command('bind ^numpad* input /ja "Sekkanoki" <me>')
        send_command('bind ^numpad- input /ja "Third Eye" <me>')
    elseif player.sub_job == 'THF' then
        send_command('bind ^numpad0 input /ja "Sneak Attack" <me>')
        send_command('bind ^numpad. input /ja "Trick Attack" <me>')
    end
 
 
    send_command('bind numpad0 gs c step t')
 
 
    select_default_macro_book()
    set_lockstyle()
 
 
    state.Auto_Kite = M(false, 'Auto_Kite')
    Haste = 0
    DW_needed = 0
    DW = false
    moving = false
    update_combat_form()
    determine_haste_group()
end
 
 
 
 
-- Called when this job file is unloaded (eg: job change)
function user_unload()
    send_command('unbind ^-')
    send_command('unbind ^=')
    send_command('unbind !-')
    send_command('unbind !=')
    send_command('unbind ^]')
    send_command('unbind ^[')
    send_command('unbind ^]')
    send_command('unbind ![')
    send_command('unbind ^`')
    send_command('unbind !`')
    send_command('unbind ^,')
    send_command('unbind @f')
    send_command('unbind @c')
    send_command('unbind ^numlock')
    send_command('unbind ^numpad/')
    send_command('unbind ^numpad*')
    send_command('unbind ^numpad-')
    send_command('unbind ^numpad+')
    send_command('unbind ^numpadenter')
    send_command('unbind ^numpad7')
    send_command('unbind ^numpad4')
    send_command('unbind ^numpad5')
    send_command('unbind ^numpad6')
    send_command('unbind ^numpad1')
    send_command('unbind numpad0')
    send_command('unbind ^numpad0')
    send_command('unbind ^numpad.')
 
 
    send_command('unbind #`')
    send_command('unbind #1')
    send_command('unbind #2')
    send_command('unbind #3')
    send_command('unbind #4')
    send_command('unbind #5')
    send_command('unbind #6')
    send_command('unbind #7')
    send_command('unbind #8')
    send_command('unbind #9')
    send_command('unbind #0')
 
 
    send_command('lua u gearinfo')
end
 
 
 
 
-- Define sets and vars used by this job file.
function init_gear_sets()
 
 
    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Precast Sets ------------------------------------------
    ------------------------------------------------------------------------------------------------
 
 
    -- Enmity set
    sets.Enmity = {
        ammo="Sapience Orb", --2
        head="Halitus Helm", --8
        body="Emet Harness +1", --10
        hands="Horos Bangles +3", --9
        feet="Ahosi Leggings", --7
        neck="Unmoving Collar +1", --10
        ear1="Cryptic Earring", --4
        ear2="Trux Earring", --5
        ring1="Supershear Ring", --5
        ring2="Eihwaz Ring", --5
        back=gear.DNC_WTZ_Cape, --10
        waist="Kasiri Belt", --3
        }
 
 
    sets.precast.JA['Provoke'] = sets.Enmity
    sets.precast.JA['No Foot Rise'] = {body="Horos Casaque +3"}
    sets.precast.JA['Trance'] = {head="Horos Tiara +3"}
 
 
    sets.precast.Waltz = {
 
 
    ammo="Ginsen",
    head="Maxixi Tiara +1",
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands="Maxixi Bangles +2",
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet="Maxixi Shoes +1",
    neck="Etoile Gorget",
    waist="Aristo Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Carb. Ring",
    right_ring="Carb. Ring",
    back={ name="Toetapper Mantle", augments={'"Store TP"+4','"Dual Wield"+1','"Rev. Flourish"+26',}},
 
 
        } -- Waltz Potency/CHR
 
 
    sets.precast.WaltzSelf = set_combine(sets.precast.Waltz, {
        head="Mummu Bonnet +2", --(8)
        ring1="Asklepian Ring", --(3)
        ear1="Roundel Earring", --5
        }) -- Waltz effects received
 
 
    sets.precast.Waltz['Healing Waltz'] = {}
    sets.precast.Samba = {head="Maxixi Tiara +1", back=gear.DNC_TP_Cape}
    sets.precast.Jig = {legs="Horos Tights +3", feet="Maxixi Toeshoes +1"}
 
 
    sets.precast.Step = {
 
 
    ammo="Ginsen",
    head="Malignance Chapeau",
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands="Maxixi Bangles +2",
    legs="Malignance Tights",
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Etoile Gorget",
    waist="Grunfeld Rope",
    left_ear="Assuage Earring",
    right_ear="Digni. Earring",
    left_ring="Varar Ring +1",
    right_ring="Varar Ring +1",
    back={ name="Toetapper Mantle", augments={'"Store TP"+4','"Dual Wield"+1','"Rev. Flourish"+26',}},
 
 
        }
 
 
    sets.precast.Step['Feather Step'] = set_combine(sets.precast.Step, {feet="Macu. Toeshoes +1"})
    sets.precast.Flourish1 = {}
    sets.precast.Flourish1['Animated Flourish'] = sets.Enmity
 
 
    sets.precast.Flourish1['Violent Flourish'] = {
        ammo="Hydrocera",
        head="Mummu Bonnet +2",
        body="Horos Casaque +3",
        hands="Mummu Wrists +2",
        legs="Mummu Kecks +2",
        feet="Mummu Gamash. +2",
        neck="Etoile Gorget +1",
        ear1="Digni. Earring",
        ear2="Enchntr. Earring +1",
        ring1="Metamor. Ring +1",
        ring2="Weather. Ring +1",
        waist="Eschan Stone",
        back=gear.DNC_TP_Cape,
        } -- Magic Accuracy
 
 
    sets.precast.Flourish1['Desperate Flourish'] = {
        ammo="C. Palug Stone",
        head="Maxixi Tiara +3",
        body="Maxixi Casaque +3",
        hands="Maxixi Bangles +3",
        legs=gear.Herc_WS_legs,
        feet="Maxixi Toeshoes +3",
        neck="Etoile Gorget +1",
        ear1="Cessance Earring",
        ear2="Telos Earring",
        ring1="Regal Ring",
        ring2={name="Chirich Ring +1", bag="wardrobe4"},
        back=gear.DNC_TP_Cape,
        } -- Accuracy
 
 
    sets.precast.Flourish2 = {}
    sets.precast.Flourish2['Reverse Flourish'] = {hands="Macu. Bangles +1",    back={ name="Toetapper Mantle", augments={'"Store TP"+4','"Dual Wield"+1','"Rev. Flourish"+26',}},}
    sets.precast.Flourish3 = {}
    sets.precast.Flourish3['Striking Flourish'] = {body="Macu. Casaque +1"}
    sets.precast.Flourish3['Climactic Flourish'] = {head="Maculele Tiara +1",}
 
 
    sets.precast.FC = {
        ammo="Sapience Orb",
        head=gear.Herc_MAB_head, --7
        body=gear.Taeon_FC_body, --8
        hands="Leyline Gloves", --8
        legs="Rawhide Trousers", --5
        feet=gear.Herc_MAB_feet, --2
        neck="Orunmila's Torque", --5
        ear1="Loquacious Earring", --2
        ear2="Enchntr. Earring +1", --2
        ring2="Weather. Ring +1", --6(4)
        }
 
 
    sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {
        ammo="Impatiens",
        body="Passion Jacket",
        ring1="Lebeche Ring",
        })
 
 
 
 
    ------------------------------------------------------------------------------------------------
    ------------------------------------- Weapon Skill Sets ----------------------------------------
    ------------------------------------------------------------------------------------------------
 
 
    sets.precast.WS = {
 
 
    ammo="Charis Feather",
    head={ name="Herculean Helm", augments={'Attack+22','Weapon skill damage +5%','STR+5','Accuracy+11',}},
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands="Maxixi Bangles +2",
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Herculean Boots", augments={'Attack+29','Weapon skill damage +4%','STR+6','Accuracy+13',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Petrov Ring",
    right_ring="Apate Ring",
    back="Bleating Mantle",
 
 
        } -- default set
 
 
    sets.precast.WS.Acc = set_combine(sets.precast.WS, {
    
    ammo="Charis Feather",
    head={ name="Herculean Helm", augments={'Attack+22','Weapon skill damage +5%','STR+5','Accuracy+11',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands="Maxixi Bangles +2",
    legs="Horos Tights +3",
    feet={ name="Lustra. Leggings +1", augments={'Attack+20','STR+8','"Dbl.Atk."+3',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Ishvara Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Petrov Ring",
    right_ring="Apate Ring",
    back={ name="Toetapper Mantle", augments={'"Store TP"+4','"Dual Wield"+1','"Rev. Flourish"+26',}},
 
 
        })
 
 
    sets.precast.WS.Critical = {body="Meg. Cuirie +2"}
 
 
    sets.precast.WS['Exenterator'] = set_combine(sets.precast.WS, {
    
     ammo="Charis Feather",
    head={ name="Herculean Helm", augments={'Attack+22','Weapon skill damage +5%','STR+5','Accuracy+11',}},
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands="Maxixi Bangles +2",
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Herculean Boots", augments={'Attack+29','Weapon skill damage +4%','STR+6','Accuracy+13',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Apate Ring",
    right_ring="Begrudging Ring",
    back="Bleating Mantle",
 
 
        })
 
 
    sets.precast.WS['Exenterator'].Acc = set_combine(sets.precast.WS['Exenterator'], {
   
    ammo="Charis Feather",
    head={ name="Herculean Helm", augments={'Attack+22','Weapon skill damage +5%','STR+5','Accuracy+11',}},
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands="Maxixi Bangles +2",
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Herculean Boots", augments={'Attack+29','Weapon skill damage +4%','STR+6','Accuracy+13',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Apate Ring",
    right_ring="Begrudging Ring",
    back="Bleating Mantle",
 
 
        })
 
 
    sets.precast.WS['Pyrrhic Kleos'] = set_combine(sets.precast.WS, {
   
    ammo="Charis Feather",
    head={ name="Lustratio Cap +1", augments={'Attack+20','STR+8','"Dbl.Atk."+3',}},
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Lustra. Leggings +1", augments={'Attack+20','STR+8','"Dbl.Atk."+3',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
 
 
        })
 
 
    sets.precast.WS['Pyrrhic Kleos'].Acc = set_combine(sets.precast.WS['Pyrrhic Kleos'], {
    
    ammo="Charis Feather",
    head={ name="Lustratio Cap +1", augments={'Attack+20','STR+8','"Dbl.Atk."+3',}},
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Lustra. Leggings +1", augments={'Attack+20','STR+8','"Dbl.Atk."+3',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
 
 
        })
 
 
    sets.precast.WS['Evisceration'] = set_combine(sets.precast.WS, {
     
     ammo="Charis Feather",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands="Maxixi Bangles +2",
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Herculean Boots", augments={'Attack+29','Weapon skill damage +4%','STR+6','Accuracy+13',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Apate Ring",
    right_ring="Begrudging Ring",
    back="Bleating Mantle",
 
 
        })
 
 
    sets.precast.WS['Evisceration'].Acc = set_combine(sets.precast.WS['Evisceration'], {
     
     ammo="Charis Feather",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands="Maxixi Bangles +2",
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Herculean Boots", augments={'Attack+29','Weapon skill damage +4%','STR+6','Accuracy+13',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Apate Ring",
    right_ring="Begrudging Ring",
    back="Bleating Mantle",
 
 
        })
 
 
    sets.precast.WS['Rudra\'s Storm'] = set_combine(sets.precast.WS, {
     
    ammo="Charis Feather",
    head="Maculele Tiara +1",
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands="Maxixi Bangles +2",
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Herculean Boots", augments={'Attack+29','Weapon skill damage +4%','STR+6','Accuracy+13',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Petrov Ring",
    right_ring="Apate Ring",
    back="Bleating Mantle",
 
 
        })
 
 
    sets.precast.WS['Rudra\'s Storm'].Acc = set_combine(sets.precast.WS['Rudra\'s Storm'], {
     
    ammo="Charis Feather",
    head={ name="Herculean Helm", augments={'Attack+22','Weapon skill damage +5%','STR+5','Accuracy+11',}},
    body={ name="Herculean Vest", augments={'Weapon skill damage +5%','AGI+5','Attack+7',}},
    hands="Maxixi Bangles +2",
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet={ name="Herculean Boots", augments={'Attack+29','Weapon skill damage +4%','STR+6','Accuracy+13',}},
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Sherida Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Petrov Ring",
    right_ring="Apate Ring",
    back="Bleating Mantle",
 
 
        })
         
    sets.precast.WS['Rudra\'s Storm'].Clim = {}
 
 
    sets.precast.WS['Aeolian Edge'] = {
    
    ammo="Pemphredo Tathlum",
    head="Malignance Chapeau",
    body={ name="Samnuha Coat", augments={'Mag. Acc.+13','"Mag.Atk.Bns."+14','"Fast Cast"+3','"Dual Wield"+4',}},
    hands="Maxixi Bangles +2",
    legs="Horos Tights +3",
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Fotia Gorget",
    waist="Eschan Stone",
    left_ear="Ishvara Earring",
    right_ear={ name="Moonshade Earring", augments={'Attack+4','TP Bonus +250',}},
    left_ring="Petrov Ring",
    right_ring="Apate Ring",
    back={ name="Toetapper Mantle", augments={'"Store TP"+4','"Dual Wield"+1','"Rev. Flourish"+26',}},
 
 
        }
 
 
    sets.precast.Skillchain = {
        hands="Macu. Bangles +1",
        }
 
 
    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Midcast Sets ------------------------------------------
    ------------------------------------------------------------------------------------------------
 
 
    sets.midcast.FastRecast = sets.precast.FC
 
 
    sets.midcast.SpellInterrupt = {
        ammo="Impatiens", --10
        ring1="Evanescence Ring", --5
        }
 
 
    sets.midcast.Utsusemi = sets.midcast.SpellInterrupt
 
 
    ------------------------------------------------------------------------------------------------
    ----------------------------------------- Idle Sets --------------------------------------------
    ------------------------------------------------------------------------------------------------
 
 
    sets.resting = {}
 
 
    sets.idle = {
    
    ammo="Ginsen",
    head="Malignance Chapeau",
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs="Malignance Tights",
    feet="Tandava Crackows",
    neck="Etoile Gorget",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Archon Ring",
    right_ring="Vocane Ring",
    back="Bleating Mantle",
 
 
        }
 
 
    sets.idle.DT = set_combine(sets.idle, {
   
    ammo="Ginsen",
    head="Malignance Chapeau",
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands="Maxixi Bangles +2",
    legs="Malignance Tights",
    feet="Tandava Crackows",
    neck="Dampener's Torque",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Archon Ring",
    right_ring="Vocane Ring",
    back="Archon Cape",
 
 
        })
 
 
    sets.idle.Town = set_combine(sets.idle, {
    
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Horos Tights +3", augments={'Enhances "Saber Dance" effect',}},
    feet="Tandava Crackows",
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
 
 
        })
 
 
    sets.idle.Weak = sets.idle.DT
 
 
    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Defense Sets ------------------------------------------
    ------------------------------------------------------------------------------------------------
 
 
    sets.defense.PDT = sets.idle.DT
    sets.defense.MDT = sets.idle.DT
 
 
    sets.Kiting = {feet="Skd. Jambeaux +1"}
 
 
    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Engaged Sets ------------------------------------------
    ------------------------------------------------------------------------------------------------
 
 
    -- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
    -- sets if more refined versions aren't defined.
    -- If you create a set with both offense and defense modes, the offense mode should be first.
    -- EG: sets.engaged.Dagger.Accuracy.Evasion
 
 
    sets.engaged = {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        }
 
 
    sets.engaged.LowAcc = {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        }
 
 
    -- * DNC Native DW Trait: 30% DW
    -- * DNC Job Points DW Gift: 5% DW
 
 
    -- No Magic Haste (74% DW to cap)
    sets.engaged.DW = {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        } -- 41%
 
 
    sets.engaged.DW.ACC = set_combine(sets.engaged.DW, {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        })
 
 
    -- 15% Magic Haste (67% DW to cap)
    sets.engaged.DW.LowHaste = {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        } -- 32%
 
 
    sets.engaged.DW.ACC.LowHaste = set_combine(sets.engaged.DW.LowHaste, {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        })
 
 
    -- 30% Magic Haste (56% DW to cap)
    sets.engaged.DW.MidHaste = {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        } -- 22%
 
 
    sets.engaged.DW.ACC.MidHaste = set_combine(sets.engaged.DW.MidHaste, {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        })
 
 
    -- 35% Magic Haste (51% DW to cap)
    sets.engaged.DW.HighHaste = {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
      } -- 10% Gear
 
 
    sets.engaged.DW.ACC.HighHaste = set_combine(sets.engaged.DW.HighHaste, {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        })
 
 
    -- 45% Magic Haste (36% DW to cap)
    sets.engaged.DW.MaxHaste = {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        } -- 0%
 
 
    sets.engaged.DW.ACC.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, {
    ammo="Ginsen",
    head={ name="Adhemar Bonnet +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
    legs={ name="Samnuha Tights", augments={'STR+4','DEX+7','"Triple Atk."+2',}},
    feet={ name="Horos T. Shoes +2", augments={'Enhances "Closed Position" effect',}},
    neck="Asperity Necklace",
    waist="Sarissapho. Belt",
    left_ear="Sherida Earring",
    right_ear="Suppanomimi",
    left_ring="Petrov Ring",
    right_ring="Epona's Ring",
    back="Bleating Mantle",
        })
 
 
    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Hybrid Sets -------------------------------------------
    ------------------------------------------------------------------------------------------------
 
 
    sets.engaged.DT = {
        head=gear.Adhemar_D_head, --4/0
        body="Ashera Harness", --7/7
        neck="Loricate Torque +1", --6/6
        ring1="Moonlight Ring", --5/5
        ring2="Defending Ring", --10/10
        }
 
 
    sets.engaged.DW.DT = sets.engaged.DT
 
 
    sets.engaged.DW.DT.LowHaste = sets.engaged.DT
 
 
    sets.engaged.DW.DT.MidHaste = sets.engaged.DT
 
 
    sets.engaged.DW.DT.HighHaste = sets.engaged.DT
 
 
    sets.engaged.DW.DT.MaxHaste = sets.engaged.DT
 
 
 
 
    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Special Sets ------------------------------------------
    ------------------------------------------------------------------------------------------------
 
 
    sets.buff['Saber Dance'] = {legs="Horos Tights +3"}
    sets.buff['Fan Dance'] = {body="Horos Bangles +3"}
    sets.buff['Climactic Flourish'] = {head="Maculele Tiara +1"} --body="Meg. Cuirie +2"}
    sets.buff['Closed Position'] = {feet="Horos T. Shoes +3"}
 
 
    sets.buff.Doom = {
        neck="Nicander's Necklace", --20
        ring1={name="Eshmun's Ring", bag="wardrobe3"}, --20
        ring2={name="Eshmun's Ring", bag="wardrobe4"}, --20
        waist="Gishdubar Sash", --10
        }
 
 
    sets.CP = {back="Mecisto. Mantle"}
    --sets.Reive = {neck="Ygnas's Resolve +1"}
 
 
end
 
 
 
 
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
 
 
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
-- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
function job_precast(spell, action, spellMap, eventArgs)
    --auto_presto(spell)
    if spellMap == 'Utsusemi' then
        if buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)'] then
            cancel_spell()
            add_to_chat(123, '**!! '..spell.english..' Canceled: [3+ IMAGES] !!**')
            eventArgs.handled = true
            return
        elseif buffactive['Copy Image'] or buffactive['Copy Image (2)'] then
            send_command('cancel 66; cancel 444; cancel Copy Image; cancel Copy Image (2)')
        end
    end
end
 
 
function job_post_precast(spell, action, spellMap, eventArgs)
    if buffactive['Climactic Flourish'] and spell.english:contains("Rudra's Storm") then
        equip(sets.precast.WS["Rudra's Storm"].Clim)
    elseif spell.english:contains("Rudra's Storm") then
        equip(sets.precast.WS["Rudra's Storm"])
    end
    if spell.type=='Waltz' and spell.english:startswith('Curing') and spell.target.type == 'SELF' then
        equip(sets.precast.WaltzSelf)
    end
end
 
 
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
function job_aftercast(spell, action, spellMap, eventArgs)
    -- Weaponskills wipe SATA.  Turn those state vars off before default gearing is attempted.
    if spell.type == 'WeaponSkill' and not spell.interrupted then
        state.Buff['Sneak Attack'] = false
    end
end
 
 
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
 
 
-- Called when a player gains or loses a buff.
-- buff == buff gained or lost
-- gain == true if the buff was gained, false if it was lost.
function job_buff_change(buff,gain)
    if buff == 'Saber Dance' or buff == 'Climactic Flourish' or buff == 'Fan Dance' then
        handle_equipping_gear(player.status)
    end
 
 
--    if buffactive['Reive Mark'] then
--        if gain then
--            equip(sets.Reive)
--            disable('neck')
--        else
--            enable('neck')
--        end
--    end
 
 
    if buff == "doom" then
        if gain then
            equip(sets.buff.Doom)
            send_command('@input /p Doomed.')
             disable('ring1','ring2','waist')
        else
            enable('ring1','ring2','waist')
            handle_equipping_gear(player.status)
        end
    end
 
 
end
 
 
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
 
 
-- Called by the 'update' self-command, for common needs.
-- Set eventArgs.handled to true if we don't want automatic equipping of gear.
function job_handle_equipping_gear(playerStatus, eventArgs)
    check_gear()
    update_combat_form()
    determine_haste_group()
    check_moving()
end
 
 
function job_update(cmdParams, eventArgs)
    handle_equipping_gear(player.status)
end
 
 
function update_combat_form()
    if DW == true then
        state.CombatForm:set('DW')
    elseif DW == false then
        state.CombatForm:reset()
    end
end
 
 
function get_custom_wsmode(spell, spellMap, defaut_wsmode)
    local wsmode
 
 
    if state.Buff['Sneak Attack'] then
        wsmode = 'SA'
    end
 
 
    return wsmode
end
 
 
function customize_idle_set(idleSet)
    if state.CP.current == 'on' then
        equip(sets.CP)
        disable('back')
    else
        enable('back')
    end
    if state.Auto_Kite.value == true then
       idleSet = set_combine(idleSet, sets.Kiting)
    end
 
 
    return idleSet
end
 
 
function customize_melee_set(meleeSet)
    --if state.Buff['Climactic Flourish'] then
    --    meleeSet = set_combine(meleeSet, sets.buff['Climactic Flourish'])
    --end
    if state.ClosedPosition.value == true then
        meleeSet = set_combine(meleeSet, sets.buff['Closed Position'])
    end
 
 
    return meleeSet
end
 
 
-- Handle auto-targetting based on local setup.
function job_auto_change_target(spell, action, spellMap, eventArgs)
    if spell.type == 'Step' then
        if state.IgnoreTargetting.value == true then
            state.IgnoreTargetting:reset()
            eventArgs.handled = true
        end
 
 
        eventArgs.SelectNPCTargets = state.SelectStepTarget.value
    end
end
 
 
 
 
-- Function to display the current relevant user state when doing an update.
-- Set eventArgs.handled to true if display was handled, and you don't want the default info shown.
function display_current_job_state(eventArgs)
    local cf_msg = ''
    if state.CombatForm.has_value then
        cf_msg = ' (' ..state.CombatForm.value.. ')'
    end
 
 
    local m_msg = state.OffenseMode.value
    if state.HybridMode.value ~= 'Normal' then
        m_msg = m_msg .. '/' ..state.HybridMode.value
    end
 
 
    local ws_msg = state.WeaponskillMode.value
 
 
    local s_msg = state.MainStep.current
    if state.UseAltStep.value == true then
        s_msg = s_msg .. '/'..state.AltStep.current
    end
 
 
    local d_msg = 'None'
    if state.DefenseMode.value ~= 'None' then
        d_msg = state.DefenseMode.value .. state[state.DefenseMode.value .. 'DefenseMode'].value
    end
 
 
    local i_msg = state.IdleMode.value
 
 
    local msg = ''
    if state.Kiting.value then
        msg = msg .. ' Kiting: On |'
    end
 
 
    add_to_chat(002, '| ' ..string.char(31,210).. 'Melee' ..cf_msg.. ': ' ..string.char(31,001)..m_msg.. string.char(31,002)..  ' |'
        ..string.char(31,207).. ' WS: ' ..string.char(31,001)..ws_msg.. string.char(31,002)..  ' |'
        ..string.char(31,060).. ' Step: '  ..string.char(31,001)..s_msg.. string.char(31,002)..  ' |'
        ..string.char(31,004).. ' Defense: ' ..string.char(31,001)..d_msg.. string.char(31,002)..  ' |'
        ..string.char(31,008).. ' Idle: ' ..string.char(31,001)..i_msg.. string.char(31,002)..  ' |'
        ..string.char(31,002)..msg)
 
 
    eventArgs.handled = true
end
 
 
 
 
-------------------------------------------------------------------------------------------------------------------
-- User self-commands.
-------------------------------------------------------------------------------------------------------------------
 
 
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
 
 
function determine_haste_group()
    classes.CustomMeleeGroups:clear()
    if DW == true then
        if DW_needed <= 1 then
            classes.CustomMeleeGroups:append('MaxHaste')
        elseif DW_needed > 1 and DW_needed <= 9 then
            classes.CustomMeleeGroups:append('HighHaste')
        elseif DW_needed > 9 and DW_needed <= 21 then
            classes.CustomMeleeGroups:append('MidHaste')
        elseif DW_needed > 21 and DW_needed <= 39 then
            classes.CustomMeleeGroups:append('LowHaste')
        elseif DW_needed > 39 then
            classes.CustomMeleeGroups:append('')
        end
    end
end
 
 
function job_self_command(cmdParams, eventArgs)
    if cmdParams[1] == 'step' then
        if cmdParams[2] == 't' then
            state.IgnoreTargetting:set()
        end
 
 
        local doStep = ''
        if state.UseAltStep.value == true then
            doStep = state[state.CurrentStep.current..'Step'].current
            state.CurrentStep:cycle()
        else
            doStep = state.MainStep.current
        end
 
 
        send_command('@input /ja "'..doStep..'" <t>')
    end
 
 
    gearinfo(cmdParams, eventArgs)
end
 
 
function gearinfo(cmdParams, eventArgs)
    if cmdParams[1] == 'gearinfo' then
        if type(tonumber(cmdParams[2])) == 'number' then
            if tonumber(cmdParams[2]) ~= DW_needed then
            DW_needed = tonumber(cmdParams[2])
            DW = true
            end
        elseif type(cmdParams[2]) == 'string' then
            if cmdParams[2] == 'false' then
                DW_needed = 0
                DW = false
            end
        end
        if type(tonumber(cmdParams[3])) == 'number' then
            if tonumber(cmdParams[3]) ~= Haste then
                Haste = tonumber(cmdParams[3])
            end
        end
        if type(cmdParams[4]) == 'string' then
            if cmdParams[4] == 'true' then
                moving = true
            elseif cmdParams[4] == 'false' then
                moving = false
            end
        end
        if not midaction() then
            job_update()
        end
    end
end
 
 
 
 
-- Automatically use Presto for steps when it's available and we have less than 3 finishing moves
function job_pretarget(spell, action, spellMap, eventArgs)
    if spell.type == 'Step' then
        local allRecasts = windower.ffxi.get_ability_recasts()
        local prestoCooldown = allRecasts[236]
        local under3FMs = not buffactive['Finishing Move 3'] and not buffactive['Finishing Move 4'] and not buffactive['Finishing Move 5']
 
 
        if player.main_job_level >= 77 and prestoCooldown < 1 and under3FMs then
            cast_delay(1.1)
            send_command('input /ja "Presto" <me>')
        end
    end
end
 
 
function check_moving()
    if state.DefenseMode.value == 'None'  and state.Kiting.value == false then
        if state.Auto_Kite.value == false and moving then
            state.Auto_Kite:set(true)
        elseif state.Auto_Kite.value == true and moving == false then
            state.Auto_Kite:set(false)
        end
    end
end
 
 
function check_gear()
    if no_swap_gear:contains(player.equipment.left_ring) then
        disable("ring1")
    else
        enable("ring1")
    end
    if no_swap_gear:contains(player.equipment.right_ring) then
        disable("ring2")
    else
        enable("ring2")
    end
end
 
 
windower.register_event('zone change',
    function()
        if no_swap_gear:contains(player.equipment.left_ring) then
            enable("ring1")
            equip(sets.idle)
        end
        if no_swap_gear:contains(player.equipment.right_ring) then
            enable("ring2")
            equip(sets.idle)
        end
    end
)
 
 
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
    -- Default macro set/book: (set, book)
    if player.sub_job == 'WAR' then
        set_macro_page(1, 4)
    elseif player.sub_job == 'THF' then
        set_macro_page(1, 4)
    elseif player.sub_job == 'NIN' then
        set_macro_page(1, 4)
    elseif player.sub_job == 'RUN' then
        set_macro_page(1, 4)
    elseif player.sub_job == 'SAM' then
        set_macro_page(1, 4)
    else
        set_macro_page(1, 4)
    end
end
 
 
function set_lockstyle()
    send_command('wait 2; input /lockstyleset ' .. lockstyleset)
end
Offline
Posts: 31
By DPSKngWJlly 2020-06-11 07:54:42
Link | Citer | R
 
Could anyone make me a lua that would change gear when ever ppl examine me it will chg gear so it cancels it out. Ty n advice
 Quetzalcoatl.Langly
Offline
Serveur: Quetzalcoatl
Game: FFXI
user: Langly
Posts: 684
By Quetzalcoatl.Langly 2020-06-11 15:30:21
Link | Citer | R
 
If they don't target you, it won't matter. Changing gear won't break their examine.

Filter it out if it bothers you too much.
Offline
Posts: 15
By Fatigue 2020-06-12 02:56:47
Link | Citer | R
 
Thank you so much! It works great, sorry for the late response, I don't get any notification on forum responses.

I really appreciate the help, you made DNC so much more enjoyable with a working LUA.
Log in to post.