|
Just sharing my LUA for new SCHs
By zerkles 2016-09-17 14:03:46
Hey there,
I've gotten alot of info and direct help from some folks on here, just thought I'd share my LUA for any up and coming SCHs out there. Its pretty straight to the point. I'll be providing 2 versions, one with my current gear if you want to make comparisons, and another with empty sets so you can input your gear.
Obi's work (thanks to help from people here), Empy feet +1 for when klimaform is on, I use Cycle to switch from normal nuking to Magic Burst, and have appropriate sets for Elemental/Helix MB. (Never bothered with MB toggle idk).
Might want to change the key binds to your liking at the top~
Anyway, hope this helps someone out there~
With my gear:
Code -------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
--[[
Custom 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 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('Normal','PDT')
state.CastingMode:options('Normal', 'MB')
state.IdleMode:options('Normal', 'PDT')
info.Helix = S{"Geohelix","Hydrohelix","Anemohelix","Pyrohelix","Cryohelix","Ionohelix","Luminohelix","Noctohelix",
"Geohelix II","Hydrohelix II","Anemohelix II","Pyrohelix II","Cryohelix II","Ionohelix II","Luminohelix II","Noctohelix II"}
send_command('bind ^q gs c cycle CastingMode')
send_command('bind ^e gs c cycle OffenseMode')
send_command('bind ^` input /ma Stun <t>')
send_command('bind %q input /ma "Utsusemi: Ichi" <me>')
send_command('bind %e input /ma "Utsusemi: Ni" <me>')
send_command('bind %b input /ja sublimation <me>')
select_default_macro_book()
end
function user_unload()
send_command('unbind ^`')
send_command('unbind ^q')
send_command('unbind ^e')
send_command('unbind ^b')
send_command('unbind ^q')
send_command('unbind ^e')
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['Tabula Rasa'] = {}
-- Fast cast sets for spells
sets.precast.FC = {ammo="incantor stone",
head={ name="Merlinic Hood", augments={'"Mag.Atk.Bns."+29','"Fast Cast"+7',}},ear2="Loquacious earring",
body="Helios jacket",hands="Gendewitha Gages",ring1="",
back="Swith Cape",waist="Witful Belt",legs="psycloth lappas",feet="Merlinic crackows"}
sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
sets.precast.FC.Stoneskin = {
ammo="Incantor Stone",
head={ name="Merlinic Hood", augments={'"Mag.Atk.Bns."+29','"Fast Cast"+7',}},
body={ name="Helios Jacket", augments={'"Fast Cast"+3',}},
hands={ name="Gendewitha Gages", augments={'Phys. dmg. taken -2%','"Cure" potency +4%',}},
legs={ name="Psycloth Lappas", augments={'MP+80','Mag. Acc.+15','"Fast Cast"+7',}},
feet={ name="Merlinic Crackows", augments={'"Mag.Atk.Bns."+17','"Fast Cast"+7','Mag. Acc.+13',}},
waist="Siegel Sash",
right_ear="Loquac. Earring",
back="Perimede Cape",
}
sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {neck="Stoicheion Medal",ear1="Barkarole Earring"})
sets.precast.FC.Cure = set_combine(sets.precast.FC, {back="Pahtli Cape",ear1="Mendicant's earring",body="Vanya Robe",feet="Vanya clogs"})
sets.precast.FC.Curaga = sets.precast.FC.Cure
sets.precast.FC.Impact = set_combine(sets.precast.FC['Elemental Magic'], {head=empty,body="Twilight Cloak"})
-- Midcast Sets
sets.midcast.FastRecast = {ammo="Incantor Stone",
head="Nahtirah Hat",ear2="Loquacious Earring",
body="Helios jacket",hands="Gendewitha Gages",ring1="Prolix Ring",
back="Swith Cape",waist="Goading Belt",legs="",feet="Academic's Loafers"}
sets.midcast.Cure = {
ammo="Hydrocera",
head={ name="Gende. Caubeen", augments={'Phys. dmg. taken -3%',}},
body={ name="Gendewitha Bliaut", augments={'Phys. dmg. taken -1%','"Cure" potency +2%',}},
hands="Weather. Cuffs",
legs={ name="Psycloth Lappas", augments={'MP+80','Mag. Acc.+15','"Fast Cast"+7',}},
feet={ name="Vanya Clogs", augments={'"Cure" potency +5%','"Cure" spellcasting time -15%','"Conserve MP"+6',}},
neck="Nodens Gorget",
waist="Gishdubar Sash",
left_ear="Calamitous Earring",
right_ear="Mendi. Earring",
left_ring="Asklepian Ring",
right_ring="Sirona's Ring",
back="Oretania's Cape",
}
sets.midcast.CureWithLightWeather = {}
sets.midcast.Curaga = sets.midcast.Cure
sets.midcast.Regen = {
ammo="Incantor Stone",
head={ name="Merlinic Hood", augments={'"Mag.Atk.Bns."+29','"Fast Cast"+7',}},
body={ name="Telchine Chas.", augments={'Enh. Mag. eff. dur. +8',}},
hands={ name="Chironic Gloves", augments={'"Mag.Atk.Bns."+5','"Drain" and "Aspir" potency +5','CHR+15',}},
legs={ name="Telchine Braconi", augments={'Enh. Mag. eff. dur. +10',}},
feet={ name="Telchine Pigaches", augments={'"Fast Cast"+3','Enh. Mag. eff. dur. +7',}},
waist="Luminary Sash",
left_ear="Calamitous Earring",
right_ear="Gifted Earring",
left_ring="Asklepian Ring",
right_ring="Sirona's Ring",
back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10',}},
}
sets.midcast.Cursna = {
ammo="Incantor Stone",
head={ name="Merlinic Hood", augments={'"Mag.Atk.Bns."+29','"Fast Cast"+7',}},
body={ name="Witching Robe", augments={'MP+25','Mag. Acc.+1',}},
legs={ name="Psycloth Lappas", augments={'MP+80','Mag. Acc.+15','"Fast Cast"+7',}},
feet={ name="Gende. Galoshes", augments={'Phys. dmg. taken -1%',}},
neck="Malison Medallion",
waist="Gishdubar Sash",
left_ear="Gifted Earring",
right_ear="Calamitous Earring",
left_ring="Ephedra Ring",
back="Solemnity Cape",
}
sets.midcast['Enhancing Magic'] = { ammo="Incantor Stone",
head="Nares Cap",
body={ name="Telchine Chas.", augments={'Enh. Mag. eff. dur. +8',}},
hands={ name="Chironic Gloves", augments={'"Mag.Atk.Bns."+5','"Drain" and "Aspir" potency +5','CHR+15',}},
legs={ name="Telchine Braconi", augments={'Enh. Mag. eff. dur. +10',}},
feet={ name="Telchine Pigaches", augments={'"Fast Cast"+3','Enh. Mag. eff. dur. +7',}},
neck="Twilight Torque",
waist="Luminary Sash",
left_ear="Gifted Earring",
right_ear="Calamitous Earring",
left_ring="Vertigo Ring",
right_ring="Ephedra Ring",
back="Perimede Cape",
}
sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {ear1="Earthcry earring",legs="Haven hose",neck="Nodens gorget"})
sets.midcast.Storm = set_combine(sets.midcast['Enhancing Magic'], {feet="Pedagogy Loafers"})
sets.midcast.Protect = {}
sets.midcast.Protectra = sets.midcast.Protect
sets.midcast.Shell = {}
sets.midcast.Shellra = sets.midcast.Shell
-- Custom spell classes
sets.midcast.MndEnfeebles = {ammo="Mana ampulla",
head="Jhakri coronal +1",neck="Imbodla Necklace",ear1="Barkarole Earring",ear2="Lifestorm Earring",
body="Vanya Robe",hands="Jhakri cuffs +1",ring1="Sirona's ring",ring2="Acumen Ring",
back="Lugh's cape",waist="Luminary sash",legs="Psycloth Lappas",feet="Jhakri pigaches +1"}
sets.midcast.IntEnfeebles = {ammo="Mana ampulla",
head="Jhakri coronal +1",neck="Imbodla Necklace",ear1="Friomisi Earring",ear2="Barkarole Earring",
body="Vanya Robe",hands="Jhakri cuffs +1",ring1="Shiva Ring",ring2="Acumen Ring",
back="Lugh's cape",waist="Luminary sash",legs="Psycloth Lappas",feet="Jhakri pigaches +1"}
sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
sets.midcast['Dark Magic'] = {ammo="Mana ampulla",
head="Pixie Hairpin +1",neck="Sanctity necklace",ear1="Barkarole Earring",ear2="Lifestorm Earring",
body="Jhakri robe +1",hands="Jhakri cuffs +1",ring1="Sirona's ring",ring2="Acumen Ring",
back="Lugh's cape",waist="Luminary sash",legs="jhakri slops +1",feet="Jhakri pigaches +1"}
sets.midcast.Kaustra = {ammo="Ghastly Tathlum",
head="Pixie Hairpin +1",neck="Sanctity necklace",ear1="Barkarole Earring",ear2="Static earring",
body="Jhakri robe +1",hands="Amalric gages",ring1="Mujin Band",ring2="Locus ring",
back="Lugh's cape",waist="Luminary sash",legs=SCH_mb_legs,feet="Jhakri pigaches +1"}
sets.midcast.Kaustra.MB = {ammo="Ghastly Tathlum",
head="Pixie Hairpin +1",neck=SCH_mb_neck,ear1="Barkarole Earring",ear2="Static earring",
body="Jhakri robe +1",hands="Amalric gages",ring1="Mujin Band",ring2="Locus ring",
back="Lugh's cape",waist="Luminary sash",legs=SCH_mb_legs,feet="Jhakri pigaches +1"}
sets.midcast.Drain = {ammo="Mana ampulla",
head="Pixie Hairpin +1",neck="Stoicheion medal",ear1="Barkarole Earring",ear2="Lifestorm Earring",
body="Jhakri robe +1",hands="Jhakri cuffs +1",ring1="Sirona's ring",ring2="Acumen Ring",
back="Lugh's cape",waist="Luminary sash",legs="jhakri slops +1",feet="Merlinic crackows"}
sets.midcast.Aspir = sets.midcast.Drain
sets.midcast.Stun = {}
-- Elemental Magic sets are default for handling low-tier nukes.
sets.midcast['Elemental Magic'] = {ammo="Ghastly Tathlum",
head="Jhakri coronal +1",neck="Sanctity necklace",ear1="Barkarole Earring",ear2="Friomisi Earring",
body="Jhakri robe +1",hands="Jhakri cuffs +1",ring1="Shiva Ring",ring2="Acumen Ring",
back="Lugh's cape",waist="Luminary sash",legs="jhakri slops +1",feet="Jhakri pigaches +1"}
sets.midcast['Elemental Magic'].MB = {ammo="Ghastly Tathlum",
head=SCH_mb_head,neck=SCH_mb_neck,ear1="Barkarole Earring",ear2="Static earring",
body="Jhakri robe +1",hands="Amalric gages",ring1="Mujin Band",ring2="Locus ring",
back="Lugh's cape",waist="Luminary sash",legs=SCH_mb_legs,feet="Jhakri pigaches +1"}
-- Custom refinements for certain nuke tiers
--sets.midcast['Elemental Magic'].HighTierNuke = set_combine(sets.midcast['Elemental Magic'])
--sets.midcast['Elemental Magic'].HighTierNuke.MB = set_combine(sets.midcast['Elemental Magic'].MB)
sets.midcast.Impact = {}
sets.midcast.Helix = {ammo="Ghastly Tathlum",
head="Jhakri coronal +1",neck="Sanctity necklace",ear1="Barkarole Earring",ear2="Friomisi Earring",
body="Jhakri robe +1",hands="Jhakri cuffs +1",ring1="Shiva Ring",ring2="Acumen Ring",
back="Lugh's cape",waist="Luminary sash",legs="jhakri slops +1",feet="Jhakri pigaches +1"}
sets.midcast.Helix.MB = {ammo="Ghastly Tathlum",
head=SCH_mb_head,neck=SCH_mb_neck,ear1="Barkarole Earring",ear2="Static earring",
body="Jhakri robe +1",hands="Amalric gages",ring1="Mujin Band",ring2="Locus ring",
back="Lugh's cape",waist="Luminary sash",legs=SCH_mb_legs,feet="Jhakri pigaches +1"}
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {}
-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
sets.precast.WS['Myrkr']={
ammo=SCH_whale_ammo,
head=SCH_whale_head,
body=SCH_whale_body,
hands=SCH_whale_hands,
legs=SCH_whale_legs,
feet=SCH_whale_feet,
neck=SCH_whale_neck,
waist=SCH_whale_waist,
left_ear=SCH_whale_left_ear,
right_ear=SCH_whale_right_ear,
left_ring=SCH_whale_left_ring,
right_ring=SCH_whale_right_ring,
back=SCH_whale_back}
sets.idle.Town = {ammo="Incantor stone",
head="Jhakri coronal +1",neck="Sanctity necklace",ear1="Infused earring",ear2="Friomisi Earring",
body="Jhakri robe +1",hands="Jhakri cuffs +1",ring1="shneddick ring",ring2="Shiva Ring",
back="Lugh's cape",waist="Luminary sash",legs="Assiduity pants +1",feet="Jhakri pigaches +1"}
sets.idle.Field = {ammo="Incantor stone",
head="Jhakri coronal +1",neck="Sanctity necklace",ear1="Infused earring",ear2="Lifestorm earring",
body="Jhakri robe +1",hands="Jhakri cuffs +1",ring1="Ephedra ring",ring2="shneddick ring",
back="Solemnity cape",waist="Luminary sash",legs="Assiduity pants +1",feet="Jhakri pigaches +1"}
sets.idle.Field.PDT = {
ammo="Brigantia Pebble",
head={ name="Gende. Caubeen", augments={'Phys. dmg. taken -3%',}},
body={ name="Hagondes Coat +1", augments={'Phys. dmg. taken -4%','Magic dmg. taken -2%','Pet: Attack+21 Pet: Rng.Atk.+21',}},
hands={ name="Hagondes Cuffs +1", augments={'Phys. dmg. taken -4%','Pet: Accuracy+22 Pet: Rng. Acc.+22',}},
legs={ name="Artsieq Hose", augments={'"Mag.Atk.Bns."+25','Mag. Evasion+10','Phys. dmg. taken -5',}},
feet="Battlecast Gaiters",
neck="Twilight Torque",
waist="Isa Belt",
left_ear="Handler's Earring",
right_ear="Mendi. Earring",
left_ring="Vertigo Ring",
right_ring="Gelatinous Ring",
back="Solemnity Cape"}
sets.idle.Field.Stun = {}
sets.idle.Weak = {}
-- Defense sets
sets.defense.PDT = {
ammo="Brigantia Pebble",
head={ name="Gende. Caubeen", augments={'Phys. dmg. taken -3%',}},
body={ name="Hagondes Coat +1", augments={'Phys. dmg. taken -4%','Magic dmg. taken -2%','Pet: Attack+21 Pet: Rng.Atk.+21',}},
hands={ name="Hagondes Cuffs +1", augments={'Phys. dmg. taken -4%','Pet: Accuracy+22 Pet: Rng. Acc.+22',}},
legs={ name="Artsieq Hose", augments={'"Mag.Atk.Bns."+25','Mag. Evasion+10','Phys. dmg. taken -5',}},
feet="Battlecast Gaiters",
neck="Twilight Torque",
waist="Isa Belt",
left_ear="Handler's Earring",
right_ear="Mendi. Earring",
left_ring="Vertigo Ring",
right_ring="Gelatinous Ring",
back="Solemnity Cape"}
sets.defense.MDT = {}
sets.Kiting = {ring1="shneddick ring"}
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 = {ammo="Incantor stone",
head="Jhakri coronal +1",neck="Sanctity necklace",ear1="Infused earring",ear2="Lifestorm earring",
body="Jhakri robe +1",hands="Jhakri cuffs +1",ring1="Ephedra ring",ring2="shneddick ring",
back="Solemnity cape",waist="Luminary sash",legs="Assiduity pants +1",feet="Jhakri pigaches +1"}
sets.engaged.PDT = {
ammo="Brigantia Pebble",
head={ name="Gende. Caubeen", augments={'Phys. dmg. taken -3%',}},
body={ name="Hagondes Coat +1", augments={'Phys. dmg. taken -4%','Magic dmg. taken -2%','Pet: Attack+21 Pet: Rng.Atk.+21',}},
hands={ name="Hagondes Cuffs +1", augments={'Phys. dmg. taken -4%','Pet: Accuracy+22 Pet: Rng. Acc.+22',}},
legs={ name="Artsieq Hose", augments={'"Mag.Atk.Bns."+25','Mag. Evasion+10','Phys. dmg. taken -5',}},
feet="Battlecast Gaiters",
neck="Twilight Torque",
waist="Isa Belt",
left_ear="Handler's Earring",
right_ear="Mendi. Earring",
left_ring="Vertigo Ring",
right_ring="Gelatinous Ring",
back="Solemnity Cape"}
-- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
sets.buff['Ebullience'] = {head="Savant's Bonnet +2"}
sets.buff['Rapture'] = {head="Savant's Bonnet +2"}
sets.buff['Perpetuance'] = {hands="Arbatel bracers +1"}
sets.buff['Immanence'] = {hands="Savant's Bracers +2"}
sets.buff['Penury'] = {legs="Savant's Pants +2"}
sets.buff['Parsimony'] = {legs="Savant's Pants +2"}
sets.buff['Celerity'] = {feet="Argute Loafers"}
sets.buff['Alacrity'] = {feet="Argute Loafers"}
sets.buff['Klimaform'] = {feet="Arbatel Loafers +1"}
sets.buff.FullSublimation = {}
sets.buff.PDTSublimation = {}
--sets.buff['Sandstorm'] = {feet="Desert Boots"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
-- Run after the general midcast() is done.
function job_post_midcast(spell, action, spellMap, eventArgs)
if spellMap == 'Cure' and spell.target.type == 'SELF' then
equip(sets.self_healing)
end
if spell.action_type == 'Magic' then
apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
end
if spell.skill == 'Elemental Magic' then
if (spell.element == world.day_element or spell.element == world.weather_element) and spellMap ~= 'Helix' then
equip({waist="Hachirin-No-Obi"})
add_to_chat(8,'----- Obi Equipped. -----')
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 and spell.element == world.weather_element then
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
-- 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 == '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
-- Gets the current number of available strategems based on the recast remaining
-- and the level of the sch.
function get_current_strategem_count()
-- returns recast in seconds.
local allRecasts = windower.ffxi.get_ability_recasts()
local stratsRecast = allRecasts[231]
local maxStrategems = (player.main_job_level + 10) / 20
local fullRechargeTime = 4*60
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()
set_macro_page(1, 20)
end
Empty sets:
Code -------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
--[[
Custom 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 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('Normal','PDT')
state.CastingMode:options('Normal', 'MB')
state.IdleMode:options('Normal', 'PDT')
info.Helix = S{"Geohelix","Hydrohelix","Anemohelix","Pyrohelix","Cryohelix","Ionohelix","Luminohelix","Noctohelix",
"Geohelix II","Hydrohelix II","Anemohelix II","Pyrohelix II","Cryohelix II","Ionohelix II","Luminohelix II","Noctohelix II"}
send_command('bind ^q gs c cycle CastingMode')
send_command('bind ^e gs c cycle OffenseMode')
send_command('bind ^` input /ma Stun <t>')
send_command('bind %q input /ma "Utsusemi: Ichi" <me>')
send_command('bind %e input /ma "Utsusemi: Ni" <me>')
send_command('bind %b input /ja sublimation <me>')
select_default_macro_book()
end
function user_unload()
send_command('unbind ^`')
send_command('unbind ^q')
send_command('unbind ^e')
send_command('unbind ^b')
send_command('unbind ^q')
send_command('unbind ^e')
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['Tabula Rasa'] = {}
-- Fast cast sets for spells
sets.precast.FC = {}
sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {})
sets.precast.FC.Stoneskin = {}
sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {})
sets.precast.FC.Cure = set_combine(sets.precast.FC, {})
sets.precast.FC.Curaga = sets.precast.FC.Cure
sets.precast.FC.Impact = set_combine(sets.precast.FC['Elemental Magic'], {head=empty,body="Twilight Cloak"})
-- Midcast Sets
sets.midcast.FastRecast = {}
sets.midcast.Cure = {}
sets.midcast.CureWithLightWeather = {}
sets.midcast.Curaga = sets.midcast.Cure
sets.midcast.Regen = {}
sets.midcast.Cursna = {}
sets.midcast['Enhancing Magic'] = {}
sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {})
sets.midcast.Storm = set_combine(sets.midcast['Enhancing Magic'], {})
sets.midcast.Protect = {}
sets.midcast.Protectra = sets.midcast.Protect
sets.midcast.Shell = {}
sets.midcast.Shellra = sets.midcast.Shell
-- Custom spell classes
sets.midcast.MndEnfeebles = {}
sets.midcast.IntEnfeebles = {}
sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
sets.midcast['Dark Magic'] = {}
sets.midcast.Kaustra = {}
sets.midcast.Kaustra.MB = {}
sets.midcast.Drain = {}
sets.midcast.Aspir = sets.midcast.Drain
sets.midcast.Stun = {}
-- Elemental Magic sets are default for handling low-tier nukes.
sets.midcast['Elemental Magic'] = {}
sets.midcast['Elemental Magic'].MB = {}
-- Custom refinements for certain nuke tiers
--sets.midcast['Elemental Magic'].HighTierNuke = set_combine(sets.midcast['Elemental Magic'])
--sets.midcast['Elemental Magic'].HighTierNuke.MB = set_combine(sets.midcast['Elemental Magic'].MB)
sets.midcast.Impact = {}
sets.midcast.Helix = {}
sets.midcast.Helix.MB = {}
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {}
-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
sets.precast.WS['Myrkr']={}
sets.idle.Town = {}
sets.idle.Field = {}
sets.idle.Field.PDT = {}
sets.idle.Field.Stun = {}
sets.idle.Weak = {}
-- Defense sets
sets.defense.PDT = {}
sets.defense.MDT = {}
sets.Kiting = {}
sets.latent_refresh = {}
-- 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 = {}
sets.engaged.PDT = {}
-- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
sets.buff['Ebullience'] = {}
sets.buff['Rapture'] = {}
sets.buff['Perpetuance'] = {}
sets.buff['Immanence'] = {}
sets.buff['Penury'] = {}
sets.buff['Parsimony'] = {}
sets.buff['Celerity'] = {}
sets.buff['Alacrity'] = {}
sets.buff['Klimaform'] = {}
sets.buff.FullSublimation = {}
sets.buff.PDTSublimation = {}
--sets.buff['Sandstorm'] = {feet="Desert Boots"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
-- Run after the general midcast() is done.
function job_post_midcast(spell, action, spellMap, eventArgs)
if spellMap == 'Cure' and spell.target.type == 'SELF' then
equip(sets.self_healing)
end
if spell.action_type == 'Magic' then
apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
end
if spell.skill == 'Elemental Magic' then
if (spell.element == world.day_element or spell.element == world.weather_element) and spellMap ~= 'Helix' then
equip({waist="Hachirin-No-Obi"})
add_to_chat(8,'----- Obi Equipped. -----')
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 and spell.element == world.weather_element then
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
-- 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 == '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
-- Gets the current number of available strategems based on the recast remaining
-- and the level of the sch.
function get_current_strategem_count()
-- returns recast in seconds.
local allRecasts = windower.ffxi.get_ability_recasts()
local stratsRecast = allRecasts[231]
local maxStrategems = (player.main_job_level + 10) / 20
local fullRechargeTime = 4*60
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()
set_macro_page(1, 20)
end
And for those more experienced, any advice that you might be able to give is very much appreciated. I'm very happy with how this LUA works thus far.
By Sidra 2016-10-15 16:29:00
Hello - new to luas and SCH and general, and trying to get something basic set up and working, so this seemed like a good start. But it doesn't seem to be working for me. Here is what I have done:
1.) Enabled GearSwap Addon
2.) /gs export 4 sets: nuke, heal, fastcast, idle. I notice mine paste more vertical than yours with some spaces between the commas and next slot, don't know if that makes a difference. Using Notepad 2.
3.) copy and pasted from the exports into what seems like the appropriate places in the file. For all the stuff I am not using because I don't yet have the itemization, can I leave them blank, delete the lines, or just paste in a base set anyway?
4.) saved as MyName_SCH in the Gearswap > Addons > Data folder
5.) Didn't seem to do anything in game so //gs enable. I get the text it's on - but gear never swaps.
I assume I am missing something totally basic. Any help would be appreciated.
Bismarck.Snprphnx
Serveur: Bismarck
Game: FFXI
Posts: 2707
By Bismarck.Snprphnx 2016-10-15 16:50:52
Download and use Note Hello - new to luas and SCH and general, and trying to get something basic set up and working, so this seemed like a good start. But it doesn't seem to be working for me. Here is what I have done:
1.) Enabled GearSwap Addon
2.) /gs export 4 sets: nuke, heal, fastcast, idle. I notice mine paste more vertical than yours with some spaces between the commas and next slot, don't know if that makes a difference. Using Notepad 2.
3.) copy and pasted from the exports into what seems like the appropriate places in the file. For all the stuff I am not using because I don't yet have the itemization, can I leave them blank, delete the lines, or just paste in a base set anyway?
4.) saved as MyName_SCH in the Gearswap > Addons > Data folder
5.) Didn't seem to do anything in game so //gs enable. I get the text it's on - but gear never swaps.
I assume I am missing something totally basic. Any help would be appreciated.
Try downloading and using Notepad++. Normally better for lua editing.
What specifically are you saving the file as?
By Sidra 2016-10-15 18:25:01
A nice player actually reached out to me on server and gave me a hand - and it's working now. Thanks!
By Sidra 2016-10-17 14:40:46
So - at this point I have collected 2 elemental obis. Looking through the code, it just seems to use the Haichirin-no-Obi, which I am okay with. I am not doing anything important on SCH atm, and I'll have it in a few days.
However, to my surprise, when I cast fire and thunder spells with the the weather effect up, I get "Obi Equipped" in showswaps messages. Which is happening - is it equipping the specific elemental obi, or just showing the message since its trying to equip the Haichirin-no-Obi I don't have, while actually equipping nothing?
Lakshmi.Rumorian
Serveur: Lakshmi
Game: FFXI
Posts: 10
By Lakshmi.Rumorian 2016-10-24 15:44:20
That whole stratagem section starting at line 565, how does that work? It sounds like it's going to activate light/dark arts depending on which stratagem you're trying to use. Does it do that automatically?
I saw that command gs c scholar <strategem>, do you just insert the name of the strategem and the lua does the rest?
Serveur: Lakshmi
Game: FFXI
Posts: 98
By Lakshmi.Ashtopcat 2016-10-24 16:11:10
I saw that command gs c scholar <strategem>, do you just insert the name of the strategem and the lua does the rest?
yeah it refers back to the top part (lines 14-24) so it's the same syntax for both light and dark arts
Serveur: Phoenix
Game: FFXI
Posts: 61
By Phoenix.Trinironnie 2016-11-22 08:58:06
If we want to take out the augment section of the armor and leave the armor by itself, how do we do it without messing up the script?
Valefor.Omnys
Serveur: Valefor
Game: FFXI
Posts: 1759
By Valefor.Omnys 2016-11-22 10:12:13
legs={ name="Telchine Braconi", augments={'Enh. Mag. eff. dur. +10',}},
becomes
legs="Telchine Braconi",
etc
But it's better to use gearswap's built in //gs export (exports to a timestamped file) and copy and paste, that way you always know exactly what's being used during a spell.
It also helps gearswap/organizer notify you if it can't find an item (perhaps you changed the augment).
Serveur: Shiva
Game: FFXI
Posts: 1052
By Shiva.Arislan 2016-11-22 10:38:33
(perhaps you changed the augment).
This is probably why you don't want to list all your augments on every instance of that piece of gear.
It's better to define augmented gear globally, then call them when needed in your job lua's. If you ever change an augment, you'd only have to change the 1 line item in your globals file, instead of potentially dozens of instances, across multiple files.
For example, in YourName_Globals.lua:
Code function define_global_sets()
-- Herculean Triple Attack Set
gear.Herc_TA_body = {name="Herculean Vest", augments={'Accuracy+21 Attack+21','"Triple Atk."+3','STR+6','Accuracy+8',}}
gear.Herc_TA_hands = {name="Herculean Gloves", augments={'Accuracy+20 Attack+20','"Triple Atk."+3','DEX+8','Accuracy+1',}}
gear.Herc_TA_feet = {name="Herculean Boots", augments={'Accuracy+21 Attack+21','"Triple Atk."+4','STR+9','Accuracy+15',}}
-- Herculean Accuracy Set
gear.Herc_Acc_feet = {name="Herculean Boots", augments={'Accuracy+19 Attack+19','"Store TP"+4','DEX+10','Accuracy+15','Attack+10',}}
-- Herculean Weapon Skill Set
gear.Herc_WS_body = {name="Herculean Vest", augments={'Attack+27','Weapon skill damage +2%','STR+14','Accuracy+5',}}
gear.Herc_WS_hands = {name="Herculean Gloves", augments={'Accuracy+29','Weapon skill damage +4%','STR+6','Attack+10',}}
gear.Herc_WS_legs = {name="Herculean Trousers", augments={'Accuracy+25 Attack+25','Weapon skill damage +3%','DEX+13','Accuracy+6','Attack+4',}}
gear.COR_DW_Cape = {name="Camulus's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','"Dual Wield"+10',}}
gear.COR_TP_Cape = {name="Camulus's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10',}}
end
Then, call them like this in your job file:
Code sets.engaged = {
head="Dampening Tam",
body=gear.Herc_WS_body,
hands=gear.Herc_TA_hands,
legs="Carmine Cuisses +1",
feet=gear.Herc_Acc_feet,
neck="Ainia Collar",
ear1="Dedition Earring",
ear2="Telos Earring",
ring1="Petrov Ring",
ring2="Epona's Ring",
back=gear.COR_DW_Cape,
waist="Shetal Stone",
}
gear._______ can be named anything.
Valefor.Omnys
Serveur: Valefor
Game: FFXI
Posts: 1759
By Valefor.Omnys 2016-11-24 19:03:36
Agreed, I do this too.
And I can include(player.name.."_gear.lua") and multiple characters can use thw same lua.
Valefor.Gorns
Serveur: Valefor
Game: FFXI
Posts: 159
By Valefor.Gorns 2016-11-30 10:37:23
Do you have to add a line something like include('Gorns_Globals.lua') somewhere in the job file ?
Hey there,
I've gotten alot of info and direct help from some folks on here, just thought I'd share my LUA for any up and coming SCHs out there. Its pretty straight to the point. I'll be providing 2 versions, one with my current gear if you want to make comparisons, and another with empty sets so you can input your gear.
Obi's work (thanks to help from people here), Empy feet +1 for when klimaform is on, I use Cycle to switch from normal nuking to Magic Burst, and have appropriate sets for Elemental/Helix MB. (Never bothered with MB toggle idk).
Might want to change the key binds to your liking at the top~
Anyway, hope this helps someone out there~
With my gear:
Code -------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
--[[
Custom 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 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('Normal','PDT')
state.CastingMode:options('Normal', 'MB')
state.IdleMode:options('Normal', 'PDT')
info.Helix = S{"Geohelix","Hydrohelix","Anemohelix","Pyrohelix","Cryohelix","Ionohelix","Luminohelix","Noctohelix",
"Geohelix II","Hydrohelix II","Anemohelix II","Pyrohelix II","Cryohelix II","Ionohelix II","Luminohelix II","Noctohelix II"}
send_command('bind ^q gs c cycle CastingMode')
send_command('bind ^e gs c cycle OffenseMode')
send_command('bind ^` input /ma Stun <t>')
send_command('bind %q input /ma "Utsusemi: Ichi" <me>')
send_command('bind %e input /ma "Utsusemi: Ni" <me>')
send_command('bind %b input /ja sublimation <me>')
select_default_macro_book()
end
function user_unload()
send_command('unbind ^`')
send_command('unbind ^q')
send_command('unbind ^e')
send_command('unbind ^b')
send_command('unbind ^q')
send_command('unbind ^e')
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['Tabula Rasa'] = {}
-- Fast cast sets for spells
sets.precast.FC = {ammo="incantor stone",
head={ name="Merlinic Hood", augments={'"Mag.Atk.Bns."+29','"Fast Cast"+7',}},ear2="Loquacious earring",
body="Helios jacket",hands="Gendewitha Gages",ring1="",
back="Swith Cape",waist="Witful Belt",legs="psycloth lappas",feet="Merlinic crackows"}
sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
sets.precast.FC.Stoneskin = {
ammo="Incantor Stone",
head={ name="Merlinic Hood", augments={'"Mag.Atk.Bns."+29','"Fast Cast"+7',}},
body={ name="Helios Jacket", augments={'"Fast Cast"+3',}},
hands={ name="Gendewitha Gages", augments={'Phys. dmg. taken -2%','"Cure" potency +4%',}},
legs={ name="Psycloth Lappas", augments={'MP+80','Mag. Acc.+15','"Fast Cast"+7',}},
feet={ name="Merlinic Crackows", augments={'"Mag.Atk.Bns."+17','"Fast Cast"+7','Mag. Acc.+13',}},
waist="Siegel Sash",
right_ear="Loquac. Earring",
back="Perimede Cape",
}
sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {neck="Stoicheion Medal",ear1="Barkarole Earring"})
sets.precast.FC.Cure = set_combine(sets.precast.FC, {back="Pahtli Cape",ear1="Mendicant's earring",body="Vanya Robe",feet="Vanya clogs"})
sets.precast.FC.Curaga = sets.precast.FC.Cure
sets.precast.FC.Impact = set_combine(sets.precast.FC['Elemental Magic'], {head=empty,body="Twilight Cloak"})
-- Midcast Sets
sets.midcast.FastRecast = {ammo="Incantor Stone",
head="Nahtirah Hat",ear2="Loquacious Earring",
body="Helios jacket",hands="Gendewitha Gages",ring1="Prolix Ring",
back="Swith Cape",waist="Goading Belt",legs="",feet="Academic's Loafers"}
sets.midcast.Cure = {
ammo="Hydrocera",
head={ name="Gende. Caubeen", augments={'Phys. dmg. taken -3%',}},
body={ name="Gendewitha Bliaut", augments={'Phys. dmg. taken -1%','"Cure" potency +2%',}},
hands="Weather. Cuffs",
legs={ name="Psycloth Lappas", augments={'MP+80','Mag. Acc.+15','"Fast Cast"+7',}},
feet={ name="Vanya Clogs", augments={'"Cure" potency +5%','"Cure" spellcasting time -15%','"Conserve MP"+6',}},
neck="Nodens Gorget",
waist="Gishdubar Sash",
left_ear="Calamitous Earring",
right_ear="Mendi. Earring",
left_ring="Asklepian Ring",
right_ring="Sirona's Ring",
back="Oretania's Cape",
}
sets.midcast.CureWithLightWeather = {}
sets.midcast.Curaga = sets.midcast.Cure
sets.midcast.Regen = {
ammo="Incantor Stone",
head={ name="Merlinic Hood", augments={'"Mag.Atk.Bns."+29','"Fast Cast"+7',}},
body={ name="Telchine Chas.", augments={'Enh. Mag. eff. dur. +8',}},
hands={ name="Chironic Gloves", augments={'"Mag.Atk.Bns."+5','"Drain" and "Aspir" potency +5','CHR+15',}},
legs={ name="Telchine Braconi", augments={'Enh. Mag. eff. dur. +10',}},
feet={ name="Telchine Pigaches", augments={'"Fast Cast"+3','Enh. Mag. eff. dur. +7',}},
waist="Luminary Sash",
left_ear="Calamitous Earring",
right_ear="Gifted Earring",
left_ring="Asklepian Ring",
right_ring="Sirona's Ring",
back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10',}},
}
sets.midcast.Cursna = {
ammo="Incantor Stone",
head={ name="Merlinic Hood", augments={'"Mag.Atk.Bns."+29','"Fast Cast"+7',}},
body={ name="Witching Robe", augments={'MP+25','Mag. Acc.+1',}},
legs={ name="Psycloth Lappas", augments={'MP+80','Mag. Acc.+15','"Fast Cast"+7',}},
feet={ name="Gende. Galoshes", augments={'Phys. dmg. taken -1%',}},
neck="Malison Medallion",
waist="Gishdubar Sash",
left_ear="Gifted Earring",
right_ear="Calamitous Earring",
left_ring="Ephedra Ring",
back="Solemnity Cape",
}
sets.midcast['Enhancing Magic'] = { ammo="Incantor Stone",
head="Nares Cap",
body={ name="Telchine Chas.", augments={'Enh. Mag. eff. dur. +8',}},
hands={ name="Chironic Gloves", augments={'"Mag.Atk.Bns."+5','"Drain" and "Aspir" potency +5','CHR+15',}},
legs={ name="Telchine Braconi", augments={'Enh. Mag. eff. dur. +10',}},
feet={ name="Telchine Pigaches", augments={'"Fast Cast"+3','Enh. Mag. eff. dur. +7',}},
neck="Twilight Torque",
waist="Luminary Sash",
left_ear="Gifted Earring",
right_ear="Calamitous Earring",
left_ring="Vertigo Ring",
right_ring="Ephedra Ring",
back="Perimede Cape",
}
sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {ear1="Earthcry earring",legs="Haven hose",neck="Nodens gorget"})
sets.midcast.Storm = set_combine(sets.midcast['Enhancing Magic'], {feet="Pedagogy Loafers"})
sets.midcast.Protect = {}
sets.midcast.Protectra = sets.midcast.Protect
sets.midcast.Shell = {}
sets.midcast.Shellra = sets.midcast.Shell
-- Custom spell classes
sets.midcast.MndEnfeebles = {ammo="Mana ampulla",
head="Jhakri coronal +1",neck="Imbodla Necklace",ear1="Barkarole Earring",ear2="Lifestorm Earring",
body="Vanya Robe",hands="Jhakri cuffs +1",ring1="Sirona's ring",ring2="Acumen Ring",
back="Lugh's cape",waist="Luminary sash",legs="Psycloth Lappas",feet="Jhakri pigaches +1"}
sets.midcast.IntEnfeebles = {ammo="Mana ampulla",
head="Jhakri coronal +1",neck="Imbodla Necklace",ear1="Friomisi Earring",ear2="Barkarole Earring",
body="Vanya Robe",hands="Jhakri cuffs +1",ring1="Shiva Ring",ring2="Acumen Ring",
back="Lugh's cape",waist="Luminary sash",legs="Psycloth Lappas",feet="Jhakri pigaches +1"}
sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
sets.midcast['Dark Magic'] = {ammo="Mana ampulla",
head="Pixie Hairpin +1",neck="Sanctity necklace",ear1="Barkarole Earring",ear2="Lifestorm Earring",
body="Jhakri robe +1",hands="Jhakri cuffs +1",ring1="Sirona's ring",ring2="Acumen Ring",
back="Lugh's cape",waist="Luminary sash",legs="jhakri slops +1",feet="Jhakri pigaches +1"}
sets.midcast.Kaustra = {ammo="Ghastly Tathlum",
head="Pixie Hairpin +1",neck="Sanctity necklace",ear1="Barkarole Earring",ear2="Static earring",
body="Jhakri robe +1",hands="Amalric gages",ring1="Mujin Band",ring2="Locus ring",
back="Lugh's cape",waist="Luminary sash",legs=SCH_mb_legs,feet="Jhakri pigaches +1"}
sets.midcast.Kaustra.MB = {ammo="Ghastly Tathlum",
head="Pixie Hairpin +1",neck=SCH_mb_neck,ear1="Barkarole Earring",ear2="Static earring",
body="Jhakri robe +1",hands="Amalric gages",ring1="Mujin Band",ring2="Locus ring",
back="Lugh's cape",waist="Luminary sash",legs=SCH_mb_legs,feet="Jhakri pigaches +1"}
sets.midcast.Drain = {ammo="Mana ampulla",
head="Pixie Hairpin +1",neck="Stoicheion medal",ear1="Barkarole Earring",ear2="Lifestorm Earring",
body="Jhakri robe +1",hands="Jhakri cuffs +1",ring1="Sirona's ring",ring2="Acumen Ring",
back="Lugh's cape",waist="Luminary sash",legs="jhakri slops +1",feet="Merlinic crackows"}
sets.midcast.Aspir = sets.midcast.Drain
sets.midcast.Stun = {}
-- Elemental Magic sets are default for handling low-tier nukes.
sets.midcast['Elemental Magic'] = {ammo="Ghastly Tathlum",
head="Jhakri coronal +1",neck="Sanctity necklace",ear1="Barkarole Earring",ear2="Friomisi Earring",
body="Jhakri robe +1",hands="Jhakri cuffs +1",ring1="Shiva Ring",ring2="Acumen Ring",
back="Lugh's cape",waist="Luminary sash",legs="jhakri slops +1",feet="Jhakri pigaches +1"}
sets.midcast['Elemental Magic'].MB = {ammo="Ghastly Tathlum",
head=SCH_mb_head,neck=SCH_mb_neck,ear1="Barkarole Earring",ear2="Static earring",
body="Jhakri robe +1",hands="Amalric gages",ring1="Mujin Band",ring2="Locus ring",
back="Lugh's cape",waist="Luminary sash",legs=SCH_mb_legs,feet="Jhakri pigaches +1"}
-- Custom refinements for certain nuke tiers
--sets.midcast['Elemental Magic'].HighTierNuke = set_combine(sets.midcast['Elemental Magic'])
--sets.midcast['Elemental Magic'].HighTierNuke.MB = set_combine(sets.midcast['Elemental Magic'].MB)
sets.midcast.Impact = {}
sets.midcast.Helix = {ammo="Ghastly Tathlum",
head="Jhakri coronal +1",neck="Sanctity necklace",ear1="Barkarole Earring",ear2="Friomisi Earring",
body="Jhakri robe +1",hands="Jhakri cuffs +1",ring1="Shiva Ring",ring2="Acumen Ring",
back="Lugh's cape",waist="Luminary sash",legs="jhakri slops +1",feet="Jhakri pigaches +1"}
sets.midcast.Helix.MB = {ammo="Ghastly Tathlum",
head=SCH_mb_head,neck=SCH_mb_neck,ear1="Barkarole Earring",ear2="Static earring",
body="Jhakri robe +1",hands="Amalric gages",ring1="Mujin Band",ring2="Locus ring",
back="Lugh's cape",waist="Luminary sash",legs=SCH_mb_legs,feet="Jhakri pigaches +1"}
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {}
-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
sets.precast.WS['Myrkr']={
ammo=SCH_whale_ammo,
head=SCH_whale_head,
body=SCH_whale_body,
hands=SCH_whale_hands,
legs=SCH_whale_legs,
feet=SCH_whale_feet,
neck=SCH_whale_neck,
waist=SCH_whale_waist,
left_ear=SCH_whale_left_ear,
right_ear=SCH_whale_right_ear,
left_ring=SCH_whale_left_ring,
right_ring=SCH_whale_right_ring,
back=SCH_whale_back}
sets.idle.Town = {ammo="Incantor stone",
head="Jhakri coronal +1",neck="Sanctity necklace",ear1="Infused earring",ear2="Friomisi Earring",
body="Jhakri robe +1",hands="Jhakri cuffs +1",ring1="shneddick ring",ring2="Shiva Ring",
back="Lugh's cape",waist="Luminary sash",legs="Assiduity pants +1",feet="Jhakri pigaches +1"}
sets.idle.Field = {ammo="Incantor stone",
head="Jhakri coronal +1",neck="Sanctity necklace",ear1="Infused earring",ear2="Lifestorm earring",
body="Jhakri robe +1",hands="Jhakri cuffs +1",ring1="Ephedra ring",ring2="shneddick ring",
back="Solemnity cape",waist="Luminary sash",legs="Assiduity pants +1",feet="Jhakri pigaches +1"}
sets.idle.Field.PDT = {
ammo="Brigantia Pebble",
head={ name="Gende. Caubeen", augments={'Phys. dmg. taken -3%',}},
body={ name="Hagondes Coat +1", augments={'Phys. dmg. taken -4%','Magic dmg. taken -2%','Pet: Attack+21 Pet: Rng.Atk.+21',}},
hands={ name="Hagondes Cuffs +1", augments={'Phys. dmg. taken -4%','Pet: Accuracy+22 Pet: Rng. Acc.+22',}},
legs={ name="Artsieq Hose", augments={'"Mag.Atk.Bns."+25','Mag. Evasion+10','Phys. dmg. taken -5',}},
feet="Battlecast Gaiters",
neck="Twilight Torque",
waist="Isa Belt",
left_ear="Handler's Earring",
right_ear="Mendi. Earring",
left_ring="Vertigo Ring",
right_ring="Gelatinous Ring",
back="Solemnity Cape"}
sets.idle.Field.Stun = {}
sets.idle.Weak = {}
-- Defense sets
sets.defense.PDT = {
ammo="Brigantia Pebble",
head={ name="Gende. Caubeen", augments={'Phys. dmg. taken -3%',}},
body={ name="Hagondes Coat +1", augments={'Phys. dmg. taken -4%','Magic dmg. taken -2%','Pet: Attack+21 Pet: Rng.Atk.+21',}},
hands={ name="Hagondes Cuffs +1", augments={'Phys. dmg. taken -4%','Pet: Accuracy+22 Pet: Rng. Acc.+22',}},
legs={ name="Artsieq Hose", augments={'"Mag.Atk.Bns."+25','Mag. Evasion+10','Phys. dmg. taken -5',}},
feet="Battlecast Gaiters",
neck="Twilight Torque",
waist="Isa Belt",
left_ear="Handler's Earring",
right_ear="Mendi. Earring",
left_ring="Vertigo Ring",
right_ring="Gelatinous Ring",
back="Solemnity Cape"}
sets.defense.MDT = {}
sets.Kiting = {ring1="shneddick ring"}
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 = {ammo="Incantor stone",
head="Jhakri coronal +1",neck="Sanctity necklace",ear1="Infused earring",ear2="Lifestorm earring",
body="Jhakri robe +1",hands="Jhakri cuffs +1",ring1="Ephedra ring",ring2="shneddick ring",
back="Solemnity cape",waist="Luminary sash",legs="Assiduity pants +1",feet="Jhakri pigaches +1"}
sets.engaged.PDT = {
ammo="Brigantia Pebble",
head={ name="Gende. Caubeen", augments={'Phys. dmg. taken -3%',}},
body={ name="Hagondes Coat +1", augments={'Phys. dmg. taken -4%','Magic dmg. taken -2%','Pet: Attack+21 Pet: Rng.Atk.+21',}},
hands={ name="Hagondes Cuffs +1", augments={'Phys. dmg. taken -4%','Pet: Accuracy+22 Pet: Rng. Acc.+22',}},
legs={ name="Artsieq Hose", augments={'"Mag.Atk.Bns."+25','Mag. Evasion+10','Phys. dmg. taken -5',}},
feet="Battlecast Gaiters",
neck="Twilight Torque",
waist="Isa Belt",
left_ear="Handler's Earring",
right_ear="Mendi. Earring",
left_ring="Vertigo Ring",
right_ring="Gelatinous Ring",
back="Solemnity Cape"}
-- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
sets.buff['Ebullience'] = {head="Savant's Bonnet +2"}
sets.buff['Rapture'] = {head="Savant's Bonnet +2"}
sets.buff['Perpetuance'] = {hands="Arbatel bracers +1"}
sets.buff['Immanence'] = {hands="Savant's Bracers +2"}
sets.buff['Penury'] = {legs="Savant's Pants +2"}
sets.buff['Parsimony'] = {legs="Savant's Pants +2"}
sets.buff['Celerity'] = {feet="Argute Loafers"}
sets.buff['Alacrity'] = {feet="Argute Loafers"}
sets.buff['Klimaform'] = {feet="Arbatel Loafers +1"}
sets.buff.FullSublimation = {}
sets.buff.PDTSublimation = {}
--sets.buff['Sandstorm'] = {feet="Desert Boots"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
-- Run after the general midcast() is done.
function job_post_midcast(spell, action, spellMap, eventArgs)
if spellMap == 'Cure' and spell.target.type == 'SELF' then
equip(sets.self_healing)
end
if spell.action_type == 'Magic' then
apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
end
if spell.skill == 'Elemental Magic' then
if (spell.element == world.day_element or spell.element == world.weather_element) and spellMap ~= 'Helix' then
equip({waist="Hachirin-No-Obi"})
add_to_chat(8,'----- Obi Equipped. -----')
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 and spell.element == world.weather_element then
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
-- 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 == '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
-- Gets the current number of available strategems based on the recast remaining
-- and the level of the sch.
function get_current_strategem_count()
-- returns recast in seconds.
local allRecasts = windower.ffxi.get_ability_recasts()
local stratsRecast = allRecasts[231]
local maxStrategems = (player.main_job_level + 10) / 20
local fullRechargeTime = 4*60
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()
set_macro_page(1, 20)
end
Empty sets:
Code -------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
--[[
Custom 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 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('Normal','PDT')
state.CastingMode:options('Normal', 'MB')
state.IdleMode:options('Normal', 'PDT')
info.Helix = S{"Geohelix","Hydrohelix","Anemohelix","Pyrohelix","Cryohelix","Ionohelix","Luminohelix","Noctohelix",
"Geohelix II","Hydrohelix II","Anemohelix II","Pyrohelix II","Cryohelix II","Ionohelix II","Luminohelix II","Noctohelix II"}
send_command('bind ^q gs c cycle CastingMode')
send_command('bind ^e gs c cycle OffenseMode')
send_command('bind ^` input /ma Stun <t>')
send_command('bind %q input /ma "Utsusemi: Ichi" <me>')
send_command('bind %e input /ma "Utsusemi: Ni" <me>')
send_command('bind %b input /ja sublimation <me>')
select_default_macro_book()
end
function user_unload()
send_command('unbind ^`')
send_command('unbind ^q')
send_command('unbind ^e')
send_command('unbind ^b')
send_command('unbind ^q')
send_command('unbind ^e')
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['Tabula Rasa'] = {}
-- Fast cast sets for spells
sets.precast.FC = {}
sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {})
sets.precast.FC.Stoneskin = {}
sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {})
sets.precast.FC.Cure = set_combine(sets.precast.FC, {})
sets.precast.FC.Curaga = sets.precast.FC.Cure
sets.precast.FC.Impact = set_combine(sets.precast.FC['Elemental Magic'], {head=empty,body="Twilight Cloak"})
-- Midcast Sets
sets.midcast.FastRecast = {}
sets.midcast.Cure = {}
sets.midcast.CureWithLightWeather = {}
sets.midcast.Curaga = sets.midcast.Cure
sets.midcast.Regen = {}
sets.midcast.Cursna = {}
sets.midcast['Enhancing Magic'] = {}
sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {})
sets.midcast.Storm = set_combine(sets.midcast['Enhancing Magic'], {})
sets.midcast.Protect = {}
sets.midcast.Protectra = sets.midcast.Protect
sets.midcast.Shell = {}
sets.midcast.Shellra = sets.midcast.Shell
-- Custom spell classes
sets.midcast.MndEnfeebles = {}
sets.midcast.IntEnfeebles = {}
sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
sets.midcast['Dark Magic'] = {}
sets.midcast.Kaustra = {}
sets.midcast.Kaustra.MB = {}
sets.midcast.Drain = {}
sets.midcast.Aspir = sets.midcast.Drain
sets.midcast.Stun = {}
-- Elemental Magic sets are default for handling low-tier nukes.
sets.midcast['Elemental Magic'] = {}
sets.midcast['Elemental Magic'].MB = {}
-- Custom refinements for certain nuke tiers
--sets.midcast['Elemental Magic'].HighTierNuke = set_combine(sets.midcast['Elemental Magic'])
--sets.midcast['Elemental Magic'].HighTierNuke.MB = set_combine(sets.midcast['Elemental Magic'].MB)
sets.midcast.Impact = {}
sets.midcast.Helix = {}
sets.midcast.Helix.MB = {}
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {}
-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
sets.precast.WS['Myrkr']={}
sets.idle.Town = {}
sets.idle.Field = {}
sets.idle.Field.PDT = {}
sets.idle.Field.Stun = {}
sets.idle.Weak = {}
-- Defense sets
sets.defense.PDT = {}
sets.defense.MDT = {}
sets.Kiting = {}
sets.latent_refresh = {}
-- 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 = {}
sets.engaged.PDT = {}
-- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
sets.buff['Ebullience'] = {}
sets.buff['Rapture'] = {}
sets.buff['Perpetuance'] = {}
sets.buff['Immanence'] = {}
sets.buff['Penury'] = {}
sets.buff['Parsimony'] = {}
sets.buff['Celerity'] = {}
sets.buff['Alacrity'] = {}
sets.buff['Klimaform'] = {}
sets.buff.FullSublimation = {}
sets.buff.PDTSublimation = {}
--sets.buff['Sandstorm'] = {feet="Desert Boots"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
-- Run after the general midcast() is done.
function job_post_midcast(spell, action, spellMap, eventArgs)
if spellMap == 'Cure' and spell.target.type == 'SELF' then
equip(sets.self_healing)
end
if spell.action_type == 'Magic' then
apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
end
if spell.skill == 'Elemental Magic' then
if (spell.element == world.day_element or spell.element == world.weather_element) and spellMap ~= 'Helix' then
equip({waist="Hachirin-No-Obi"})
add_to_chat(8,'----- Obi Equipped. -----')
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 and spell.element == world.weather_element then
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
-- 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 == '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
-- Gets the current number of available strategems based on the recast remaining
-- and the level of the sch.
function get_current_strategem_count()
-- returns recast in seconds.
local allRecasts = windower.ffxi.get_ability_recasts()
local stratsRecast = allRecasts[231]
local maxStrategems = (player.main_job_level + 10) / 20
local fullRechargeTime = 4*60
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()
set_macro_page(1, 20)
end
And for those more experienced, any advice that you might be able to give is very much appreciated. I'm very happy with how this LUA works thus far.
|
|