Gearswap Support Thread

言語: JP EN DE FR
2010-06-21
New Items
users online
フォーラム » Windower » Support » Gearswap Support Thread
Gearswap Support Thread
First Page 2 3 ... 92 93 94 ... 182 183 184
 Carbuncle.Doryll
Offline
サーバ: Carbuncle
Game: FFXI
user: Smacks
By Carbuncle.Doryll 2016-03-05 15:35:37  
Hello, i have a request please.

I'm working on my lua BLM, i want to add a Cycle for use(or not) the AF Body during my nukes. I have 1 cycle already in CastingMode (Normal or MagicBurst) and i know than i could add 2 variables in for what i want (Normal, Magicburst, NormalBodyAF, MagicBurstBodyAF) but it's not very pleasant to use....

So i would prefer to add a new cycle for choosing if i use the AFBody or not. I tried this :
state.OffenseModeptions('Normal', 'None')
state.CastingModeptions('Normal', 'MagicBurst')
state.EquipBodyAFptions('BodyAF', 'AmalricBody')
state.IdleModeptions('Normal', 'PDT')
state.PhysicalDefenseModeptions('PDT')
state.MagicalDefenseModeptions('MDT')

I added " send_command('bind f3 gs c cycle EquipBodyAF')" in Mote-Globals and
" state.EquipBodyAF = M{['description'] = 'EquipBodyAF'}" in Mote-include

i created a set for using it : sets.midcast['Elemental Magic'].HighTierNuke.AmalricBody = set_combine( sets.midcast['Elemental Magic'].HighTierNuke, {body="Amalric Doublet +1"} )


My problem is that when i cast HightierNuke, my body doesn't switch, it seems that GS doesn't recognize the set when i cast

If you can help me, thanks a lot.
Offline
Posts: 40
By Isilrhofal 2016-03-05 17:59:56  
How about something like this?
you would still need to change my MB stuff (which doesn't work yet as I want it to):
Quote:
if state.MagicBurst == "tmp" or state.MagicBurst == "Perma" then
Offline
Posts: 40
By Isilrhofal 2016-03-05 18:09:28  
Maybe anyone here tried this already and got this working.
I am trying to set a variable once a skillchain has been made which is valid for about 5-6 seconds. When the gearswap is midcast I would check this variable and set MB gear or not. (For the lazy BLM in a 'non MB Focused' party.) My problem however is resetting the variable again properly after it has been set, so it works once but fails after.

My current code for this would be:
 Asura.Cair
VIP
Offline
サーバ: Asura
Game: FFXI
user: Minjo
Posts: 246
By Asura.Cair 2016-03-05 18:14:31  
Your best bet would be looking into how battlemod handles displaying skillchain damage, honestly. You could probably even write it right into BattleMod itself if you were inclined.
Offline
Posts: 40
By Isilrhofal 2016-03-05 18:26:32  
Getting the Skillchain types and matching it with the Spells cast works fine. The only thing which doesn't work is that reset where I reset the MB true/false value.
windower.send_command('@wait 6; lua i ResetSetting reset_sc')

It seems that I am missing some lua logic here in order to get it to work.

Edit: Some spelling mistakes, it's late.
Offline
Posts: 7
By Avechu 2016-03-05 20:02:29  
Is there something that checks what spells you have set on BLU?

Want to add something like: If MagicFruit is not set cast PleniluneEmbrace, and if thats not set cast Restoral, and just keep it going down the line until it hits something that is set.
Offline
Posts: 2
By Kingsleu 2016-03-05 20:20:51  
Hello, my BLM script seems to have stopped working after I edited my gear earlier today. It doesn't change my gear to the midcast sets and immediately equips my aftercast sets. Could someone help me find out what happened?

Edit: Sorry I should have mentioned what was happening. Whenever I do an action it instantly loads my precast, midcast and aftercast all at the same time.

Code:

-------------------------------------------------------------------------------------------------------------------
-- 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()

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('None', 'Normal')
state.CastingMode:options('Normal', 'Resistant', 'Proc')
state.IdleMode:options('Normal', 'PDT')

state.MagicBurst = M(false, 'Magic Burst')

lowTierNukes = S{'Stone', 'Water', 'Aero', 'Fire', 'Blizzard', 'Thunder',
'Stone II', 'Water II', 'Aero II', 'Fire II', 'Blizzard II', 'Thunder II',
'Stone III', 'Water III', 'Aero III', 'Fire III', 'Blizzard III', 'Thunder III',
'Stonega', 'Waterga', 'Aeroga', 'Firaga', 'Blizzaga', 'Thundaga',
'Stonega II', 'Waterga II', 'Aeroga II', 'Firaga II', 'Blizzaga II', 'Thundaga II'}

gear.macc_hagondes = {name="Hagondes Cuffs", augments={'Phys. dmg. taken -3%','Mag. Acc.+29'}}

-- Additional local binds
send_command('bind ^` input /ma Stun <t>')
send_command('bind @` gs c activate MagicBurst')

select_default_macro_book()
end

-- Called when this job file is unloaded (eg: job change)
function user_unload()
send_command('unbind ^`')
send_command('unbind @`')
end


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

---- Precast Sets ----

-- Precast sets to enhance JAs
sets.precast.JA['Mana Wall'] = {feet="Wicce Sabots"}

sets.precast.JA.Manafont = {body="Archmage's Coat"}

-- equip to maximize HP (for Tarus) and minimize MP loss before using convert
sets.precast.JA.Convert = {}


-- Fast cast sets for spells

sets.precast.FC = {ammo="Impatiens",
head="Merlinic Hood",ear2="Loquacious Earring",
body="Helios Jacket",hands="Helios Gloves",ring1="Lebeche Ring",ring2="Weatherspoon Ring",
back="Swith Cape",waist="Witful Belt",legs="Psycloth Lappas",feet="Regal Pumps +1"}

sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})

sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {head="Wicce Petasos", neck="Stoicheion Medal", feet="Spaekona's Sabots +1"})

sets.precast.FC.Cure = set_combine(sets.precast.FC, {main="Serenity", body="Heka's Kalasiris", back="Pahtli Cape"})

sets.precast.FC.Curaga = sets.precast.FC.Cure

-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {
head="Hagondes Hat +1",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Hagondes Coat +1",hands="Hagondes Cuffs +1",ring1="Rajas Ring",ring2="Icesoul Ring",
back="Refraction Cape",waist="Cognition Belt",legs="Hagondes Pants +1",feet="Hagondes Sabots +1"}

-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS['Vidohunir'] = {ammo="Ghastly Tathlum",
head="Merlinic Hood",neck="Serenity Necklace",ear1="Crematio Earring",ear2="Friomisi Earring",
body="Witching Robe",hands="Helios Gloves",ring1="Shiva Ring +1",ring2="Shiva Ring +1",
back="Toro Cape",waist="Fotia Belt",legs="Merlinic Shalwar",feet="Helios Boots"}


---- Midcast Sets ----

sets.midcast.FastRecast = {
head="Merlinic Hood",ear2="Loquacious Earring",
body="Helios Jacket",hands="Helios Gloves",ring1="Lebeche Ring",ring2="Weatherspoon Ring",
back="Swith Cape",waist="Witful Belt",legs="Psycloth Lappas",feet="Regal Pumps +1"}

sets.midcast.Cure = {main="Serenity",sub="Oneiros Grip",
head="Merlinic Hood",neck="Phalaina Locket",ear1="Mendicant's Earring",ear2="Loquacious Earring",
body="Heka's Kalasiris",hands="Helios Gloves",ring1="Lebeche Ring",ring2="Weatherspoon Ring",
back="Pahtli Cape",waist=gear.ElementalObi,legs="Gyve Trousers",feet="Medium's Sabots"}

sets.midcast.Curaga = sets.midcast.Cure

sets.midcast['Enhancing Magic'] = {
neck="Jeweled Collar",
body="Telchine Chasuble",hands="Helios Gloves",
legs="Gyve Trousers"}

sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {head="Umuthi Hat",waist="Siegel Sash"})

sets.midcast['Enfeebling Magic'] = {main="Keraunos",sub="Mephitis Grip",ammo="Hydrocera",
head="Nahtirah Hat",neck="Sanctity Necklace",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Ischemia Chasu.",hands="Lurid Mitts",ring1="Weatherspoon Ring",ring2="Sangoma Ring",
back="Bane Cape",legs="Psycloth Lappas",feet="Medium's Sabots"}

sets.midcast.ElementalEnfeeble = sets.midcast['Enfeebling Magic']

sets.midcast['Dark Magic'] = {main="Rubicundity",sub="Genbu's Shield",ammo="Impatiens",
head="Pixie Hairpin +1",neck="Jeweled Collar",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Helios Jacket",hands="Archmage's Gloves",ring1="Archon Ring",ring2="Weatherspoon Ring",
back="Bane Cape",waist="Witful Belt",legs="Spaekona's Tonban +1",feet="Wicce Sabots"}

sets.midcast.Drain = {main="Rubicundity",sub="Genbu's Shield",ammo="Impatiens",
head="Pixie Hairpin +1",neck="Aesir Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Helios Jacket",hands="Archmage's Gloves",ring1="Archon Ring",ring2="Weatherspoon Ring",
back="Bane Cape",waist="Fucho-no-Obi",legs="Spaekona's Tonban +1",feet="Wicce Sabots"}

sets.midcast.Aspir = sets.midcast.Drain

sets.midcast.Stun = {main="Keraunos",sub="Mephitis Grip",ammo="Impatiens",
head="Merlinic Hood",neck="Jeweled Collar",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Helios Jacket",hands="Helios Gloves",ring1="Prolix Ring",ring2="Weatherspoon Ring",
back="Swith Cape",waist="Witful Belt",legs="Psycloth Lappas",feet="Regal Pumps +1"}

sets.midcast.BardSong = {main="Keraunos",sub="Mephitis Grip",ammo="Impatiens",
head="Nahtirah Hat",neck="Sanctity Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Helios Jacket",hands="Helios Gloves",ring1="Weatherspoon Ring",ring2="Sangoma Ring",
back="Bane Cape",legs="Psycloth Lappas",feet="Helios Boots"}


-- Elemental Magic sets

sets.midcast['Elemental Magic'] = {main="Keraunos",sub="Niobid Strap",ammo="Ghastly Tathlum",
head="Merlinic Hood",neck="Sanctity Necklace",ear1="Crematio Earring",ear2="Friomisi Earring",
body="Spaekona's Coat +1",hands="Helios Gloves",ring1="Shiva Ring +1",ring2="Shiva Ring +1",
back="Toro Cape",waist=gear.ElementalObi,legs="Merlinic Shalwar",feet="Helios Boots"}

sets.midcast['Elemental Magic'].Resistant = {main="Keraunos",sub="Niobid Strap",ammo="Ghastly Tathlum",
head="Merlinic Hood",neck="Sanctity Necklace",ear1="Crematio Earring",ear2="Friomisi Earring",
body="Psycloth Vest",hands="Helios Gloves",ring1="Shiva Ring +1",ring2="Shiva Ring +1",
back="Bane Cape",waist=gear.ElementalObi,legs="Merlinic Shalwar",feet="Helios Boots"}

sets.midcast['Elemental Magic'].HighTierNuke = set_combine(sets.midcast['Elemental Magic'], {sub="Niobid Strap"})
sets.midcast['Elemental Magic'].HighTierNuke.Resistant = set_combine(sets.midcast['Elemental Magic'], {sub="Niobid Strap"})


-- Minimal damage gear for procs.
sets.midcast['Elemental Magic'].Proc = {main="Earth Staff", sub="Mephitis Grip",ammo="Impatiens",
head="Nahtirah Hat",neck="Twilight Torque",ear1="Bloodgem Earring",ear2="Loquacious Earring",
body="Ischemia Chasuble",hands="Serpentes Cuffs",ring1="Sheltered Ring",ring2="Paguroidea Ring",
back="Swith Cape",waist="Witful Belt",legs="Nares Trews",feet="Regal Pumps +1"}



-- Sets to return to when not performing an action.

-- Resting sets
sets.resting = {main="Keraunos",sub="Niobid Strap",ammo="Hydrocera",
neck="Sanctity Necklace",
body="Respite Cloak",hands="Serpentes Cuffs",ring1="Sheltered Ring",ring2="Paguroidea Ring",
waist="Fucho-no-Obi",legs="Assiduity Pants +1",feet="Herald's Gaiters"}


-- Idle sets

-- Normal refresh idle set
sets.idle = {main="Keraunos",sub="Niobid Strap",ammo="Impatiens",
neck="Sanctity Necklace",ear1="Mendicant's Earring",ear2="Loquacious Earring",
body="Respite Cloak",hands="Serpentes Cuffs",ring1="Sheltered Ring",ring2="Paguroidea Ring",
back="Umbra Cape",waist="Fucho-no-Obi",legs="Assiduity Pants +1",feet="Herald's Gaiters"}

-- Idle mode that keeps PDT gear on, but doesn't prevent normal gear swaps for precast/etc.
sets.idle.PDT = {main="Terra's Staff", sub="Oneiros Grip",ammo="Impatiens",
head="Hagondes Hat +1",neck="Twilight Torque",ear1="Mendicant's Earring",ear2="Loquacious Earring",
body="Hagondes Coat",hands="Hagondes Cuffs +1",ring1="Defending Ring",ring2="Dark Ring",
back="Umbra Cape",waist="Fucho-no-Obi",legs="Hagondes Pants +1",feet="Herald's Gaiters"}

-- Idle mode scopes:
-- Idle mode when weak.
sets.idle.Weak = {main="Terra's Staff",sub="Oneiros Grip",ammo="Impatiens",
head="Hagondes Hat +1",neck="Twilight Torque",ear1="Mendicant's Earring",ear2="Loquacious Earring",
body="Hagondes Coat +1",hands="Hagondes Cuffs +1",ring1="Defending Ring",ring2="Paguroidea Ring",
back="Umbra Cape",waist="Fucho-no-Obi",legs="Assiduity Pants +1",feet="Hagondes Sabots +1"}

-- Town gear.
sets.idle.Town = {main="Keraunos", sub="Niobid Strap",ammo="Impatiens",
neck="Sanctity Necklace",ear1="Mendicant's Earring",ear2="Loquacious Earring",
body="Respite Cloak",hands="Serpentes Cuffs",ring1="Sheltered Ring",ring2="Paguroidea Ring",
back="Umbra Cape",waist="Fucho-no-Obi",legs="Assiduity Pants +1",feet="Herald's Gaiters"}

-- Defense sets

sets.defense.PDT = {main="Terra's Staff",sub="Oneiros Grip",
head="Hagondes Hat +1",neck="Twilight Torque",
body="Hagondes Coat +1",hands="Hagondes Cuffs +1",ring1="Defending Ring",ring2="Dark Ring",
back="Umbra Cape",waist="Fucho-no-obi",legs="Hagondes Pants +1",feet="Hagondes Sabots +1"}

sets.defense.MDT = {ammo="Ghastly Tathlum",
head="Hagondes Hat +1",neck="Twilight Torque",
body="Hagondes Coat +1",hands="Hagondes Cuffs +1",ring1="Defending Ring",ring2="Dark Ring",
back="Solemnity Cape",waist="Fucho-no-Obi",legs="Hagondes Pants +1",feet="Hagondes Sabots +1"}

sets.Kiting = {feet="Herald's Gaiters"}

sets.latent_refresh = {waist="Fucho-no-obi"}

-- Buff sets: Gear that needs to be worn to actively enhance a current player buff.

sets.buff['Mana Wall'] = {feet="Wicce Sabots"}

sets.magic_burst = {neck="Mizukage-no-Kubikazari"}

-- 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

-- Normal melee group
sets.engaged = {
head="Hagondes Hat +1",neck="Twilight Torque",ear1="Ethereal Earring",ear2="Cessance Earring",
body="Hagondes Coat +1",hands="Hagondes Cuffs +1",ring1="Defending Ring",ring2="Dark Ring",
back="Umbra Cape",waist="Ninurta's Sash",legs="Hagondes Pants +1",feet="Hagondes Sabots +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)
if spellMap == 'Cure' or spellMap == 'Curaga' then
gear.default.obi_waist = "Witful Belt"
elseif spell.skill == 'Elemental Magic' then
gear.default.obi_waist = "Sekhmet Corset"
if state.CastingMode.value == 'Proc' then
classes.CustomClass = 'Proc'
end
end
end


-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
function job_midcast(spell, action, spellMap, eventArgs)

end

function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.skill == 'Elemental Magic' and state.MagicBurst.value then
equip(sets.magic_burst)
end
end

function job_aftercast(spell, action, spellMap, eventArgs)
-- Lock feet after using Mana Wall.
if not spell.interrupted then
if spell.english == 'Mana Wall' then
enable('feet')
equip(sets.buff['Mana Wall'])
disable('feet')
elseif spell.skill == 'Elemental Magic' then
state.MagicBurst:reset()
end
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)
-- Unlock feet when Mana Wall buff is lost.
if buff == "Mana Wall" and not gain then
enable('feet')
handle_equipping_gear(player.status)
end
end

-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
if stateField == 'Offense Mode' then
if newValue == 'Normal' then
disable('main','sub','range')
else
enable('main','sub','range')
end
end
end


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

-- Custom spell mapping.
function job_get_spell_map(spell, default_spell_map)
if spell.skill == 'Elemental Magic' and default_spell_map ~= 'ElementalEnfeeble' then
--[[ No real need to differentiate with current gear.
if lowTierNukes:contains(spell.english) then
return 'LowTierNuke'
else
return 'HighTierNuke'
end
--]]
end
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)
end

return idleSet
end


-- Function to display the current relevant user state when doing an update.
function display_current_job_state(eventArgs)
display_current_caster_state()
eventArgs.handled = true
end

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

-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
set_macro_page(1, 15)
end
 Asura.Cair
VIP
Offline
サーバ: Asura
Game: FFXI
user: Minjo
Posts: 246
By Asura.Cair 2016-03-05 21:49:33  
Isilrhofal said: »
Getting the Skillchain types and matching it with the Spells cast works fine. The only thing which doesn't work is that reset where I reset the MB true/false value.
windower.send_command('@wait 6; lua i ResetSetting reset_sc')

It seems that I am missing some lua logic here in order to get it to work.

Edit: Some spelling mistakes, it's late.

You have an addon called ResetSetting? Why not just use gearswap self commands to manage the variable since it's not really possible to effectively use a variable external to an addon anyway.
[+]
Offline
Posts: 40
By Isilrhofal 2016-03-06 15:51:20  
Avechu said: »
Is there something that checks what spells you have set on BLU?

Want to add something like: If MagicFruit is not set cast PleniluneEmbrace, and if thats not set cast Restoral, and just keep it going down the line until it hits something that is set.

This should work:

@Cair Never script stuff when you're tired. specifically if you have no clue what you're doing ... :D Will try this later.
 Siren.Blackroses
Offline
サーバ: Siren
Game: FFXI
Posts: 116
By Siren.Blackroses 2016-03-07 06:28:59  
Hello Folks,

I am trying to understand why the set_combine do not seem to work, or at leats do not show into showswaps, particularly for helix spells.

Secondly, I would like to make sure the Bookworm Cape and the Refocciliation Stone are equipped, even in case of magic burst mode.

Cookies reward for people willing to help!

Here is the code :
Code
	-- Define sets and vars used by this job file.
function init_gear_sets()
include('organizer-lib')
	--------------------------------------
	-- Start defining the sets
	--------------------------------------
	--GearVARS
	HoodFC={ name="Merlinic Hood", augments={'"Fast Cast"+6','Mag. Acc.+9','"Mag.Atk.Bns."+4',}}
	HoodMAB={ name="Merlinic Hood", augments={'Mag. Acc.+24 "Mag.Atk.Bns."+24','Magic Damage +10','INT+3','Mag. Acc.+12','"Mag.Atk.Bns."+15',}}
	HoodMB={ name="Merlinic Hood", augments={'"Mag.Atk.Bns."+24','Magic burst mdg.+8%','INT+12','Mag. Acc.+10',}}
	BootsFC={ name="Merlinic Crackows", augments={'"Mag.Atk.Bns."+4','"Fast Cast"+5','CHR+10','Mag. Acc.+2',}}	
	BootsMAB={ name="Merlinic Crackows", augments={'"Mag.Atk.Bns."+16','Magic burst mdg.+9%','CHR+11','Mag. Acc.+10',}}
	BootsMB={ name="Merlinic Crackows", augments={'"Mag.Atk.Bns."+16','Magic burst mdg.+9%','CHR+11','Mag. Acc.+10',}}
		
	-- Precast Sets

	-- Precast sets to enhance JAs

	sets.precast.JA['Tabula Rasa'] = {legs="Pedagogy Pants"}
	sets.precast.JA['Dark Arts'] = {body="Academic's Gown +1"}
	sets.precast.JA['Light Arts'] = {body="Academic's Pants +1"}
	sets.precast.JA['Enlightenment'] = {body="Peda. Gown +1"}
	
	organizer_items = {agown="Academic's Gown +1",
	    zod="Zodiac Ring",obi="Hachirin-no-obi",CPring="Trizeck Ring",Wring="Warp Ring",CPring2="Capacity Ring"}

	-- Fast cast sets for spells

	sets.precast.FC = {ammo="Sapience Orb",
		head=HoodFC,neck="Orunmila's Torque",ear1="",ear2="Loquacious Earring",
		body="Anhur Robe",hands="Gendewitha Gages",ring1="Prolix Ring",ring2="",
		back="Perimede Cape",waist="Witful Belt",legs="Psycloth Lappas",feet=BootsFC}

	sets.precast.FC.Cure = set_combine(sets.precast.FC, {head="",body="Heka's Kalasiris",hands="Gendewitha Gages",back="Pahtli Cape"})

	sets.precast.FC.Curaga = sets.precast.FC.Cure
	
	sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})

	sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {neck="Stoicheion Medal",ear1="Barkarole Earring"})

	sets.precast.FC.Impact = set_combine(sets.precast.FC['Elemental Magic'], {head=empty,body="Twilight Cloak"})
	-- Weaponskill sets
    -- Default set for any weaponskill that isn't any more specifically defined
    sets.precast.WS = {}

    -- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
    sets.precast.WS['Myrkr'] = {ammo="Pemphredo Tathlum",
	    head="Kaabnax Hat",neck="Sanctity Necklace",ear1="Moonshade Earring",ear2="Loquacious Earring",
		body="Merlinic Jubbah",hands="Otomi Gloves",ring1="Sangoma Ring",ring2="Bifrost Ring",
		back="Pahtli Cape",waist="Fucho-no-obi",legs="Psycloth Lappas",feet="Medium's Sabots"}


	-- Midcast Sets

	sets.midcast.FastRecast = {ammo="Incantor Stone",ring2="Prolix Ring",back="Perimede Cape"}

	-- Cure Sets
	
	sets.midcast.Cure = {main="Serenity",sub="Curatio Grip",ammo="Hydrocera",
		head="Vanya Hood",neck="Henic Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
		body="Vanya Robe",hands="Pedagogy Bracers +1",ring1="Haoma's Ring",ring2="Sirona's Ring",
		back="Tempered Cape +1",waist="Bishop's Sash",legs="Academic's Pants +1",feet="Vanya Clogs"}

	sets.midcast.CureWithLightWeather = set_combine(sets.midcast.Cure, {
		main="Chatoyant Staff",body="Gendewitha Bliaut +1",hands="Telchine Gloves",back="Twilight Cape",waist="Hachirin-no-obi"})

	sets.midcast.Curaga = sets.midcast.Cure

	sets.midcast.Regen = {main="Gada", sub="Genbu's Shield", ammo="Savant's Treatise",
	    head="Arbatel Bonnet +1",neck="Incanter's Torque",ear1="Andoaa Earring",
		body="Telchine Chas.",hands="",
		back="Perimede Cape",waist="Cascade Belt",legs="Telchine Braconi",feet="Telchine Pigaches"}
	-- Enhancing Magic Sets
	
	sets.midcast['Enhancing Magic'] = {main="Gada", sub="Genbu's Shield", ammo="Savant's Treatise",
		head="Arbatel Bonnet +1",neck="Incanter's Torque",ear1="Andoaa Earring",
		body="Telchine Chas.", back="Fi Follet Cape", waist="Cascade Belt",legs="Telchine Braconi",feet="Telchine Pigaches"}

	sets.midcast.Cursna = {
		neck="",ring1="",ring2="",feet="Gendewitha Galoshes"}

	sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {head="Umuthi Hat",neck="Nodens Gorget",
	    ear1="",waist="",legs=""})

	sets.midcast.Storm = {main="Gada", sub="Genbu's Shield", ammo="Savant's Treatise",
		head="Arbatel Bonnet +1",neck="Incanter's Torque",ear1="Andoaa Earring",
		body="Telchine Chas.", back="Fi Follet Cape", waist="Cascade Belt",legs="Telchine Braconi",feet="Telchine Pigaches"}

	sets.midcast.Protect = {ring1="Sheltered Ring"}
	sets.midcast.Protectra = sets.midcast.Protect
	sets.midcast.Shell = {ring1="Sheltered Ring"}
	sets.midcast.Shellra = sets.midcast.Shell	
	sets.midcast.Erase = sets.midcast.FastRecast


	-- Custom spell classes
	sets.midcast.MndEnfeebles = {main="Gada",sub="Genbu's Shield",ammo="Hydrocera",
		head="Amalric Coif",neck="Incanter's Torque",ear1="Barkarole Earring",ear2="Gwati Earring",
		body="Vanya Robe",hands="Amalric Gages",ring1="Vertigo Ring",ring2="Globidonta Ring",
		back="Refraction Cape",waist="Hachirin-no-obi",legs="Chironic Hose",feet="Medium's Sabots"}

	sets.midcast.IntEnfeebles = sets.midcast.MndEnfeebles

	sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
	
	sets.midcast.Kaustra = sets.midcast['Elemental Magic']

	sets.midcast['Dark Magic'] = {ammo="Hydrocera",
		head="Merlinic Hood",neck="Eddy Necklace",ear1="Barkarole Earring",ear2="Gwati Earring",
		body="Merlinic Jubbah",hands="Lurid Mitts",ring1="Weatherspoon Ring",ring2="Evanescence Ring",
		back="Bookworm's Cape",waist="Witful Belt",legs="Pedagogy Pants",feet="Medium's Sabots"}

	sets.midcast.Drain = set_combine(sets.midcast['Dark Magic'], {ammo="Incantor Stone",
		head="Pixie Hairpin +1",ear1="Hirudinea Earring",ear2="Loquacious Earring",hands="",waist="Fucho-no-obi",feet="Merlinic Crackows"})

	sets.midcast.Aspir = sets.midcast.Drain

	sets.midcast.Stun = {main="Akademos",sub="Arbuda Grip",ammo="Incantor Stone",
		head="Pedagogy Mortarboard +1",neck="Orunmila's Torque",ear1="Enchanter Earring +1",ear2="Loquac. Earring",
		body="Shango Robe",hands="Gendewitha Gages",ring1="",ring2="Prolix Ring",
		back="Perimede Cape",waist="Ninurta's Sash",legs="Psycloth Lappas",feet="Academic's Loafers +1"}

	sets.midcast.Stun.Resistant = set_combine(sets.midcast.Stun, {})


	-- Elemental Magic sets are default for handling low-tier nukes.
	sets.midcast['Elemental Magic'] = {main="Akademos",sub="Niobid Strap",ammo="Pemphredo Tathlum",
		head=HOODMAB,neck="Saevus Pendant +1",ear1="Barkarole Earring",ear2="Friomisi Earring",
		body="Merlinic Jubbah",hands="Chironic Gloves",ring1="Shiva Ring",ring2="Shiva Ring",
		back="Toro Cape",waist="Hachirin-no-obi",legs="Amalric Slops",feet=BootsMAB}

	sets.midcast['Elemental Magic'].Resistant = sets.midcast['Elemental Magic']

	-- Custom refinements for certain nuke tiers
	sets.midcast['Elemental Magic'].HighTierNuke = set_combine(sets.midcast['Elemental Magic'], {ammo="Pemphredo Tathlum",
	    main="Akademos",sub="Niobid Strap",head=HoodMAB,body="Merlinic Jubbah",hands="Chironic Gloves",legs="Merlinic Shalwar",
		back="Toro Cape",waist="Refoccilation Stone",feet="BootsMAB"})

	sets.midcast['Elemental Magic'].HighTierNuke.Resistant = set_combine(sets.midcast['Elemental Magic'].HighTierNuke, {
	    main="Akademos",sub="Niobid Strap",ammo="Pemphredo Tathlum",
	    neck="Eddy Necklace",back="Bookworm's Cape",feet="BootsMAB"})

	sets.midcast.Impact = {main="Akademos",sub="Mephitis Grip",ammo="Hydrocera",
		head=empty,neck="Eddy Necklace",ear1="Barkarole Earring",ear2="Gwati Earring",
		body="Twilight Cloak",hands="Chironic Gloves",ring1="Weatherspoon Ring",ring2="Sangoma Ring",
		back="Refraction Cape",waist="Refoccilation Stone",legs="Psycloth Lappas",feet="Medium's Sabots"}
		
	sets.midcast.Helix = set_combine(sets.midcast.HighTierNuke, {back="Bookworm's Cape",waist="Refoccilation Stone"})		
	sets.midcast.Noctohelix = set_combine(sets.midcast.Helix, {head="Pixie Hairpin +1"})		

	-- Sets to return to when not performing an action.

	-- Resting sets
	sets.resting = {main="Chatoyant Staff",sub="Mephitis Grip",
		neck="Wiglen Gorget",body="Witching Robe",hands="Serpentes Cuffs",
		ring1="Sheltered Ring",ring2="Paguroidea Ring",legs="Assiduity Pants +1",feet="Serpentes Sabots"}


	-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)

	sets.idle.Town = {main="Akademos",sub="Niobid Strap",ammo="Hydrocera",
		head="Merlinic Hood",neck="Orunmila's Torque",ear1="Enchanter Earring +1",ear2="Loquacious Earring",
		body="Merlinic Jubbah",hands="Amalric Gages",ring1="Defending Ring",ring2="Succor Ring",
		back="Bookworm's Cape",waist="Fucho-no-obi",legs="Merlinic Shalwar",feet="Herald's Gaiters"}

	sets.idle.Field = {main="Akademos",sub="Niobid Strap",ammo="Homiliary",
		head="Amalric Coif",neck="Loricate Torque +1",ear1="Enchanter Earring +1",ear2="Loquacious Earring",
		body="Amalric Doublet",hands="Serpentes Cuffs",ring1="Defending Ring",ring2="Succor Ring",
		back="Umbra Cape",waist="Fucho-no-obi",legs="Assiduity Pants +1",feet="Herald's Gaiters"}	
		
	sets.idle.PDT = {main="Bolelabunga",sub="Genbu's Shield",ammo="Incantor Stone",
		neck="Loricate Torque +1",ear1="Ethereal Earring",ring1="Defending Ring",ring2=gear.DarkRing.physical,
		body="Vanya Robe",hands="Gendewitha Gages",back="Umbra Cape",feet="Argute Loafers +2"}	

	sets.idle.Weak = sets.idle.Field
	
	-- Defense sets

	sets.defense.PDT = {main="Bolelabunga",sub="Genbu's Shield",ammo="Incantor Stone",
		head="Amalric Coif",neck="Loricate Torque +1",ear1="Ethereal Earring",
		body="Vanya Robe",hands="Gendewitha Gages",ring1="Defending Ring",ring2="Succor Ring",
		back="Umbra Cape",legs="Chironic Hose",feet="Vanya Clogs"}

	sets.defense.MDT = {
		head="Merlinic Hood",neck="Loricate Torque +1",
		body="Pedagogy Gown +1",hands="Chironic Gloves",ring1="Defending Ring",ring2="Shadow Ring",
		back="Umbra Cape",legs="Chironic Hose",feet="Arbatel Loafers +1"}

	sets.Kiting = {feet="Herald's Gaiters"}
	sets.latent_refresh = {waist="Fucho-no-obi"}

	-- 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

	-- Normal melee group
	--[[sets.engaged = {
		head="Gendewitha Caubeen +1",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
		body="Pedagogy Gown +1",hands="Lurid Mitts",ring1="Rajas Ring",ring2="Mars's Ring",
		back="Buquwik Cape",waist="Ninurta's Sash",legs="Academic's Pants +1",feet="Argute Loafers +2"}]]--



	-- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
	sets.buff['Ebullience'] = {}
	sets.buff['Rapture'] = {head="Arbatel Bonnet +1"}
	sets.buff['Perpetuance'] = {hands="Arbatel Bracers +1"}
	sets.buff['Immanence'] = {hands="Arbatel Bracers +1"}
	sets.buff['Penury'] = {legs="Arbatel Pants +1"}
	sets.buff['Parsimony'] = {legs="Arbatel Pants +1"}
	sets.buff['Celerity'] = {feet="Argute Loafers +2"}
	sets.buff['Alacrity'] = {head=HoodFC,feet="Argute Loafers +2"}
	sets.buff['Stormsurge'] = {feet="Argute Loafers +2"}
	sets.buff['Klimaform'] = {feet="Arbatel Loafers +1"}	

	sets.buff.FullSublimation = {head="Academic's Mortarboard +1",ear1="Savant's Earring",body="Pedagogy Gown +1",neck="Wiglen Gorget",ring1="Sheltered Ring",ring2="Paguroidea Ring"}
	sets.buff.PDTSublimation = {head="Academic's Mortarboard +1",ear1="Savant's Earring",body="Pedagogy Gown +1"}
	
	sets.magic_burst = {main="Akademos",sub="Niobid Strap", ammo="Pemphredo Tathlum",ear1="Barkarole Earring",ear2="Friomisi Earring",
		body="Merlinic Jubbah",head=HoodMB,neck="Mizukage-no-Kubikazari",hands="Amalric Gages",
		ring1="Mujin Band",ring2="Locus Ring",back="Seshaw Cape",waist="Refoccilation Stone",legs="Merlinic Shalwar",feet=BootsMB}
	-- Cap: 40%
    -- Akademos: 10%, Merlinic Hood: 4%, Mizukage: 10%, Locus: 5%, Seshaw: 5%, Helios Boots: 6%	= 40%

	--sets.buff['Sandstorm'] = {feet="Desert Boots"}
end
-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job.  Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------

--[[
        Custom commands:64

        Shorthand versions for each strategem type that uses the version appropriate for
        the current Arts.
		In-game macro: /console gs c scholar xxx

                                        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 power              Rapture                 Ebullience
        gs c scholar duration           Perpetuance
        gs c scholar accuracy           Altruism                Focalization
        gs c scholar enmity             Tranquility             Equanimity
        gs c scholar skillchain                                 Immanence
        gs c scholar addendum           Addendum: White         Addendum: Black
--]]



-- 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()
    info.addendumNukes = S{"Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",
        "Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}

    state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
    update_active_strategems()
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('None', 'Normal')
    state.CastingMode:options('Normal', 'Resistant')
    state.IdleMode:options('Normal', 'PDT')

    state.MagicBurst = M(false, 'Magic Burst')
	
    info.low_nukes = S{"Stone", "Water", "Aero", "Fire", "Blizzard", "Thunder", 
	                   "Stone II", "Water II", "Aero II", "Fire II", "Blizzard II", "Thunder II"}
    info.mid_nukes = S{}
    info.high_nukes = S{"Stone III", "Water III", "Aero III", "Fire III", "Blizzard III", "Thunder III",
					    "Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",
	                    "Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
	

    send_command('bind ` input /ma Stun <t>; wait 0.5; input /p Casting STUN on <t>.')
	send_command('bind ^` gs c toggle MagicBurst')
	send_command('bind !%numpad3 gs c scholar skillchain')
	send_command('bind !%numpad1 gs c scholar light')
	send_command('bind !%numpad2 gs c scholar dark')
	send_command('bind !%numpad4 gs c scholar speed')
	send_command('bind !%numpad5 gs c scholar duration')
	send_command('bind !%numpad6 gs c scholar aoe')
	
	--SelfSkillchaines Keybinds
	send_command('bind ^1 input /p Fusion Skillchain Starting now!;gs c scholar skillchain;wait 1;input /ma fire;wait 4;gs c scholar skillchain;wait 1;input /ma thunder')
	send_command('bind ^2 input /p Fragmentation Skillchain Starting now!;gs c scholar skillchain;wait 1;input /ma blizzard;wait 4;gs c scholar skillchain;wait 1;input /ma water')
	send_command('bind ^3 input /p Gravitation Skillchain Starting now!;gs c scholar skillchain;wait 1;input /ma aero;wait 4;gs c scholar skillchain;wait 1;input /ma noctohelix')
	send_command('bind ^4 input /p Distortion Skillchain Starting now!;gs c scholar skillchain;wait 1;input /ma luminohelix;wait 6;gs c scholar skillchain;wait 1;input /ma stone')
	send_command('bind ^5 input /p Scission Skillchain Starting now!;gs c scholar skillchain;wait 1;input /ma aero;wait 4;gs c scholar skillchain;wait 1;input /ma stone')
    select_default_macro_book()
end

function user_unload()
	send_command('unbind `')
	send_command('unbind ^`')
	send_command('unbind !%numpad3')
	send_command('unbind !%numpad1')
	send_command('unbind !%numpad2')
	send_command('unbind !%numpad4')
	send_command('unbind !%numpad5')
	send_command('unbind !%numpad6')
end   

-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
function job_precast(spell, action, spellMap, eventArgs)	
    if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") then
	   if buffactive.Silence then
		cancel_spell()
		send_command('input /item "Echo Drops" <me>')
       end
    end	
end		
-- Run after the general midcast() is done.
function job_post_midcast(spell, action, spellMap, eventArgs)
    if spell.action_type == 'Magic' then
        apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
    end
	if spell.element == world.day_element or spell.element == world.weather_element then
        if info.low_nukes:contains(spell.english) then 
		equip(sets.midcast['Elemental Magic'], {ring1="Zodiac Ring",back="Twilight Cape", waist="Hachirin-no-obi"})
		    elseif info.high_nukes:contains(spell.english) then
		    equip(sets.midcast['Elemental Magic'].HighTierNuke, {ring1="Zodiac Ring",back="Twilight Cape", waist="Hachirin-no-obi"})
		end
    end
	if spell.skill == 'Elemental Magic' then
        if state.MagicBurst.value then
        equip(sets.magic_burst, {waist="Hachirin-no-obi"})
        end
	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 == "Sublimation: Activated" then
        handle_equipping_gear(player.status)
    end
end

-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
    if stateField == 'Offense Mode' then
        if newValue == 'Normal' then
            disable('main','sub','range')
        else
            enable('main','sub','range')
        end
    end
end

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

-- 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' then
                return 'CureWithLightWeather'
            end
        elseif spell.skill == 'Enfeebling Magic' then
            if spell.type == 'WhiteMagic' then
                return 'MndEnfeebles'
            else
                return 'IntEnfeebles'
            end
        elseif spell.skill == 'Elemental Magic' then
            if info.low_nukes:contains(spell.english) then
                return 'LowTierNuke'
            elseif info.mid_nukes:contains(spell.english) then
                return 'MidTierNuke'
            elseif info.high_nukes:contains(spell.english) then
                return 'HighTierNuke'
            end
        end
    end
end

function customize_idle_set(idleSet)
    if state.Buff['Sublimation: Activated'] then
        if state.IdleMode.value == 'Normal' then
            idleSet = set_combine(idleSet, sets.buff.FullSublimation)
        elseif state.IdleMode.value == 'PDT' then
            idleSet = set_combine(idleSet, sets.buff.PDTSublimation)
        end
    end

    if player.mpp < 51 then
        idleSet = set_combine(idleSet, sets.latent_refresh)
    end

    return idleSet
end

-- Called by the 'update' self-command.
function job_update(cmdParams, eventArgs)
    if cmdParams[1] == 'user' and not (buffactive['light arts']      or buffactive['dark arts'] or
                       buffactive['addendum: white'] or buffactive['addendum: black']) then
        if state.IdleMode.value == 'Stun' then
            send_command('@input /ja "Dark Arts" <me>')
        else
            send_command('@input /ja "Light Arts" <me>')
        end
    end

    update_active_strategems()
    update_sublimation()
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)
    display_current_caster_state()
    eventArgs.handled = true
end

-------------------------------------------------------------------------------------------------------------------
-- User code that supplements self-commands.
-------------------------------------------------------------------------------------------------------------------

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

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

-- Reset the state vars tracking strategems.
function update_active_strategems()
    state.Buff['Ebullience'] = buffactive['Ebullience'] or false
    state.Buff['Rapture'] = buffactive['Rapture'] or false
    state.Buff['Perpetuance'] = buffactive['Perpetuance'] or false
    state.Buff['Immanence'] = buffactive['Immanence'] or false
    state.Buff['Penury'] = buffactive['Penury'] or false
    state.Buff['Parsimony'] = buffactive['Parsimony'] or false
    state.Buff['Celerity'] = buffactive['Celerity'] or false
    state.Buff['Alacrity'] = buffactive['Alacrity'] or false

    state.Buff['Klimaform'] = buffactive['Klimaform'] or false
end

function update_sublimation()
    state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
end

-- Equip sets appropriate to the active buffs, relative to the spell being cast.
function apply_grimoire_bonuses(spell, action, spellMap)
    if state.Buff.Perpetuance and spell.type =='WhiteMagic' and spell.skill == 'Enhancing Magic' then
        equip(sets.buff['Perpetuance'])
    end	
    if state.Buff.Rapture and (spellMap == 'Cure' or spellMap == 'Curaga') then
        equip(sets.buff['Rapture'])
    end
    if spell.skill == 'Elemental Magic' and spellMap ~= 'ElementalEnfeeble' then
        if state.Buff.Ebullience and spell.english ~= 'Impact' then
            equip(sets.buff['Ebullience'])
        end
        if state.Buff.Immanence then
            equip(sets.buff['Immanence'])
        end
        if state.Buff.Klimaform then --and spell.element == world.weather_element
            equip(sets.buff['Klimaform'])
        end
    end

    if state.Buff.Penury then equip(sets.buff['Penury']) end
    if state.Buff.Parsimony then equip(sets.buff['Parsimony']) end
    if state.Buff.Celerity then equip(sets.buff['Celerity']) end
    if state.Buff.Alacrity then equip(sets.buff['Alacrity']) end
end


function display_current_caster_state()
	local msg = ''

	if state.OffenseMode.value ~= 'None' then
		msg = msg .. 'Melee'

		if state.CombatForm.has_value then
			msg = msg .. ' (' .. state.CombatForm.value .. ')'
		end
        
		msg = msg .. ', '
	end

	msg = msg .. 'Idle ['..state.IdleMode.value..'], Casting ['..state.CastingMode.value..']'

	add_to_chat(122, msg)
	local currentStrats = get_current_strategem_count()
	local arts
	if buffactive['Light Arts'] or buffactive['Addendum: White'] then
		arts = 'Light Arts'
	elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
		arts = 'Dark Arts'
	else
		arts = 'No Arts Activated'
	end
	add_to_chat(122, 'Current Available Strategems: ['..currentStrats..'], '..arts..'')
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 currentStrats = get_current_strategem_count()
	local newStratCount = currentStrats - 1
	local strategem = cmdParams[2]:lower()
	
	if currentStrats > 0 and strategem ~= 'light' and strategem ~= 'dark' then
		add_to_chat(122, '***Current Charges Available: ['..newStratCount..']***')
	elseif currentStrats == 0 then
		add_to_chat(122, '***Out of strategems! Canceling...***')
		return
	end

	if strategem == 'light' then
		if buffactive['light arts'] then
			send_command('input /ja "Addendum: White" <me>')
			add_to_chat(122, '***Current Charges Available: ['..newStratCount..']***')
		elseif buffactive['addendum: white'] then
			add_to_chat(122,'Error: Addendum: White is already active.')
		elseif buffactive['dark arts']  or buffactive['addendum: black'] then
			send_command('input /ja "Light Arts" <me>')
			add_to_chat(122, '***Changing Arts! Current Charges Available: ['..currentStrats..']***')
		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>')
			add_to_chat(122, '***Current Charges Available: ['..newStratCount..']***')
        elseif buffactive['addendum: black'] then
			add_to_chat(122,'Error: Addendum: Black is already active.')
		elseif buffactive['light arts'] or buffactive['addendum: white'] then
			send_command('input /ja "Dark Arts" <me>')
			add_to_chat(122, '***Changing Arts! Current Charges Available: ['..currentStrats..']***')
		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 == 'power' then
			send_command('@input /ja Rapture <me>')
		elseif strategem == 'duration' then
			send_command('@input /ja Perpetuance <me>')
		elseif strategem == 'accuracy' then
			send_command('@input /ja Altruism <me>')
		elseif strategem == 'enmity' then
			send_command('@input /ja Tranquility <me>')
		elseif strategem == 'skillchain' then
			add_to_chat(122,'Error: Light Arts does not have a skillchain strategem.')
		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 == 'power' then
			send_command('@input /ja Ebullience <me>')
		elseif strategem == 'duration' then
			add_to_chat(122,'Error: Dark Arts does not have a duration strategem.')
		elseif strategem == 'accuracy' then
			send_command('@input /ja Focalization <me>')
		elseif strategem == 'enmity' then
			send_command('@input /ja Equanimity <me>')
		elseif strategem == 'skillchain' then
			send_command('@input /ja Immanence <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 get_current_strategem_count()
	local allRecasts = windower.ffxi.get_ability_recasts()
	local stratsRecast = allRecasts[231]

	local maxStrategems = math.floor(player.main_job_level + 10) / 20

	local fullRechargeTime = 5*33

	local currentCharges = math.floor(maxStrategems - maxStrategems * stratsRecast / fullRechargeTime)
	
	return currentCharges
end


-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
    if player.sub_job == 'RDM' then
        set_macro_page(1, 8)
    elseif player.sub_job == 'BLM' then
        set_macro_page(1, 8)	
    elseif player.sub_job == 'WHM' then
        set_macro_page(2, 8)
	end	
end
 Bismarck.Speedyjim
Offline
サーバ: Bismarck
Game: FFXI
user: speedyjim
Posts: 516
By Bismarck.Speedyjim 2016-03-07 06:41:57  
Siren.Blackroses said: »
Hello Folks,
I am trying to understand why the set_combine do not seem to work, or at leats do not show into showswaps, particularly for helix spells.
This is my LUA and all midcasts work. I suspect the issue with Helix's are the II-type spells not swapping?
If that's the case, open Windower4/addons/GearSwap/libs/Mote-Mappings.lua and add the Helix-II spells. While you're there, may as well add the storm-II spells too.
Code
['Pyrohelix']='Helix',['Cryohelix']='Helix',['Anemohelix']='Helix',['Geohelix']='Helix',['Ionohelix']='Helix',['Hydrohelix']='Helix',['Luminohelix']='Helix',['Noctohelix']='Helix',
	['Pyrohelix II']='Helix',['Cryohelix II']='Helix',['Anemohelix II']='Helix',['Geohelix II']='Helix',['Ionohelix II']='Helix',['Hydrohelix II']='Helix',['Luminohelix II']='Helix',['Noctohelix II']='Helix',
    ['Firestorm']='Storm',['Hailstorm']='Storm',['Windstorm']='Storm',['Sandstorm']='Storm',['Thunderstorm']='Storm',['Rainstorm']='Storm',['Aurorastorm']='Storm',['Voidstorm']='Storm',
    ['Firestorm II']='Storm',['Hailstorm II']='Storm',['Windstorm II']='Storm',['Sandstorm II']='Storm',['Thunderstorm II']='Storm',['Rainstorm II']='Storm',['Aurorastorm II']='Storm',['Voidstorm II']='Storm',


Quote:
Secondly, I would like to make sure the Bookworm Cape and the Refocciliation Stone are equipped, even in case of magic burst mode.
This I'm unsure of, tbh.
[+]
 Siren.Blackroses
Offline
サーバ: Siren
Game: FFXI
Posts: 116
By Siren.Blackroses 2016-03-07 06:44:33  
Hi SpeedyJim,

Thanks for the quick answer. I have already modified the Mote-Mappins, so this is not the issue in case...

Otherwise, when you use "gearswap showswap", it does equip the tiernukeset + cape and stone (or whatever you set there?
 Siren.Blackroses
Offline
サーバ: Siren
Game: FFXI
Posts: 116
By Siren.Blackroses 2016-03-07 06:49:16  
Actually, I think I found a mistake in my SC.

I changed the helix line showed above for
Code
sets.midcast.Helix = set_combine(sets.midcast['Elemental Magic'].HighTierNuke, {back="Bookworm's Cape",waist="Refoccilation Stone"})	


and it seems to work properly.
 Lakshmi.Sulia
Offline
サーバ: Lakshmi
Game: FFXI
user: Sulia
Posts: 83
By Lakshmi.Sulia 2016-03-07 06:54:16  
Code
    sets.midcast.Helix = set_combine(sets.midcast.HighTierNuke, {back="Bookworm's Cape",waist="Refoccilation Stone"})       
    sets.midcast.Noctohelix = set_combine(sets.midcast.Helix, {head="Pixie Hairpin +1"})


If you're using your Elemental Magic set as the base should probably look like this:
Code
    sets.midcast.Helix = set_combine(sets.midcast['Elemental Magic'].HighTierNuke, {back="Bookworm's Cape",waist="Refoccilation Stone"})       
    sets.midcast.Noctohelix = set_combine(sets.midcast.Helix, {head="Pixie Hairpin +1"})


You remembered to do it with earlier set combines, but that one you omitted the ['Elemental Magic'] from the set you were using as the base to combine.
[+]
 Siren.Blackroses
Offline
サーバ: Siren
Game: FFXI
Posts: 116
By Siren.Blackroses 2016-03-07 07:02:12  
Cookies for both of you!

Now, how would I create a line for noctohelix II?

Would :
Code
sets.midcast.Noctohelix.II = set_combine(sets.midcast.Helix, {head="Pixie Hairpin +1"})		


works in this case? (Testing atm).
 Lakshmi.Sulia
Offline
サーバ: Lakshmi
Game: FFXI
user: Sulia
Posts: 83
By Lakshmi.Sulia 2016-03-07 07:06:47  
This might do the trick? I'm not used to coding for specific spells, so someone that knows better than I would probably be able to help better.
Code
sets.midcast.['Noctohelix II'] = set_combine(sets.midcast.Helix, {head="Pixie Hairpin +1"})
 Sylph.Mozhat
Offline
サーバ: Sylph
Game: FFXI
user: Mozhat
Posts: 58
By Sylph.Mozhat 2016-03-07 07:56:48  
Sylph.Mozhat said: »
I have a question about smn "sets.midcast.Pet."

On the function user_setup(),
what state."NAME"Mode:options('None', 'PhyAcc', 'MagAcc')
would you use to toggle the sets.midcast.Pet.?

This lua uses mote_include_version = 2.
There's no miscast.set in the event section.

-- Custom spell mapping.
function job_get_spell_map(spell)
if spell.type == 'BloodPactRage' then
if magicalRagePacts:contains(spell.english) then
return 'MagicalBloodPactRage'
else
return 'PhysicalBloodPactRage'
end
elseif spell.type == 'BloodPactWard' and spell.target.type == 'MONSTER' then
return 'DebuffBloodPactWard'
end
end

Can anyone help me with this?
I want to make a midcast pet ACC sets for phy and magical on the 135-145 lv. content.
 Bismarck.Speedyjim
Offline
サーバ: Bismarck
Game: FFXI
user: speedyjim
Posts: 516
By Bismarck.Speedyjim 2016-03-07 18:01:28  
Lakshmi.Sulia said: »
This might do the trick? I'm not used to coding for specific spells, so someone that knows better than I would probably be able to help better.
Code
sets.midcast.['Noctohelix II'] = set_combine(sets.midcast.Helix, {head="Pixie Hairpin +1"})
Drop the period after midcast.
Code
sets.midcast['Noctohelix II'] = set_combine(sets.midcast.Helix, {head="Pixie Hairpin +1"})
 Carbuncle.Doryll
Offline
サーバ: Carbuncle
Game: FFXI
user: Smacks
By Carbuncle.Doryll 2016-03-08 09:32:49  
Isilrhofal said: »
How about something like this?
you would still need to change my MB stuff (which doesn't work yet as I want it to):
Quote:
if state.MagicBurst == "tmp" or state.MagicBurst == "Perma" then

Hello, I tried to work with your code to have what i want (equip or not the AF body). It seems that doesn't work :/
Maybe i wrote something false, or i miss something, i'm a noob on coding^^
Offline
Posts: 40
By Isilrhofal 2016-03-08 17:14:07  
Carbuncle.Doryll said: »
Isilrhofal said: »
How about something like this?
you would still need to change my MB stuff (which doesn't work yet as I want it to):
Quote:
if state.MagicBurst == "tmp" or state.MagicBurst == "Perma" then

Hello, I tried to work with your code to have what i want (equip or not the AF body). It seems that doesn't work :/
Maybe i wrote something false, or i miss something, i'm a noob on coding^^

Based on my testing this triggers your Body change.
Changes:
user_setup
state.EquipBodyAF = M{['description']='Body', 'BodyAF', 'AmalricBody'}
-- removed the options as it seems that this tries to use vars from the mote-include.lua and changed it to a custom variable.
-- Changing the part 'Body' will change the description


job_post_midcast
if state.EquipBodyAF.value == 'AmalricBody' then
-- changed value (no space), and added the .value


Hope that works for you :D

Edit: And the link to the pastebin....(Bit easier to read)
http://pastebin.com/ucFmTkeG
 Carbuncle.Doryll
Offline
サーバ: Carbuncle
Game: FFXI
user: Smacks
By Carbuncle.Doryll 2016-03-09 03:13:03  
Thanks a lot !!! That's really great now !
 Sylph.Mozhat
Offline
サーバ: Sylph
Game: FFXI
user: Mozhat
Posts: 58
By Sylph.Mozhat 2016-03-09 13:03:51  
Sylph.Mozhat said: »
Sylph.Mozhat said: »
I have a question about smn "sets.midcast.Pet."

On the function user_setup(),
what state."NAME"Mode:options('None', 'PhyAcc', 'MagAcc')
would you use to toggle the sets.midcast.Pet.?

This lua uses mote_include_version = 2.
There's no miscast.set in the event section.

-- Custom spell mapping.
function job_get_spell_map(spell)
if spell.type == 'BloodPactRage' then
if magicalRagePacts:contains(spell.english) then
return 'MagicalBloodPactRage'
else
return 'PhysicalBloodPactRage'
end
elseif spell.type == 'BloodPactWard' and spell.target.type == 'MONSTER' then
return 'DebuffBloodPactWard'
end
end

Can anyone help me with this?
I want to make a midcast pet ACC sets for phy and magical on the 135-145 lv. content.

Since no one will help here,

The toggles on this lua are
gs c pact [PactType]
Attempts to use the indicated pact type for the current avatar.
PactType can be one of:
cure
curaga
buffOffense
buffDefense
buffSpecial
debuff1
debuff2
sleep
nuke2
nuke4
bp70
bp75 (merits and lvl 75-80 pacts)
astralflow

How do you toggle JAs or how would you make a JA toggle
Keep in mind BloodPacks are JAs
This SMN lua has
sets.midcast.Pet.DebuffBloodPactWard.Acc = sets.midcast.Pet.DebuffBloodPactWard
&
sets.midcast.Pet.MagicalBloodPactRage.Acc = sets.midcast.Pet.MagicalBloodPactRage
on it, but I have not seen anywhere, where to make this work, on the smn lua or the libs folder.

Plz help
Offline
Posts: 25
By BilunSalaes 2016-03-10 07:43:21  
I did a quick search but didn't find it. I also went to the google and didn't find it. So, would someone post a few lines for Corsair that will swap to our Empy AF3 chest piece when triple shot is active, and our other item of choice when it's not? Thank you.

If it exists, I'm sorry I didn't find it. What I found when I googled was an updated gearswap that was specifically missing this component.
Offline
Posts: 570
By dustinfoley 2016-03-11 08:46:11  
BilunSalaes said: »
I did a quick search but didn't find it. I also went to the google and didn't find it. So, would someone post a few lines for Corsair that will swap to our Empy AF3 chest piece when triple shot is active, and our other item of choice when it's not? Thank you.

If it exists, I'm sorry I didn't find it. What I found when I googled was an updated gearswap that was specifically missing this component.

This is the modified version i of equiping the adoulin neck from the previous page.


(Assuming you want it locked) Put in your "buff_change" event
Code
--Auto put Empy body on with ts active
if buff == "Triple Shot" then
    if gain then
        equip({Body="BLAHBLAHBLAH"})
        disable('body')
    else
        enable('body')
    end
end
Offline
Posts: 25
By BilunSalaes 2016-03-11 14:13:05  
dustinfoley said: »
BilunSalaes said: »
I did a quick search but didn't find it. I also went to the google and didn't find it. So, would someone post a few lines for Corsair that will swap to our Empy AF3 chest piece when triple shot is active, and our other item of choice when it's not? Thank you.

If it exists, I'm sorry I didn't find it. What I found when I googled was an updated gearswap that was specifically missing this component.

This is the modified version i of equiping the adoulin neck from the previous page.


(Assuming you want it locked) Put in your "buff_change" event
Code
--Auto put Empy body on with ts active
if buff == "Triple Shot" then
    if gain then
        equip({Body="BLAHBLAHBLAH"})
        disable('body')
    else
        enable('body')
    end
end

I will try this tonight when I get home. Thank you.
 Carbuncle.Doryll
Offline
サーバ: Carbuncle
Game: FFXI
user: Smacks
By Carbuncle.Doryll 2016-03-11 17:10:49  
Isilrhofal said: »
Carbuncle.Doryll said: »
Isilrhofal said: »
How about something like this?
you would still need to change my MB stuff (which doesn't work yet as I want it to):
Quote:
if state.MagicBurst == "tmp" or state.MagicBurst == "Perma" then

Hello, I tried to work with your code to have what i want (equip or not the AF body). It seems that doesn't work :/
Maybe i wrote something false, or i miss something, i'm a noob on coding^^

Based on my testing this triggers your Body change.
Changes:
user_setup
state.EquipBodyAF = M{['description']='Body', 'BodyAF', 'AmalricBody'}
-- removed the options as it seems that this tries to use vars from the mote-include.lua and changed it to a custom variable.
-- Changing the part 'Body' will change the description


job_post_midcast
if state.EquipBodyAF.value == 'AmalricBody' then
-- changed value (no space), and added the .value


Hope that works for you :D

Edit: And the link to the pastebin....(Bit easier to read)
http://pastebin.com/ucFmTkeG


Hi again,

I tried to add some sets to this rules, but that doesn't work,

if spell.skill == 'Elemental Magic' then
if state.EquipBodyAF.value == 'AmalricBody' then
equip(sets.midcast['Elemental Magic'].HighTierNuke,{body="Amalric Doublet +1"})
equip(sets.midcast['Elemental Magic'].HighTierNuke.MagicBurst,{body="Amalric Doublet +1"})
equip(sets.midcast.Meteor,{body="Amalric Doublet +1"})
equip(sets.midcast.Comet,{body="Amalric Doublet +1"})
equip(sets.midcast.Comet.MagicBurst,{body="Amalric Doublet +1"})
end
end

Last line take priority and all my nuke sets(in AmalricBody mode) use "sets.midcast.Comet.MagicBurst".
I think i need add a "command" before each line, but i don't know which one.
 Ragnarok.Flippant
Offline
サーバ: Ragnarok
Game: FFXI
user: Enceladus
Posts: 660
By Ragnarok.Flippant 2016-03-11 19:10:55  
Yeah, you're literally telling it to equip all those sets at once, in which case each latter will overwrite the former.

I don't use Mote's files, but I assume it would cascade properly if you just use:
Code
if spell.skill == 'Elemental Magic' then
	if state.EquipBodyAF.value == 'AmalricBody' then
		equip({body="Amalric Doublet +1"})
	end
end


This would simply equip the body for every Elemental Magic spell at the last moment.
 Carbuncle.Doryll
Offline
サーバ: Carbuncle
Game: FFXI
user: Smacks
By Carbuncle.Doryll 2016-03-12 02:44:52  
Thank you... that was not complicated. :)
 Asura.Sechs
Offline
サーバ: Asura
Game: FFXI
user: Akumasama
Posts: 10086
By Asura.Sechs 2016-03-12 08:18:24  
edit:
fixed it, was a sorting issue.
 Asura.Halestrum
Offline
サーバ: Asura
Game: FFXI
user: Hale
Posts: 27
By Asura.Halestrum 2016-03-12 21:30:21  
Recently Returned to ffxi and am returning to gearswap most of the time it works correctly for all jobs but occasionally it will spam an error
"Lua Runtime Error: Gearswap/refresh.lua:235: attempt to index field '?' (a nil value)"
I havent actually ever touched this file so i'm unsure as why it worked fine before my break and why it gives problems now, I can post a copy of that lua if it helps or is there something i have to update?
First Page 2 3 ... 92 93 94 ... 182 183 184
Log in to post.