Self Refresh - Lua Error

Language: JP EN DE FR
2010-09-08
New Items
users online
Forum » Windower » Support » Self refresh - lua error
Self refresh - lua error
 Valefor.Gorns
Offline
Server: Valefor
Game: FFXI
user: Gorns
Posts: 159
By Valefor.Gorns 2019-08-28 04:04:57
Link | Quote | Reply
 
Hi there,

Looking for help as I realized that my gear when I self-cast refresh doesn't swap, I stay with basic refresh set (i.e. set for other).

If anyone can help & explain me why !
Thank you
Code
-- Original: Motenten / Modified: Arislan
-- Haste/DW from other source

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

--  Modes:      [ F9 ]              Cycle Offense Mode
--              [ CTRL+F9 ]         Cycle Hybrid Modes
--              [ WIN+F9 ]          Cycle Weapon Skill Modes
--              [ F10 ]             Emergency -PDT Mode
--              [ ALT+F10 ]         Toggle Kiting Mode
--              [ F11 ]             Emergency -MDT Mode
--              [ CTRL+F11 ]        Cycle Casting Modes
--              [ F12 ]             Update Current Gear / Report Current Status
--              [ CTRL+F12 ]        Cycle Idle Modes
--              [ ALT+F12 ]         Cancel Emergency -PDT/-MDT Mode
--              [ ALT+` ]           Toggle Magic Burst Mode
--              [ WIN+C ]           Toggle Capacity Points Mode
--
--  Abilities:  [ CTRL+` ]          Composure
--              [ CTRL+- ]          Light Arts/Addendum: White
--              [ CTRL+= ]          Dark Arts/Addendum: Black
--              [ CTRL+; ]          Celerity/Alacrity
--              [ ALT+[ ]           Accesion/Manifestation
--              [ ALT+; ]           Penury/Parsimony
--
--  Spells:     [ CTRL+` ]          Stun
--              [ ALT+Q ]           Temper
--              [ ALT+W ]           Flurry II
--              [ ALT+E ]           Haste II
--              [ ALT+R ]           Refresh II
--              [ ALT+Y ]           Phalanx
--              [ ALT+O ]           Regen II
--              [ ALT+P ]           Shock Spikes
--              [ ALT+I ]           Utsusemi: Ichi
--              [ ALT+N ]           Utsusemi: Ni
--
--  Weapons:    [ CTRL+W ]          Toggles Weapon Lock
--
--  WS:         [ CTRL+Numpad7 ]    Savage Blade
--              [ CTRL+Numpad8 ]    Chant Du Cygne
--              [ CTRL+Numpad4 ]    Requiescat
--              [ CTRL+Numpad5 ]    Sanguine Blade
--
--
--              (Global-Binds.lua contains additional non-job-related keybinds)

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

--              Addendum Commands:
--              Shorthand versions for each strategem type that uses the version appropriate for
--              the current Arts.
--                                          Light Arts                  Dark Arts
--                                          ----------                  ---------
--              gs c scholar light          Light Arts/Addendum
--              gs c scholar dark                                       Dark Arts/Addendum
--              gs c scholar cost           Penury                      Parsimony
--              gs c scholar speed          Celerity                    Alacrity
--              gs c scholar aoe            Accession                   Manifestation
--              gs c scholar addendum       Addendum: White             Addendum: Black
	
-------------------------------------------------------------------------------------------------------------------
-- 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.CP = M(false, "Capacity Points Mode")
    state.Buff.Saboteur = buffactive.Saboteur or false
    
    enfeebling_magic_acc = S{'Bind', 'Break', 'Dispel', 'Distract', 'Distract II', 'Frazzle',
        'Frazzle II',  'Gravity', 'Gravity II', 'Silence', 'Sleep', 'Sleep II', 'Sleepga'}
    enfeebling_magic_skill = S{'Distract III', 'Frazzle III', 'Poison II'}
    enfeebling_magic_effect = S{'Dia', 'Dia II', 'Dia III', 'Diaga'}

    skill_spells = S{
        'Temper', 'Temper II', 'Enfire', 'Enfire II', 'Enblizzard', 'Enblizzard II', 'Enaero', 'Enaero II',
        'Enstone', 'Enstone II', 'Enthunder', 'Enthunder II', 'Enwater', 'Enwater II',
		'Gain-MND', 'Gain-VIT','Gain-INT','Gain-DEX','Gain-STR','Gain-AGI','Gain-CHR', }

    determine_haste_group()
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', 'MidAcc', 'HighAcc') 		-- F9
    state.HybridMode:options('Normal', 'DT')						-- ctrl + F9
    state.WeaponskillMode:options('Normal', 'Acc')					-- win + F9
    state.CastingMode:options('Normal', 'Resistant')				-- ctrl + F11
    state.IdleMode:options('Normal', 'MP', 'DT')					-- ctrl + F12

    state.CP = M(false, "Capacity Points Mode")						-- win + c	
    state.WeaponLock = M(false, 'Weapon Lock')    					-- win + z
    state.MagicBurst = M(false, 'Magic Burst')						-- alt + ²

    state.WeaponSet = M{['description']='Weapon Set', 'SavageBlade', 'CDC', 'SanguineBlade', 'Enspell'}	-- no spaces in names!
    send_command('bind @e gs c cycle WeaponSet')	
	
	-- Mote-libs handle obis, gorgets, and other elemental things.
    -- These are default fallbacks if situationally appropriate gear is not available.
    gear.default.weaponskill_neck = "Combatant's Torque"    -- used in sets.precast.WS and friends
    gear.default.weaponskill_waist = "Windbuffet Belt +1"   -- used in sets.precast.WS and friends
    gear.default.obi_waist = "Refoccilation Stone"          -- used in nuke sets (cures overriden in job_post_midcast)
	gear.default.obi_ring = "Resonance Ring"                -- used in nuke sets

    -- Additional local binds
    include('Global-Binds.lua')

    send_command('bind @c gs c toggle CP')				-- win + c
    send_command('bind @w gs c toggle WeaponLock')		-- win + z
    send_command('bind !` gs c toggle MagicBurst')		-- alt + ²
	
    send_command('bind ^` input /ja "Composure" <me>')	-- ctrl + ²

    if player.sub_job == 'SCH' then
        send_command('bind ^- gs c scholar light')
        send_command('bind ^= gs c scholar dark')
        send_command('bind ![ gs c scholar aoe')		
        send_command('bind !- input /ja "Addendum: White" <me>')
        send_command('bind != input /ja "Addendum: Black" <me>')
    end

    send_command('bind !q input /ma "Temper II" <me>')
    send_command('bind !w input /ma "Flurry II" <stpc>')
    send_command('bind !e input /ma "Haste II" <stpc>')
    send_command('bind !r input /ma "Refresh III" <stpc>')
    send_command('bind !y input /ma "Phalanx II" <stpc>')
    send_command('bind !o input /ma "Regen II" <stpc>')
    send_command('bind !p input /ma "Shock Spikes" <me>')

    send_command('bind ^numpad7 input /ws "Savage Blade" <t>')
    send_command('bind ^numpad8 input /ws "Chant du Cygne" <t>')
	send_command('bind ^numpad9 input /ws "Evisceration" <t>')
    send_command('bind ^numpad4 input /ws "Requiescat" <t>')
	send_command('bind ^numpad5 input /ws "Sanguine Blade" <t>')

    update_offense_mode()    
    select_default_macro_book()
    set_lockstyle()
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 !q')
    send_command('unbind !w')
    send_command('unbind !e')
    send_command('unbind !r')
    send_command('unbind !y')
    send_command('unbind !o')
    send_command('unbind !p')
    send_command('unbind @c')
    send_command('unbind @w')
    send_command('unbind @r')
	send_command('unbind @e')
    send_command('unbind ^numpad7')
    send_command('unbind ^numpad9')
    send_command('unbind ^numpad4')
    send_command('unbind ^numpad1')
    send_command('unbind ^numpad2')
    send_command('unbind ^numpad3')
    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')						 
end

-- Define sets and vars used by this job file.
function init_gear_sets()
    ------------------------------------------------------------------------------------------------
    ---------------------------------------- WS Sets cycling/equipping accordingly ------------------------------------------
    ------------------------------------------------------------------------------------------------

    sets.CDC = {
		main="Sequence",
		sub="Ternion Dagger +1",
		}
    sets.SavageBlade = {
		main="Sequence", 
		sub="Ternion Dagger +1", -- or Colada QA
		}
	sets.SanguineBlade = {
		main="Vitiation Sword",
		sub="Malevolence",
		}
	sets.Enspell = {
		main="Vitiation Sword",
		sub="Malevolence",
		}		
    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Precast Sets ------------------------------------------
    ------------------------------------------------------------------------------------------------
    
    -- Precast sets to enhance JAs
    sets.precast.JA['Chainspell'] = {body="Viti. Tabard +3"}
    
    -- Fast cast sets for spells

	-- 80% Fast Cast (including trait) for all spells, plus 5% quick cast (30% from Job Trait ; 8% from Gifts ; 42% to be geared)
    -- No other FC sets necessary.
	-- Traits +30
    sets.precast.FC = {
		ammo="Sapience Orb", 																	-- 2
		head="Amalric Coif", 																	-- 10
		body="Viti. Tabard +3", 			-- 15(MP79)
		hands=gear.Chironic_FC_hands,															-- 5 (MP23)
		legs={ name="Psycloth Lappas", augments={'MP+80','Mag. Acc.+15','"Fast Cast"+7',}}, 	-- 7 (MP80+29)
		feet={ name="Amalric Nails", augments={'MP+60','Mag. Acc.+15','"Mag.Atk.Bns."+15',}}, 	-- 5 (MP 26+60)
		ear1="Loquac. Earring", 																-- 2 (MP30)
		ear2="Etiolation Earring", 																-- 1 (MP50)
		ring2="Kishar Ring",																	-- 4
		} 
		--51 so 51+30= 81/80

    sets.precast.FC['Enhancing Magic'] = sets.precast.FC

    sets.precast.FC.Cure = set_combine(sets.precast.FC, {
        ammo="Impatiens",																		--0 (2)
		hands={ name="Telchine Gloves", augments={'"Cure" spellcasting time -3%',}},			--3 (MP44)
        ear1="Mendi. Earring", 																	--5 (MP30)
		waist="Witful Belt",																	--3 (3)
        ----ring1="Lebeche Ring", 	--(2)
        back="Perimede Cape", 	--(4)
        })

    sets.precast.FC.Curaga = sets.precast.FC.Cure
    sets.precast.FC['Healing Magic'] = sets.precast.FC.Cure
    sets.precast.FC['Elemental Magic'] = sets.precast.FC
    sets.precast.FC.Impact = set_combine(sets.precast.FC, {head=empty, body="Twilight Cloak"})
    sets.precast.Storm = sets.precast.FC -- stop quick cast

	sets.precast.FC['Enfeebling Magic'] = set_combine(sets.precast.FC, {
		head="Leth. Chappel +1",
		})
	
    sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {
        ammo="Impatiens",
        neck="Magoraga Beads",
        ----ring1="Lebeche Ring",
        back="Perimede Cape",
        waist="Witful Belt",
        })


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

    sets.precast.WS = {
        ammo="Amar Cluster",
		head="Jhakri Coronal +1",
		body="Jhakri Robe +2",
		hands="Atrophy Gloves +3",
		legs=gear.Taeon_TA_legs,
		feet="Thereoid Greaves",
		neck="Fotia Gorget",
		waist="Foia Belt",
		ear1="Sherida Earring",
		ear2="Ishvara Earring",		
		ring2="Rufescent Ring",
		ring1="Ilabrat Ring",
        back=gear.RDM_DA_Cape,
        }

    sets.precast.WS['Chant du Cygne'] = {    
		ammo="Yetshila",			--ammo="Yetshila +1",
		head=gear.Taeon_TA_head,	--head="Jhakri Coronal +2",	
		body="Ayanmo Corazza +2", 	--body="Taeon Tabard",
		hands="Jhakri Cuffs +2",
		legs="Viti. Tights +3",
		feet="Thereoid Greaves",
		neck="Fotia Gorget",
		waist="Fotia Belt",
		ear1="Sherida Earring",
		ear2="Mache Earring +1",		
		ring2="Begrudging Ring",
		ring1="Ilabrat Ring",
		back=gear.RDM_DA_Cape,
	}

    sets.precast.WS['Vorpal Blade'] = sets.precast.WS['Chant du Cygne']

    sets.precast.WS['Savage Blade'] = {
		ammo="Amar Cluster",		--ammo="Floestone",
		head="Viti. Chapeau +3",	
		body="Viti. Tabard +3",
		hands="Atrophy Gloves +3",
		legs="Jhakri Slops +2",		
		feet="Jhakri Pigaches +2",	
		neck="Caro Necklace",		--neck="Duelist's Torque",	neck="Dls. Torque +1",	neck="Dls. Torque +2",
		waist="Prosilio Belt +1",
		ear1="Sherida Earring",		--ear1="Regal Earring",
		ear2="Ishvara Earring",		--ear2="Moonshade Earring",
		ring1="Rufescent Ring",		--ring1="Karieyh Ring +1",
		ring2="Ifrit Ring +1",		--ring2="Epaminondas's Ring",
		back=gear.RDM_WS1_Cape,
	}

    sets.precast.WS['Death Blossom'] = sets.precast.WS['Savage Blade']

    sets.precast.WS['Requiescat'] = {
		ammo="Hydrocera",
		head="Carmine Mask +1",
		body="Jhakri Robe +2",
		hands="Jhakri Cuffs +2",
		legs="Jhakri Slops +2",
		feet={ name="Carmine Greaves +1", augments={'Accuracy+12','DEX+12','MND+20',}},
		neck="Fotia Gorget",
		waist="Fotia Belt",
		ear1="Sherida Earring",
		ear2="Gwati Earring",
		ring1="Jhakri Ring",
		ring2="Rufescent Ring",
		back=gear.RDM_DA_Cape,
	}

    sets.precast.WS['Sanguine Blade'] = {
		ammo="Pemphredo Tathlum",
		head="Pixie Hairpin +1",
		body="Amalric Doublet +1",
        hands="Jhakri Cuffs +2",
        legs=gear.Merlinic_MB_legs,		--legs="Amalric Slops +1",
		feet="Vitiation Boots +3",
		neck="Fotia Gorget",			--neck="Baetyl Pendant",
        waist="Refoccilation Stone",	--waist="Orpheus's Sash",
		ear1="Digni. Earring",			--ear1="Regal Earring",
		ear2="Friomisi Earring",
		ring1="Shiva Ring +1",			--ring1="Epaminondas's Ring",
		ring2="Archon Ring",
		back=gear.RDM_MND_Cape,			--back=gear.RDM_INT_Cape,
	}


    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Midcast Sets ------------------------------------------
    ------------------------------------------------------------------------------------------------
    
    sets.midcast.FastRecast = sets.precast.FC

    sets.midcast.SpellInterrupt = {
        ammo="Impatiens", 			--10
        legs="Carmine Cuisses +1", 	--20
        ring1="Evanescence Ring", 	--5
        waist="Rumination Sash", 	--10
        }

	-- Cure potency cap @ 50%
	sets.midcast.Cure = {	
		main="Serenity",																									-- 25%
		sub="Curatio Grip",
		ammo="Hydrocera",							-- ammo="Hasty Pinion +1",
		head="Vanya Hood",							-- or Kayakus head to check what is best								-- 17%
		body="Viti. Tabard +3",						-- body="Kaykaus Bliaut",
		hands="Kaykaus Cuffs",																								-- 10% 
		legs="Atrophy Tights +1",					-- skill 13 potency 10%
		feet="Vanya Clogs", 						-- or Kaykaus Boots		to check what is best	
		neck="Incanter's Torque",
        ear1="Mendi. Earring", 																								-- 5%
        ear2="Roundel Earring", 																							-- 5%
		ring1="Ephedra Ring",						
		ring2="Haoma's Ring",
        back="Tempered Cape +1",																							-- 6%
		waist="Luminary Sash", --or Bishop Sash
        }

    sets.midcast.CureWeather = set_combine(sets.midcast.Cure, {
        --sub="Achaq Grip", --0/(-4)
        --hands="Kaykaus Cuffs", --10/(-6)
		main="Chatoyant Staff",
		sub="Curatio Grip",
        back="Twilight Cape",
        waist="Hachirin-no-Obi",
        })

    sets.midcast.CureSelf = set_combine(sets.midcast.Cure, {
        --hands="Buremte Gloves", je les ai jetes -- (13)
        neck="Phalaina Locket", -- 4(4)
        waist="Gishdubar Sash", -- (10)
		ring2="Asklepian Ring",
		ring1="Kunaji Ring", 
		})

    sets.midcast.Curaga = set_combine(sets.midcast.Cure, {
        --ammo="Regal Gem",
        --ring1="Levia. Ring +1",
        --ring2="Levia. Ring +1",
        waist="Luminary Sash",
        })

    sets.midcast.StatusRemoval = set_combine(sets.midcast.Cure, {
        head="Vanya Hood",
        body="Vanya Robe",
        legs="Atrophy Tights +1",
        feet="Vanya Clogs",
        --ear2="Healing Earring",
        --waist="Bishop's Sash",
        })
        
    sets.midcast.Cursna = set_combine(sets.midcast.Cure, {
		body="Viti. Tabard +3",
		feet="Vanya Clogs",
		neck="Malison Medallion",	--neck="Debilis Medallion",
		ear1="Gwati Earring",
		waist="Gishdubar Sash",
		ring1="Haoma's Ring",
		ring2="Ephedra Ring",
	})

	-- TARGET 500 skill -- RDM99 @404 -- RDM Master 440 
    sets.midcast['Enhancing Magic'] =  set_combine(sets.idle.MP, {
		main=gear.Grioavolr_ENH,						--main=colada enh duration
		sub="Fulcio Grip",				-- 3			--sub="Ammurapi Shield",
		--ammo="Regal Gem",
		head="Befouled Crown",			-- 16
        body="Viti. Tabard +3",			-- 23 + 15% duration
		hands="Atrophy Gloves +3",		-- 20%
       	legs="Atrophy Tights +1", 		-- 17 -> 19 if +2 ; 21 if+3		
		feet="Leth. Houseaux +1",		-- 25 +30% duration			
		neck="Dls. Torque +1",
        ear1="Augment. Earring",		
		ear2="Andoaa Earring",			-- 5
        ring1="Stikini Ring",
        ring2="Stikini Ring",
		back=gear.RDM_MND_Cape,			-- 20% duration
		waist="Olympus Sash",
        })
    
    sets.midcast.EnhancingDuration = set_combine(sets.midcast['Enhancing Magic'], {        
        head=gear.Telchine_ENH_head,
		legs="Telchine Braconi",
		neck="Duelist's Torque", 		--neck="Dls. Torque +1",
        })
		
        
    -- Job-specific buff sets
    sets.buff.ComposureOther = 	set_combine(sets.midcast['Enhancing Magic'], {
      	head="Leth. Chappel +1",
		body="Viti. Tabard +3",
		hands="Atrophy Gloves +3",
		legs="Leth. Fuseau +1",
		feet="Leth. Houseaux +1",
	})		

    sets.midcast.EnhancingSkill = set_combine(sets.midcast['Enhancing Magic'], {
		main="Pukulatmuj +1", 
        sub="Pukulatmuj",
		head="Befouled Crown", 								-- 16 
		body="Viti. Tabard +3", 							-- 19
		hands="Viti. Gloves +3",  							-- 24 
		legs="Atrophy Tights +1", 	-- +2 / +3				-- 17 -> 19 if +2 ; 21 if+3
		feet="Leth. Houseaux +1",							-- 25
		neck="Incanter's Torque",  					  		-- 10	
		waist="Olympus Sash", 								-- 5 
		ear1="Augment. Earring",							-- 3
		ear2="Andoaa Earring",								-- 5 										
		ring1="Stikini Ring", 								-- 5
		ring2="Stikini Ring", 								-- 5 
		back="Ghostfyre Cape",								-- 5  +17% duration
        })

    sets.midcast.GainSpell = set_combine(sets.midcast.EnhancingSkill, {
        hands="Viti. Gloves +3",
        })
		
    sets.midcast.Regen = set_combine(sets.midcast.EnhancingDuration, {
        main="Bolelabunga",
		sub="Genmei Shield",	--sub="Ammurapi Shield",
        })

    sets.midcast.Refresh = set_combine(sets.midcast.EnhancingDuration, {
        head="Amalric Coif", 		-- +1
        body="Atrophy Tabard +3", 	-- +3
        legs="Leth. Fuseau +1", 	-- +2
        })
    
    sets.midcast.RefreshSelf = set_combine(sets.midcast.Refresh, {
        waist="Gishdubar Sash",
        --back="Grapevine Cape"
        })

    sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {
        neck="Nodens Gorget",
        ear2="Earthcry Earring",
		waist="Siegel Sash",
		legs="Shedir Seraweels"
        })

    sets.midcast['Phalanx'] = set_combine(sets.midcast['Enhancing Magic'], {
--        feet=gear.Taeon_PH_feet
        })

    sets.midcast.Aquaveil = set_combine(sets.midcast['Enhancing Magic'], {
        head="Amalric Coif",
        --waist="Emphatikos Rope",
		legs="Shedir Seraweels"
        })

    sets.midcast.Storm = sets.midcast.EnhancingDuration

    sets.midcast.Protect = set_combine(sets.midcast.EnhancingDuration, {ring2="Sheltered Ring"})

    sets.midcast.Protectra = sets.midcast.Protect
    sets.midcast.Shell = sets.midcast.Protect
    sets.midcast.Shellra = sets.midcast.Shell

	-----------------------
	--- ENFEEBLING SETS ---
	-----------------------
	
	-- Enfeebling Magic Skill (using Empy Body not a skill one), Distract III, Frazzle III, Poison II and maybe Dia III as it has a decent DoT effect now but that's really pushing it.
	-- Enfeebling Magic Accuracy (Sleep / Bind / Gravity / Silence / Frazzle II / Distract II)
	-- Enfeebling Magic MND Stat (Addle II, Slow II, Paralyze II)
	-- The only INT based enfeeble with any potency is Blind II and it's only useful if your evasion tanking some low level stuff for whatever reason.	

	--You need to divide RDM enfeeble in(at least) 4 sets:
		--1) Accuracy-based only (bind, break,dispel,gravity,silence,sleep): these spells are hit/miss with no variable potency and you want the highest macc possible so Ayanmo head +2 will win (carmine+1 head is even better)

		--2) Accuracy and stat-based(Distract1/2, Frazzle 1/2): enfeebling magic for these spells caps very quickly (350 for the II version) so you want as much magic accuracy as possible while adding MND to increase the spell potency (and ideally the enfeebling potency items such as regal gem,empy body and JSE cape)

		--3) Skill and stat based (Distract3, Frazzle3): these spells potency is affected by enfeebling magic skill and MND so relic hat will win for raw potency compared to any huge macc item. Once again enfeebling potency is your friend.

		--4) Enfeebling magic potency only(Dia1/2/3): these spells can't be resisted so magic accuracy won't do anything but enfeebling potency gear(regal gem,empy body and JSE cape) will improve their DoT
	

	-- bunch of Macc and focus on MND	
    sets.midcast.MndEnfeebles = {
		main=gear.Grioavolr_ENF,
		sub="Enki Strap",
		range="Kaja Bow",		
		--ammo="Hydrocera",				--ammo="Regal Gem",
		head="Viti. Chapeau +3",		--head="Atrophy Chapeau +3",
		body="Atrophy Tabard +3",		
		hands={ name="Kaykaus Cuffs", augments={'MP+60','MND+10','Mag. Acc.+15',}}, 
		legs=gear.Chironic_Macc_legs,
		feet="Vitiation Boots +3",
		neck="Dls. Torque +1",
		ear1="Digni. Earring",		--ear1="Hermetic Earring",
		ear2="Gwati Earring",		--ear2="Regal Earring",
		ring1="Stikini Ring", 		--ring1="Globidonta Ring",		
		ring2="Kishar Ring",		--macc+5 enfeebling duration +10%		
		waist="Luminary Sash", 		
        back=gear.RDM_MND_Cape,		
        }

	-- a bit more of Macc
    sets.midcast.MndEnfeeblesAcc = set_combine(sets.midcast.MndEnfeebles, {
        range="Kaja Bow",
		--head="Atrophy Chapeau +3",
		ear1="Digni. Earring",
		ring2="Stikini Ring",
        --ring1="Weather. Ring +1",
        })
    
    sets.midcast.IntEnfeebles = set_combine(sets.midcast.MndEnfeebles, {
        ammo="Pemphredo Tathlum",
		--back=gear.RDM_INT_Cape,
        })

    sets.midcast.IntEnfeeblesAcc = set_combine(sets.midcast.IntEnfeebles, {
        --head="Atrophy Chapeau +3",
		range="Kaja Bow",
		ear1="Digni. Earring",
		ring2="Stikini Ring",
		--ring1="Weather. Ring +1",
        })

	-- Set Enfeebling SKILL for Distract III / Frazzle III / Dia III / Poison II
	-- Master skill = 460
	-- Merits +16
	-- 620 SKILL with this set
    sets.midcast.SkillEnfeebles = {
		main=gear.Grioavolr_ENF,		-- 16
		sub="Enki Strap",				--sub="Mephitis Grip",
		ammo="Pemphredo Tathlum",
		head="Viti. Chapeau +3",		-- 26 							 
		body="Atrophy Tabard +3",  		-- 21 	
		hands="Leth. Gantherots +1",	-- 19
		legs="Psycloth Lappas", 		-- 18
		feet="Vitiation Boots +3",		-- 16 + enfeebling effect+10
		neck="Incanter's Torque",		-- 10
		waist="Rumination Sash", 		-- 7
		ear1="Digni. Earring",
		ear2="Enfeebling Earring", 		-- 3
		ring1="Stikini Ring", 			-- 5
		ring2="Stikini Ring", 			-- 5
		back=gear.RDM_MND_Cape,			-- enfeebling effect +10
        }

    sets.midcast.EffectEnfeebles = set_combine(sets.midcast.SkillEnfeebles, {
        --ammo="Regal Gem",
		body="Lethargy Sayon +1",	-- enfeebling effect +14
		feet="Vitiation Boots +3",
        neck="Dls. Torque +1",
		back=gear.RDM_MND_Cape,
        } )

    sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles

    sets.midcast['Paralyze II'] = set_combine(sets.midcast.MndEnfeebles, {feet="Vitiation Boots +3"})
    sets.midcast['Slow II'] = set_combine(sets.midcast.MndEnfeebles, {head="Viti. Chapeau +3"})
	sets.midcast['Addle II'] = sets.midcast.MndEnfeebles

	sets.midcast['Distract'] = sets.midcast.MndEnfeeblesAcc
	sets.midcast['Distract II'] = sets.midcast.MndEnfeeblesAcc
	
	sets.midcast['Frazzle'] = sets.midcast.MndEnfeeblesAcc
	sets.midcast['Frazzle II'] = sets.midcast.MndEnfeeblesAcc
	
	sets.midcast['Gravity'] = sets.midcast.IntEnfeeblesAcc
	sets.midcast['Gravity II'] = sets.midcast.IntEnfeeblesAcc
	
	sets.midcast['Sleep'] = sets.midcast.IntEnfeeblesAcc
	sets.midcast['Sleep II'] = sets.midcast.IntEnfeeblesAcc
	sets.midcast['Sleepga'] = sets.midcast.IntEnfeeblesAcc
	
	sets.midcast['Bind'] = sets.midcast.IntEnfeeblesAcc
	sets.midcast['Silence'] = sets.midcast.MndEnfeeblesAcc
	sets.midcast['Inundation'] = sets.midcast.MndEnfeeblesAcc
	
    sets.midcast['Dia III'] = set_combine(sets.midcast.SkillEnfeebles, {head="Viti. Chapeau +3"})	
	sets.midcast['Distract III'] = sets.midcast.SkillEnfeebles
	sets.midcast['Distract III'].Resistant = sets.midcast.MndEnfeeblesAcc
	sets.midcast['Frazzle III'] = sets.midcast.SkillEnfeebles
	sets.midcast['Frazzle III'].Resistant = sets.midcast.MndEnfeeblesAcc
	sets.midcast['Poison II'] = sets.midcast.SkillEnfeebles
	sets.midcast['Blind'] = sets.midcast.SkillEnfeebles
	

    sets.midcast['Dark Magic'] = {   
		main="Rubicundity",
		sub="Genmei Shield",				--sub="Ammurapi Shield",
		ammo="Pemphredo Tathlum",
        head=gear.Merlinic_Macc_head,		--head="Atrophy Chapeau +3",
		body="Atrophy Tabard +3",
		hands=gear.Chironic_Macc_hands,
        legs=gear.Merlinic_Macc_legs,
        feet=gear.Merlinic_Macc_feet,
		neck="Erra Pendant",
		ear1="Digni. Earring",				--ear1="Hermetic Earring",
		ear2="Gwati Earring",				----ear2="Regal Earring",
		ring1="Evanescence Ring",
		ring2="Archon Ring",
		waist="Luminary Sash",
        back=gear.RDM_MND_Cape ,			--back=gear.RDM_INT_Cape,							  
        }

    sets.midcast.Drain = set_combine(sets.midcast['Dark Magic'], {
        head="Pixie Hairpin +1",
        feet=gear.Merlinic_Aspir_feet,
        --ear1="Hirudinea Earring",
        ring2="Archon Ring",
        waist="Fucho-no-obi",
        })
    
    sets.midcast.Aspir = sets.midcast.Drain
    sets.midcast.Stun = set_combine(sets.midcast['Dark Magic'], {waist="Luminary Sash"
		})

    sets.midcast['Elemental Magic'] = {
		main=gear.Grioavolr_MAB,
		sub="Enki Strap",
		ammo="Pemphredo Tathlum",
		head=gear.Merlinic_MAB_head,
		body="Amalric Doublet +1",
		hands="Amalric Gages +1",
		legs=gear.Merlinic_MAB_legs,		
		feet=gear.Merlinic_MAB_feet,
		neck="Sanctity Necklace",		--neck="Baetyl Pendant",
		ear1="Hecate's Earring",		----ear1="Regal Earring",		
		ear2="Friomisi Earring",         
		ring1="Jhakri Ring",        	--ring2="Shiva Ring +1",
		ring2="Shiva Ring +1",  
        waist="Refoccilation Stone",
		back=gear.RDM_MND_Cape        --back=gear.RDM_INT_Cape,
        }

    sets.midcast['Elemental Magic'].Resistant = set_combine(sets.midcast['Elemental Magic'], {
        main=gear.Grioavolr_Macc,
        sub="Enki Strap",
		ammo="Pemphredo Tathlum",
		head=gear.Merlinic_Macc_head, 	--head="Atrophy Chapeau +3",
		body="Amalric Doublet +1",
		hands=gear.Chironic_Macc_hands,
	    legs=gear.Merlinic_Macc_legs,
		feet="Jhakri Pigaches +2",
		neck="Erra Pendant",
		ear1="Digni. Earring",
		ring1="Stikini Ring",
		ring2="Stikini Ring",
		waist="Eschan Stone",
        })
        
    sets.midcast.Impact = set_combine(sets.midcast['Elemental Magic'], {
        main=gear.Grioavolr_MAB,
        sub="Niobid Strap",
        head=empty,
        body="Twilight Cloak",
        ring1="Archon Ring",
        })
    
    sets.midcast.Utsusemi = sets.midcast.SpellInterrupt

    -- Initializes trusts at iLvl 119
    sets.midcast.Trust = sets.precast.FC

	-- Job-specific buff sets
    sets.buff.Saboteur = {hands="Leth. Gantherots +1"}
    
    ------------------------------------------------------------------------------------------------
    ----------------------------------------- Idle Sets --------------------------------------------
    ------------------------------------------------------------------------------------------------
    
    sets.idle = {
		--ammo="Homiliary",
		--ear2="Ethereal Earring",
		--hands=gear.merlinic_refresh_hands,
		--back="Umbra Cape",
		--feet=gear.chironic_refresh_feet
		--main=gear.Grioavolr_MP, MP Pool main
		--sub="Niobid Strap", MP Pool sub
		--body=”Amalric Doublet +1”, MP Pool Body			
		main="Bolelabunga",
		sub="Genmei Shield",	
		ammo="Ghastly Tathlum +1",		
		head="Viti. Chapeau +3",
		body="Jhakri Robe +2",
		hands="Kaykaus Cuffs",
		legs="Viti. Tights +3",
		feet=gear.Merlinic_Refresh_feet,
		neck="Sanctity Necklace",
		ear1="Evans Earring",
		ear2="Etiolation Earring",
		ring1="Mephitas's Ring",
		ring2="Mephitas's Ring +1",	
		back="Moonbeam Cape",			
		waist="Shinjutsu-no-Obi +1",		
        }

	sets.idle.MP = set_combine(sets.idle, {
		main=gear.Grioavolr_MP,
		sub="Niobid Strap",
		head="Vanya Hood",
		body="Amalric Doublet +1",
		legs="Psycloth Lappas",		
		})			
		
	-- Assuming Shell V is on (24% MDT)
    sets.idle.DT = set_combine(sets.idle, {
		main="Bolelabunga",
		sub="Genmei Shield", 																	--10/0
		ammo="Staunch Tathlum",																	--2/2
		head="Viti. Chapeau +3",
		body="Mallquis Saio +1",																--6/6
		hands="Ea Cuffs",
		legs={ name="Chironic Hose", augments={'Mag. Acc.+17 "Mag.Atk.Bns."+17','"Cure" spellcasting time -2%','MND+10','Mag. Acc.+15','"Mag.Atk.Bns."+10',}},
		feet={ name="Merlinic Crackows", augments={'Mag. Acc.+23','DEX+6','"Refresh"+1','Accuracy+17 Attack+17','Mag. Acc.+15 "Mag.Atk.Bns."+15',}},
		neck="Loricate Torque +1",																--6/6
		waist="Flume Belt",																		--4/0
		left_ear="Static Earring",																--0
		right_ear="Etiolation Earring",															--0/3
		left_ring="Gelatinous Ring +1",															--7/-1
		right_ring="Defending Ring",															--10/10
		back="Moonbeam Cape",																	--5/5
        })
		-- P50/M57

    sets.idle.Town = set_combine(sets.idle.MP, {
		ammo="Ginsen",
		head="Viti. Chapeau +3",
		body={ name="Viti. Tabard +3", augments={'Enhances "Chainspell" effect',}},
		hands={ name="Viti. Gloves +3", augments={'Enhances "Phalanx II" effect',}},
		legs={ name="Viti. Tights +3", augments={'Enhances "Bio III" effect','Enhances "Blind II" effect',}},
		feet={ name="Vitiation Boots +3", augments={'Enhances "Paralyze II" effect',}},
		neck="Dls. Torque +1",
		waist="Rumination Sash",
		left_ear="Sherida Earring",
		right_ear="Telos Earring",
		left_ring="Defending Ring",
		right_ring="Kishar Ring",
		back={ name="Sucellos's Cape", augments={'STR+20','Accuracy+20 Attack+20','Weapon skill damage +10%',}},
		})
		
    sets.idle.Weak = sets.idle.DT

    sets.resting = set_combine(sets.idle, {
        main="Chatoyant Staff",
		sub="Niobid Strap",
		legs="Sagacity Lappas",
        waist="Shinjutsu-no-Obi +1",
        })
    
    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Defense Sets ------------------------------------------
    ------------------------------------------------------------------------------------------------
    
    sets.defense.PDT = sets.engaged.Hybrid 
    sets.defense.MDT = sets.engaged.Hybrid    

	------------------------------------------------------------------------------------------------
    ---------------------------------------- Special Sets ------------------------------------------
    ------------------------------------------------------------------------------------------------
	
    sets.magic_burst = { 
        head="Ea Hat", 				--6(II 6)
		body="Ea Houppelande", 		--8(II 8)
        hands="Amalric Gages +1", 	--0(II 6)
		legs="Ea Slops",			--7(II 7)
		feet="Jhakri Pigaches +2",	--7(II 0)
        neck="Mizu. Kubikazari", 	--10
        ring1="Mujin Band", 		--0(II 5)
		ring2="Locus Ring", 		--5
        }
		
	sets.magic_burst.Resistant = set_combine(sets.magic_burst, {
		body="Amalric Doublet +1",	--0
		hands="Ea Cuffs",			--5 (5)
		ear1="Digni. Earring",
		ring2="Stikini Ring",
		})	

    sets.Kiting = {legs="Carmine Cuisses +1"}
    sets.latent_refresh = {waist="Fucho-no-obi"}
	sets.Adoulin = {body="Councilor's Garb"}
    sets.MoveSpeed = {legs = "Carmine Cuisses +1"}

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

    -- 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=gear.Taeon_TA_head,
        body="Ayanmo Corazza +2",
        hands=gear.Chironic_DA_hands,
        legs=gear.Taeon_TA_legs,
        feet="Carmine Greaves +1",
		neck="Anu Torque",		
		ear1="Sherida Earring",
		ear2="Telos Earring", 
        ring1="Hetairoi Ring",
		ring2="Petrov Ring",
        waist="Windbuffet Belt +1",
		back=gear.RDM_DW_Cape,
        }
		
    sets.engaged.MidAcc = set_combine(sets.engaged, {
        ----neck="Combatant's Torque",
		ring1="Ilabrat Ring",
		head="Ayanmo Zuchetto +1",
		ear1="Cessance Earring",
		waist="Kentarch Belt +1",	
        })

    sets.engaged.HighAcc = set_combine(sets.engaged.MidAcc, {
        ammo="Amar Cluster",
		head="Aya. Zucchetto +2",
		hands="Atrophy Gloves +3",
		legs="Carmine Cuisses +1",
		feet="Aya. Gambieras +1",
		ring2="Chirich Ring",
        ----ring1="Ramuh Ring +1",
        ----ring2="Ramuh Ring +1",
        ----waist="Olseni Belt",
        })

    -- * DW3: +25% (NIN Subjob)

    -- No Magic Haste (74% DW to cap - 49DW gear required)
    sets.engaged.DW = {
		ammo="Ginsen",
		head=gear.Taeon_TA_head,
		body="Ayanmo Corazza +2",
		hands=gear.Taeon_TA_hands,
		legs="Carmine Cuisses +1",  --6
		feet=gear.Taeon_DW_feet, 	--9
		neck="Anu Torque",
		ear1="Sherida Earring",				--ear1="Eabani Earring", --4
		ear2="Suppanomimi", 		--5
		ring1="Hetairoi Ring",
		ring2="Haverton Ring",		--5
		waist="Shetal Stone", 		--6		--waist="Reiki Yotai", --7
		back=gear.RDM_DW_Cape, 		--10
		} --DW41/49

    sets.engaged.DW.MidAcc = set_combine(sets.engaged.DW, {
        ----neck="Combatant's Torque",
        ring1="Ilabrat Ring",
		ear1="Telos Earring",
        }) --DW41/49

    sets.engaged.DW.HighAcc = set_combine(sets.engaged.DW.MidAcc, {
		head="Aya. Zucchetto +2",
		waist="Kentarch Belt +1",
		ring1="Chirich Ring",
        }) --DW35/49

    -- 15% Magic Haste (67% DW to cap - 42DW gear required)
    sets.engaged.DW.LowHaste = {
		ammo="Ginsen",
        head=gear.Taeon_TA_head,
        body="Ayanmo Corazza +2",
        hands=gear.Taeon_TA_hands,
		legs="Carmine Cuisses +1", 	--6
        feet=gear.Taeon_DW_feet, 	--9
		neck="Anu Torque",
		ear1="Sherida Earring",				--ear1="Eabani Earring", --4
        ear2="Suppanomimi", 		--5
		ring1="Hetairoi Ring",
		ring2="Haverton Ring",		--5
		waist="Shetal Stone", 		--6		--waist="Reiki Yotai", --7
		back=gear.RDM_DW_Cape, 		--10
        } --DW41/42


    sets.engaged.DW.MidAcc.LowHaste = set_combine(sets.engaged.DW.LowHaste, {
        ----neck="Combatant's Torque",
        ring1="Ilabrat Ring",
		ear1="Telos Earring",
        }) --DW43/42

    sets.engaged.DW.HighAcc.LowHaste = set_combine(sets.engaged.DW.MidAcc.LowHaste, {
		head="Aya. Zucchetto +2",
		waist="Kentarch Belt +1",
		ear1="Telos Earring",
		ring2="Chirich Ring",		
        }) --DW37/42

    -- 30% Magic Haste (56% DW to cap - 31DW gear required)
    sets.engaged.DW.MidHaste = {
        --hands=gear.Taeon_TA_hands,
		ammo="Ginsen",
        head=gear.Taeon_TA_head,
        body="Ayanmo Corazza +2",
		hands=gear.Taeon_TA_hands,
		legs=gear.Taeon_TA_legs,
        feet=gear.Taeon_DW_feet, 	--9
		neck="Anu Torque",
		ear1="Sherida Earring",		--ear1="Dedition Earring",
        ear2="Suppanomimi", 		--5
		ring1="Ilabrat Ring",
		ring2="Hetairoi Ring",
		waist="Shetal Stone", 		--6		--waist="Reiki Yotai", --7
		back=gear.RDM_DW_Cape,		--10
        } --DW30/31

    sets.engaged.DW.MidAcc.MidHaste = set_combine(sets.engaged.DW.MidHaste, {
        neck="Clotharius Torque", ----neck="Combatant's Torque", ou Lissome Necklace
        ear1="Cessance Earring",
		}) --DW30/31

    sets.engaged.DW.HighAcc.MidHaste = set_combine(sets.engaged.DW.MidAcc.MidHaste, {
		head="Aya. Zucchetto +2",
		hands="Atrophy Gloves +3",
		legs="Carmine Cuisses +1", 	--(+6)
		ear1="Telos Earring",
		ring2="Chirich Ring",
        waist="Kentarch Belt +1",	--(-6)
        }) --DW25/31

    -- 35% Magic Haste (51% DW to cap - 26DW gear required)
    sets.engaged.DW.HighHaste = sets.engaged.DW.MidHaste 
    sets.engaged.DW.MidAcc.HighHaste = sets.engaged.DW.MidAcc.MidHaste
    sets.engaged.DW.HighAcc.HighHaste = sets.engaged.DW.HighAcc.MidHaste

    -- 47% Magic Haste (36% DW to cap  - 11DW gear required)
	sets.engaged.DW.MaxHaste = set_combine(sets.engaged, {
        ammo="Ginsen",
        head=gear.Taeon_TA_head,
        body="Ayanmo Corazza +2",
		hands=gear.Taeon_TA_hands,
        legs=gear.Taeon_TA_legs,
        feet="Carmine Greaves +1",
        neck="Anu Torque",
		ear1="Sherida Earring",
        ear2="Telos Earring", 			--ear2="Dedition Earring",		
		ring1="Ilabrat Ring",
		ring2="Hetairoi Ring",
		waist="Windbuffet Belt +1",
		back=gear.RDM_DW_Cape,			--10		
        }) --DW10/11
    
    sets.engaged.DW.MidAcc.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, {
		head="Aya. Zucchetto +2",
		ear2="Telos Earring", 
		waist="Kentarch Belt +1",
        }) --DW10/11

    sets.engaged.DW.HighAcc.MaxHaste = set_combine(sets.engaged.DW.MidAcc.MaxHaste, {
		hands="Atrophy Gloves +3",
		legs="Carmine Cuisses +1", 		--(+6)
		--neck="Combatant's Torque",    
		ear1="Mache Earring +1",
		ring2="Chirich Ring",
        }) --DW16/11


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

	-- Assuming Shell V is on (24% MDT)
    sets.engaged.Hybrid = {
		ammo="Staunch Tathlum", 		--2/2
		head="Ayanmo Zuchetto +1",		--2/2
		body="Ayanmo Corazza +2",		--5/5
		--hands=gear.Taeon_DW_hands,				-- DW(5)		
		legs="Carmine Cuisses +1",				-- DW(6)
		feet="Carmine Greaves +1",
		neck="Loricate Torque +1", 		--6/6
		ear1="Suppanomimi", 					-- DW(5)
		ear2="Etiolation Earring", 		--0/3			
        ring1="Gelatinous Ring +1", 	--7/-1		
		ring2="Defending Ring", 		--10/10
        back="Moonbeam Cape", 			--5/5
        waist="Flume Belt", 			--4/0		
        }
		--41/50

    sets.engaged.DT = set_combine(sets.engaged, sets.engaged.Hybrid)
    sets.engaged.MidAcc.DT = set_combine(sets.engaged.MidAcc, sets.engaged.Hybrid)
    sets.engaged.HighAcc.DT = set_combine(sets.engaged.HighAcc, sets.engaged.Hybrid)

    --sets.engaged.DW.DT.LowHaste = set_combine(sets.engaged.DW.LowHaste, sets.engaged.Hybrid)
    --sets.engaged.DW.MidAcc.DT.LowHaste = set_combine(sets.engaged.DW.MidAcc.LowHaste, sets.engaged.Hybrid)
	--sets.engaged.DW.HighAcc.DT.LowHaste = set_combine(sets.engaged.DW.HighAcc.LowHaste, sets.engaged.Hybrid)

    --sets.engaged.DW.DT.MidHaste = set_combine(sets.engaged.DW.MidHaste, sets.engaged.Hybrid)
    --sets.engaged.DW.MidAcc.DT.MidHaste = set_combine(sets.engaged.DW.MidAcc.MidHaste, sets.engaged.Hybrid)
	--sets.engaged.DW.HighAcc.DT.MidHaste = set_combine(sets.engaged.DW.HighAcc.MidHaste, sets.engaged.Hybrid)

    --sets.engaged.DW.DT.HighHaste = set_combine(sets.engaged.DW.HighHaste, sets.engaged.Hybrid)
    --sets.engaged.DW.MidAcc.DT.HighHaste = set_combine(sets.engaged.DW.MidAcc.HighHaste, sets.engaged.Hybrid)
	--sets.engaged.DW.HighAcc.DT.HighHaste = set_combine(sets.engaged.DW.HighAcc.HighHaste, sets.engaged.Hybrid)

    --sets.engaged.DW.DT.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, sets.engaged.Hybrid)
    --sets.engaged.DW.MidAcc.DT.MaxHaste = set_combine(sets.engaged.DW.MidAcc.MaxHaste, sets.engaged.Hybrid)
	--sets.engaged.DW.HighAcc.DT.MaxHaste = set_combine(sets.engaged.DW.HighAcc.MaxHaste, sets.engaged.Hybrid)


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

    sets.buff.Doom = {ring1="Saida Ring", ring2="Saida Ring", waist="Gishdubar Sash"}	--eshmun ring x2 HQ
	sets.Obi = {waist="Hachirin-no-Obi"}
    sets.CP = {back="Mecisto. Mantle"}
	sets.Reive = {neck="Ygnas's Resolve +1"}

end

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

function job_precast(spell, action, spellMap, eventArgs)
    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 spell.name == 'Impact' then
        equip(sets.precast.FC.Impact)
    end
    if spell.english == "Phalanx II" and spell.target.type == 'SELF' then
        cancel_spell()
        send_command('@input /ma "Phalanx" <me>')
    end
end

function job_midcast(spell, action, spellMap, eventArgs)
    if spell.skill == 'Enfeebling Magic' then
        if enfeebling_magic_skill:contains(spell.english) or enfeebling_magic_effect:contains(spell.english) then
            if spell.type == "WhiteMagic" then
                equip(sets.midcast.MndEnfeeblesAcc)
            else
                equip(sets.midcast.IntEnfeeblesAcc)
            end
        end
    end
end

-- Run after the default midcast() is done.
-- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
function job_post_midcast(spell, action, spellMap, eventArgs)
    if spell.skill == 'Enfeebling Magic' then
        if enfeebling_magic_skill:contains(spell.english) then
            equip(sets.midcast.SkillEnfeebles)
        elseif enfeebling_magic_effect:contains(spell.english) then
            equip(sets.midcast.EffectEnfeebles)
        end
        if state.Buff.Saboteur then
            equip(sets.buff.Saboteur)
        end
    end
    if spell.skill == 'Enhancing Magic' then
        if classes.NoSkillSpells:contains(spell.english) then
            equip(sets.midcast.EnhancingDuration)
            if spellMap == 'Refresh' then
                equip(sets.midcast.Refresh)
                if spell.target.type == 'SELF' then
                    equip (sets.midcast.RefreshSelf)
                end
            end
        elseif skill_spells:contains(spell.english) then
            equip(sets.midcast.EnhancingSkill)
        elseif spell.english:startswith('Gain') then
            equip(sets.midcast.GainSpell)
        end
        if (spell.target.type == 'PLAYER' or spell.target.type == 'NPC') and buffactive.Composure then
            equip(sets.buff.ComposureOther)
        end
    end
    if spellMap == 'Cure' and spell.target.type == 'SELF' then
        equip(sets.midcast.CureSelf)
    end
    if spell.skill == 'Elemental Magic' then
        if state.MagicBurst.value and spell.english ~= 'Death' then
            equip(sets.magic_burst)
            if spell.english == "Impact" then
                equip(sets.midcast.Impact)
            end
        end
        if (spell.element == world.day_element or spell.element == world.weather_element) then
            equip(sets.Obi)
        end
    end
end

function job_aftercast(spell, action, spellMap, eventArgs)
    if not spell.interrupted then
        if spell.english == "Sleep II" then
            send_command('@timers c "Sleep II ['..spell.target.name..']" 90 down spells/00259.png')
        elseif spell.english == "Sleep" or spell.english == "Sleepga" then -- Sleep & Sleepga Countdown --
            send_command('@timers c "Sleep ['..spell.target.name..']" 60 down spells/00253.png')
        elseif spell.english == "Break" then
            send_command('@timers c "Break ['..spell.target.name..']" 30 down spells/00255.png')
        end
    end
end

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

function job_buff_change(buff,gain)

    -- If we gain or lose any haste buffs, adjust which gear set we target.
    if S{'haste', 'march', 'mighty guard', 'embrava', 'haste samba', 'geo-haste', 'indi-haste'}:contains(buff:lower()) then
        determine_haste_group()
        if not midaction() then
            handle_equipping_gear(player.status)
        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
	if buff == "terror" then
        if gain then           
            equip(sets.idle.DT)
			send_command('@input /p Im Terrorised.')
                    else
            handle_equipping_gear(player.status)
        end
    end
		if buff == "petrification" then
        if gain then           
            equip(sets.idle.DT)
			send_command('@input /p Im Petrified')
                    else
            handle_equipping_gear(player.status)
        end
    end
		if buff == "sleep" then
        if gain then           
            equip(sets.idle.DT)
			send_command('@input /p zzZzzz')
                    else
            handle_equipping_gear(player.status)
        end
    end
		if buff == "stun" then
        if gain then           
            equip(sets.idle.DT)
                    else
            handle_equipping_gear(player.status)
        end
    end
end

-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
    if state.WeaponLock.value == true then
        disable('main','sub')
    else
        enable('main','sub')
    end
end

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

-- Called for direct player commands.
function job_self_command(cmdParams, eventArgs)
    if cmdParams[1]:lower() == 'scholar' then
        handle_strategems(cmdParams)
        eventArgs.handled = true
    elseif cmdParams[1]:lower() == 'nuke' then
        handle_nuking(cmdParams)
        eventArgs.handled = true
    end
end

-- Custom spell mapping.
function job_get_spell_map(spell, default_spell_map)
    if spell.action_type == 'Magic' then
        if default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
            if (world.weather_element == 'Light' or world.day_element == 'Light') then
                return 'CureWeather'
            end
        end
        if spell.skill == 'Enfeebling Magic' then
            if spell.type == "WhiteMagic" then
                if  enfeebling_magic_effect:contains(spell.english) then
                    return "EffectEnfeebles"
                elseif not enfeebling_magic_skill:contains(spell.english) then
                    if enfeebling_magic_acc:contains(spell.english) and not buffactive.Stymie then
                        return "MndEnfeeblesAcc"
                    else
                        return "MndEnfeebles"
                    end
                end
            elseif spell.type == "BlackMagic" then
                if  enfeebling_magic_effect:contains(spell.english) then
                    return "EffectEnfeebles"
                elseif not enfeebling_magic_skill:contains(spell.english) then
                    if enfeebling_magic_acc:contains(spell.english) and not buffactive.Stymie then
                        return "IntEnfeeblesAcc"
                    else
                        return "IntEnfeebles"
                    end
                end
            else
                return "MndEnfeebles"
            end
        end
    end
end

-- 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_update(cmdParams, eventArgs)
    update_offense_mode()
end

-- Modify the default idle set after it was constructed.
function customize_idle_set(idleSet)
    if player.mpp < 51 then
        idleSet = set_combine(idleSet, sets.latent_refresh)
     elseif state.CP.current == 'on' then
        equip(sets.CP)
        disable('back')
    else
        enable('back')
    end
    
    return idleSet
end

-------------------------------------------------------------
----- Function pour gérer le swap des weapons - Start -------
-------------------------------------------------------------

function job_self_command(cmdParams, eventArgs)
    if cmdParams[2] == 'WeaponSet' then
        local weaponset = state.WeaponSet.current
        change_weapons(weaponset)
    end
end

function change_weapons(weaponset)
 
    local weaponset = weaponset
    local weaponset_index = table.find(state.WeaponSet,weaponset)
    local weaponset_length = table.getn(state.WeaponSet)
 
    if weaponset_index + 1 > weaponset_length then
        weaponset = state.WeaponSet[1]
    else
        weaponset = state.WeaponSet[weaponset_index + 1]
    end
 
    send_command('gs equip sets.' ..weaponset)
 
end

-------------------------------------------------------------
----- Function pour gérer le swap des weapons - Fin ---------
-------------------------------------------------------------

-- Called by the 'update' self-command.
function job_update(cmdParams, eventArgs)
    determine_haste_group()
end

-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
    display_current_caster_state()
    eventArgs.handled = true
end

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

    msg = msg .. state.OffenseMode.value
    if state.HybridMode.value ~= 'Normal' then
        msg = msg .. '/' .. state.HybridMode.value
    end
    msg = msg .. ' ][ WS: ' .. state.WeaponskillMode.value .. ' ]'

	
    if state.DefenseMode.value ~= 'None' then
        msg = msg .. '[ Defense: ' .. state.DefenseMode.value .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ' ]'
    end

    if state.IdleMode.value ~= 'None' then
        msg = msg .. '[ Idle: ' .. state.IdleMode.value .. ' ]'
    end

	
    if state.Kiting.value then
        msg = msg .. '[ Kiting Mode: ON ]'
    end

    add_to_chat(060, msg)

    eventArgs.handled = true
end

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

function determine_haste_group()

    -- Gearswap can't detect the difference between Haste I and Haste II
    -- so use winkey-H to manually set Haste spell level.

    -- Haste (buffactive[33]) - 15%
    -- Haste II (buffactive[33]) - 30%
    -- Haste Samba - 5~10%
    -- Honor March - 12~16%
    -- Victory March - 15~28%
    -- Advancing March - 10~18%
    -- Embrava - 25%
    -- Mighty Guard (buffactive[604]) - 15%
    -- Geo-Haste (buffactive[580]) - 30~40%

    classes.CustomMeleeGroups:clear()

    if state.CombatForm.value == 'DW' then
        if(((buffactive[33] or buffactive[580] or buffactive.embrava) and (buffactive.march or buffactive[604])) or
            (buffactive[33] and (buffactive[580] or buffactive.embrava)) or
            (buffactive.march == 2 and buffactive[604]) or buffactive.march == 3) or buffactive[580] == 2 then
            add_to_chat(122, 'Magic Haste Level: 43%')
            classes.CustomMeleeGroups:append('MaxHaste')
        elseif ((buffactive[33] or buffactive.march == 2 or buffactive[580]) and buffactive['haste samba']) then
            add_to_chat(122, 'Magic Haste Level: 35%')
            classes.CustomMeleeGroups:append('HighHaste')
        elseif ((buffactive[580] or buffactive[33] or buffactive.march == 2) or
            (buffactive.march == 1 and buffactive[604])) then
            add_to_chat(122, 'Magic Haste Level: 30%')
            classes.CustomMeleeGroups:append('MidHaste')
        elseif (buffactive.march == 1 or buffactive[604]) then
            add_to_chat(122, 'Magic Haste Level: 15%')
            classes.CustomMeleeGroups:append('LowHaste')
        end
    end
end

-- General handling of strategems in an Arts-agnostic way.
-- Format: gs c scholar <strategem>

function handle_strategems(cmdParams)
    -- cmdParams[1] == 'scholar'
    -- cmdParams[2] == strategem to use

    if not cmdParams[2] then
        add_to_chat(123,'Error: No strategem command given.')
        return
    end
    local strategem = cmdParams[2]:lower()

    if strategem == 'light' then
        if buffactive['light arts'] then
            send_command('input /ja "Addendum: White" <me>')
        elseif buffactive['addendum: white'] then
            add_to_chat(122,'Error: Addendum: White is already active.')
        else
            send_command('input /ja "Light Arts" <me>')
        end
    elseif strategem == 'dark' then
        if buffactive['dark arts'] then
            send_command('input /ja "Addendum: Black" <me>')
        elseif buffactive['addendum: black'] then
            add_to_chat(122,'Error: Addendum: Black is already active.')
        else
            send_command('input /ja "Dark Arts" <me>')
        end
    elseif buffactive['light arts'] or buffactive['addendum: white'] then
        if strategem == 'cost' then
            send_command('input /ja Penury <me>')
        elseif strategem == 'speed' then
            send_command('input /ja Celerity <me>')
        elseif strategem == 'aoe' then
            send_command('input /ja Accession <me>')
        elseif strategem == 'addendum' then
            send_command('input /ja "Addendum: White" <me>')
        else
            add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
        end
    elseif buffactive['dark arts']  or buffactive['addendum: black'] then
        if strategem == 'cost' then
            send_command('input /ja Parsimony <me>')
        elseif strategem == 'speed' then
            send_command('input /ja Alacrity <me>')
        elseif strategem == 'aoe' then
            send_command('input /ja Manifestation <me>')
        elseif strategem == 'addendum' then
            send_command('input /ja "Addendum: Black" <me>')
        else
            add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
        end
    else
        add_to_chat(123,'No arts has been activated yet.')
    end
end

function update_offense_mode()  
    if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
        state.CombatForm:set('DW')
    else
        state.CombatForm:reset()
    end
end

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

function set_lockstyle()
    send_command('wait 2; input /lockstyleset 77')
end
 Shiva.Spynx
Offline
Server: Shiva
Game: FFXI
user: auron86
Posts: 369
By Shiva.Spynx 2019-08-28 09:21:53
Link | Quote | Reply
 
Your problem is on line 1139:
Code
if classes.NoSkillSpells:contains(spell.english) then

In the default Mote libraries, NoSkillSpells only contains the base spell tier ('Refresh' and not 'Refresh II' or 'Refresh III')

You should be able to fix the problem by replacing that line with
Code
if classes.NoSkillSpells:contains(spell.english) or classes.NoSkillSpells:contains(spellMap) then 

This will make additional refresh tiers as well as all the other NoSkillSpells (including those not having a spellMap such as Sneak/Invisible) enter in that condition.
[+]
 Valefor.Gorns
Offline
Server: Valefor
Game: FFXI
user: Gorns
Posts: 159
By Valefor.Gorns 2019-08-28 11:09:30
Link | Quote | Reply
 
Thank you Spynx.
Gonna fix that
necroskull Necro Bump Detected! [406 days between previous and next post]
 Ragnarok.Obijam
Offline
Server: Ragnarok
Game: FFXI
user: obijam
Posts: 2
By Ragnarok.Obijam 2020-10-07 03:11:02
Link | Quote | Reply
 
This 100% worked. Thank you Spynx! that was driving me crazy.
Log in to post.