|
Gearswap Support Thread
By Calinari 2016-10-18 01:24:51
Can someone show me what to add for a TH tag mode like on the THF gs?
So that first hit is chaac belt etc for other jobs
Asura.Hitome
サーバ: Asura
Game: FFXI
Posts: 59
By Asura.Hitome 2016-10-18 19:13:06
Ragnarok.Flippant said: »The only issue I know with rings is if you're already wearing one of the rings, Gearswap will cancel equipping both rings. I could've sworn I reported this to Byrth years ago, but I can't find it so I must've not submitted after all... I looked just now and the issue appears to be when it gets rid of "redundancies," canceling gear if it determines that same piece is currently equipped; this is because it's selecting the same exact item (by ID) for both rings, which is the real problem. I'll take another look tomorrow and see if I can think of something to fix that.
Note that the order that you put elements in a table has no effect on anything, specifically because of the way tables work. But you could try assigning different priorities. i.e. ring1={name="Ramuh's ring",priority=16}; items with higher priority are equipped first. I assume this won't fix it.
On this topic: has there been any method developed to swap ears or rings if they are already equipped? Is GS fast enough to do that?
I've been pretty good so far about always making sure a specific ring or earring is in my right or left slot. I've been consistent throughout all my files. But finally, I ran into an issue in my BLU lua.
For most jobs I use the following convention:
ear1="Suppanomimi"
ear2="Brutal Earring"
ear2="Cessance Earring"
The problem arises when I need to TP in Cessance Earring and also WS with it. So either it needs to go into ear1 while Brutal stays in ear2 or my engaged.ACC needs to change in some other way.
Any ideas? The priority system in the quote didn't seem to work for me.
Ragnarok.Flippant
サーバ: Ragnarok
Game: FFXI
Posts: 660
By Ragnarok.Flippant 2016-10-18 21:00:46
Can't do it. At the point right before the final determined equip set is about to be pushed, GS goes over the items; if any of them target a specific inventory slot that is currently equipped (or will be at the time of the event), it will just cancel equipping that slot.
For solving the issue I mentioned, at the point it is selecting the item's inventory ID, it needs to check if its equipped, and if it is, look for another item by that name in a different inventory slot; if found, select it, if not then cancel. That said, the redundancy checking can just be moved to this stage instead. (I'm mostly writing this as a note to either myself or someone interested in writing the solution.)
For allowing a user to equip earring immediately into another slot, there would first be the question of whether that's a "legal" move. I'm going to guess not, or Byrth probably would've done that. Likewise, if using priority was a solution, I would assume that he wouldn't have it canceling it out.
It's not ideal, but you could set either bogus earrings or no earrings in precast and equip your WS sets in midcast. Still going to mess up when changing back to TP, though, unless you set something bogus in aftercast, then use send_command to issue a gs command to call your status change.
[+]
Asura.Hitome
サーバ: Asura
Game: FFXI
Posts: 59
By Asura.Hitome 2016-10-18 21:59:14
Thanks for the answer, Flippant! Adding a line for midcast seems like a good solution. Maybe even just a line to switch ears or a toggle to do so.
By Brynach 2016-10-24 18:42:44
I have a small issue with a rule concerning swapping in gear for time of day and when tp <2950:
Code function job_post_precast(spell, action, spellMap, eventArgs)
if spell.type == 'WeaponSkill' then
if world.time >= (17*60) or world.time <= (7*60) then
equip({ear1="Lugra Earring +1",ear2="Lugra Earring"})
else
if moonshade_WS:contains(spell.english) and player.tp<2950 then
equip({ear2="Moonshade Earring"})
end
end
end
end
It works to pull in moonshade if tp is under 2950, and it works from dusk to dawn pulling in Lugra +1 and Lugra. The issue I am having is when it is nighttime and tp is under 2950. I think I could use some assistance working this out if anyone doesnt mind.
Odin.Lygre
サーバ: Odin
Game: FFXI
Posts: 89
By Odin.Lygre 2016-10-24 19:38:49
Code function job_post_precast(spell, action, spellMap, eventArgs)
if spell.type == 'WeaponSkill' then
if world.time >= (17*60) or world.time <= (7*60) then
equip({ear1="Lugra Earring +1",ear2="Lugra Earring"})
end
if moonshade_WS:contains(spell.english) and player.tp<2950 then
equip({ear2="Moonshade Earring"})
end
end
end
By RolandJ 2016-10-24 21:08:23
Code function job_post_precast(spell, action, spellMap, eventArgs)
if spell.type == 'WeaponSkill' then
if world.time >= (17*60) or world.time <= (7*60) then
equip({ear1="Lugra Earring +1",ear2="Lugra Earring"})
else --*****PAY ATTENTION TO THIS!******-- o.o
if moonshade_WS:contains(spell.english) and player.tp<2950 then
equip({ear2="Moonshade Earring"})
end
end
end
end
What that else is doing is saying "if the world time isn't between 17:00-7:00 then do the next thing listed after the else". In other words it is explicitly saying that when the world time is between 17:00-7:00 do not do the next thing. By replacing that else with end, as Lygre suggested, you separate the time-based condition from your TP-based condition - which in fact is how you desire it to function rather than the way you had it setup to function. Stuff like that gets me sometimes too, lol ^^;
By Brynach 2016-10-24 21:28:58
Thanks. Works perfectly.
サーバ: Odin
Game: FFXI
Posts: 42
By Odin.Psycooo 2016-10-24 21:57:40
Ok, I am back with more questions....
I managed to add/define sets based of the amount of magical haste I have. So now if I have no haste it equips one set of gear, if I get haste 1 or haste 2 it equips based on value of haste all the way up to capped haste.
What I would like additionally is for it to auto equip the single wield gearset in the event I don't have a dual wield subjob, furthermore I would like a way to add in additional sets if I am using /dnc instead of my normal /nin, because the native DW traits are different I would need to add a whole bunch of rules and sets, the problem is I have NO FRIGGIN' IDEA how to do any of that. I literally stole all my haste defined rules from a thf lua and spent like 3 hours til I got it to work.
Edit: Ideally I would like to do this same thing for my terribly designed cor lua, that way I don't have to cycle through 14 sets
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()
determine_haste_group()
state.Buff.Saboteur = buffactive.saboteur or false
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', 'Mid', 'Acc', 'SingleWield')
state.HybridMode:options('Normal', 'PhysicalDef', 'MagicalDef')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'PDT', 'MDT')
select_default_macro_book()
gear.CureStaff = {name=""}
gear.CureFeet = {name=""}
state.MagicBurst = M(false, 'Magic Burst')
state.CureHate = M(false, 'Cure Hate')
send_command('bind !` gs c toggle MagicBurst')
send_command('bind ^` gs c toggle CureHate')
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['Chainspell'] = {body="Vitivation Tabard +1"}
-- Waltz set (chr and vit)
sets.precast.Waltz = {}
-- Don't need any special gear for Healing Waltz.
sets.precast.Waltz['Healing Waltz'] = {}
-- Fast cast sets for spells
-- 80% Fast Cast (including trait) for all spells, plus 5% quick cast
-- No other FC sets necessary.
sets.precast.FC = {}
sets.precast.FC.Impact = set_combine(sets.precast.FC, {head=empty,body="Twilight Cloak"})
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {}
sets.precast.WS['Circle Blade'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Sanguine Blade'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Requiescat'] = {}
sets.precast.WS['Aeolian Edge'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Savage Blade'] = {}
sets.precast.WS['Chant du Cygne'] = {}
sets.precast.WS['True Strike'] = {}
sets.precast.WS['Exenterator'] = {}
sets.precast.WS['Evisceration'] = {}
sets.precast.WS['Death Blossom'] = {}
-- Midcast Sets
sets.midcast.Cure = {}
sets.midcast.Curaga = sets.midcast.Cure
sets.midcast.CureWeather = {}
sets.midcast.CureSelf = {}
sets.midcast.CureMelee = {}
sets.midcast['Enhancing Magic'] = {}
sets.midcast['Enhancing Magic'].Temper = {}
sets.midcast['Enhancing Magic'].RegenSelf = {}
sets.midcast['Enhancing Magic'].RefreshSelf = {}
sets.midcast['Enhancing Magic'].HasteSelf = {}
sets.midcast['Enhancing Magic'].EnSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.midcast['Enhancing Magic'].GainSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.midcast['Enhancing Magic'].BarSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.buff.ComposureOther = {head="Lethargy Chappel +1",body="Lethargy Sayon +1",
legs="Lethargy Fuseau +1",feet="Lethargy Houseaux +1"}
sets.midcast.Protect = {}
sets.midcast.Shell = sets.midcast.Protect
sets.midcast['Enhancing Magic'].Phalanx = {}
sets.midcast.Cursna = {}
sets.midcast.Stoneskin = {}
sets.midcast['Enfeebling Magic'] = {}
sets.midcast.MndEnfeebles = {}
sets.midcast.IntEnfeebles = {}
sets.midcast.Blind = {}
sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
sets.midcast.Distract = {}
sets.midcast.Frazzle = {}
sets.midcast['Distract II'] = sets.midcast.Distract
sets.midcast['Distract III'] = sets.midcast.Distract
sets.midcast['Frazzle II'] = {}
sets.midcast['Frazzle III'] = sets.midcast.Frazzle
sets.midcast['Dia III'] = set_combine(sets.midcast['Enfeebling Magic'], {head="Vitivation Chapeau +1"})
sets.midcast['Slow II'] = set_combine(sets.midcast['Enfeebling Magic'], {head="Vitivation Chapeau +1"})
sets.Lunge = {}
sets.Convert = {main="Murgleis"}
sets.midcast['Elemental Magic'] ={}
sets.midcast['Elemental Magic']['Low'] = {}
sets.midcast.Impact = set_combine(sets.midcast['Elemental Magic'], {head=empty,body="Twilight Cloak"})
sets.midcast['Stun'] = {}
sets.midcast.Drain = {}
sets.midcast.Aspir = sets.midcast.Drain
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {}
-- Idle sets
sets.idle = {}
sets.idle.Town = {}
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.Mid = {}
sets.engaged.Acc = {}
sets.engaged.SingleWield = {}
sets.engaged.Evasion = sets.engaged
sets.engaged.Mid.Evasion = sets.engaged.Mid
sets.engaged.Acc.Evasion = sets.engaged.Acc
sets.engaged.PDT = sets.defense.PDT
sets.engaged.Mid.PDT = sets.defense.MDT
sets.engaged.Acc.PDT = sets.defense.PDT
-- Haste 43%
sets.engaged.Haste_43 = set_combine(sets.engaged, {})
sets.engaged.Mid.Haste_43 = sets.engaged.Mid
sets.engaged.Acc.Haste_43 = sets.engaged.Acc
sets.engaged.Evasion.Haste_43 = sets.engaged.Haste_43
sets.engaged.PDT.Haste_43 = sets.defense.PDT
-- 40
sets.engaged.Haste_40 = set_combine(sets.engaged.Haste_43, {})
sets.engaged.Mid.Haste_40 = sets.engaged.Mid
sets.engaged.Acc.Haste_40 = sets.engaged.Acc
sets.engaged.Evasion.Haste_40 = sets.engaged.Haste_40
sets.engaged.PDT.Haste_40 = sets.defense.PDT
-- 30
sets.engaged.Haste_30 = sets.engaged
sets.engaged.Mid.Haste_30 = sets.engaged.Mid
sets.engaged.Acc.Haste_30 = sets.engaged.Acc
sets.engaged.Evasion.Haste_30 = sets.engaged
sets.engaged.PDT.Haste_30 = sets.defense.PDT
-- 25
sets.engaged.Haste_25 = set_combine(sets.engaged.Haste_30, {})
sets.engaged.Acc.Haste_25 = sets.engaged.Acc
sets.engaged.Mid.Haste_25 = sets.engaged.Mid
sets.engaged.Evasion.Haste_25 = sets.engaged
sets.engaged.PDT.Haste_25 = sets.defense.PDT
sets.magic_burst = {}
sets.cure_hate = {}
sets.Enmity = {}
-- Sets for special buff conditions on spells.
sets.buff.Saboteur = {hands="Lethargy Gantherots +1"}
end
LowNukes = S{'Stone' , 'Aero' , 'Blizzard' , 'Fire' , 'Water' , 'Thunder' ,
'Stone II' , 'Aero II' , 'Blizzard II' , 'Fire II' , 'Water II' , 'Thunder II',
'Stonega' , 'Aeroga' , 'Blizzaga' , 'Firaga' , 'Waterga' , 'Thundaga',
'Stonega II' , 'Aeroga II' , 'Blizzaga II' , 'Firaga II' , 'Waterga II' , 'Thundaga II'}
MndEnfeebles = S{'Slow' , 'Silence' , 'Paralyze' , 'Addle' , 'Slow II' , 'Paralyze II' , 'Addle II'}
IntEnfeebles = S{'Bind' , 'Break' , 'Gravity' , 'Poison' , 'Sleep' , 'Gravity II' , 'Poison II' , 'Sleep II'}
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
function job_precast(spell, action, spellMap, eventArgs)
if spell.skill == 'Healing Magic' and spellMap ~= 'StatusRemoval' then
gear.CureFeet.name = "Vanya Clogs"
if player.status == 'Engaged' then
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
if spell.target.type == 'SELF' then
gear.CureFeet.name = "Medium's Sabots"
else
gear.CureFeet.name = "Vanya Clogs"
end
else
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
end
if spell.target.type == 'SELF' then
gear.default.obi_waist = "Chuq'aba Belt"
else
gear.default.obi_waist = "Salire belt"
end
if world.weather_element == 'Light' then
gear.CureStaff.name = "Chatoyant Staff"
else
gear.CureStaff.name = "Serenity"
end
else
gear.default.obi_waist = "Salire belt"
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
end
if spell.name == 'Lunge' or spell.name == 'Swipe' then
equip(sets.Lunge)
end
if spell.name == 'Vallation' then
equip(sets.Enmity)
end
if spell.name == 'Pflug' then
equip(sets.Enmity)
end
if spell.name == 'Warcry'
or spell.name == 'Swordplay' or spell.name == 'Rayke' or spell.name == 'Meditate' or spell.name == 'Provoke' then
equip(sets.Enmity)
end
--prevents casting Utsusemi if you already have 3 or more shadows
if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) then
cancel_spell()
end
if buffactive['terror'] or buffactive['petrification'] or buffactive['stun'] or buffactive['sleep'] then
if TP_ind == 4 then
equip(sets.defense.MDT) else
equip(sets.defense.PDT)
end
end
if spell.name == 'Convert' then
equip(sets.Convert)
end
if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
cancel_spell()
send_command('input /item "Echo Drops" <me>')
end
end
-- Run after the default midcast() is done.
-- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.skill == 'Enfeebling Magic' and state.Buff.Saboteur then
equip(sets.buff.Saboteur)
elseif spell.skill == 'Enhancing Magic' and not spell.english == 'Stoneskin' then
equip(sets.midcast.EnhancingDuration)
if buffactive.composure and spell.target.type == 'PLAYER' then
equip(sets.buff.ComposureOther)
end
elseif spellMap == 'Cure' then
if spell.target.type == 'SELF' then
equip(sets.midcast.CureSelf)
end
if state.CureHate.value then
equip(sets.cure_hate)
end
if world.weather_element == 'Light' then
equip(sets.midcast.CureWeather)
end
elseif spell.skill == 'Elemental Magic' then
if state.MagicBurst.value then
equip(sets.magic_burst)
end
if spell.element == world.day_element or spell.element == world.weather_element then
equip({waist="Hachirin-no-Obi"})
end
elseif spell.skill == "Ninjutsu" then
equip(sets.midcast.Recast)
if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' then
if buffactive['Copy Image'] then
windower.ffxi.cancel_buff(66)
elseif buffactive['Copy Image (2)'] then
windower.ffxi.cancel_buff(444)
elseif buffactive['Copy Image (3)'] then
windower.ffxi.cancel_buff(445)
elseif buffactive['Copy Image (4+)'] then
windower.ffxi.cancel_buff(446)
end
elseif spell.name == 'Monomi: Ichi' and buffactive.Sneak and spell.target.type == 'SELF' then
windower.ffxi.cancel_buff(71)
end
end
if spell.name == 'Foil' or spell.name == 'Flash' or spell.name == 'Blank Gaze'
or spell.name == 'Geist Wall' or spell.name == 'Poison Breath' or spell.name == 'Jettatura'
or spell.name == 'Cocoon' or spell.name == 'Soporific' or spell.name == 'Sheep Song'
or spell.name == 'Refueling' then
equip(sets.Enmity)
end
end
function job_get_spell_map(spell, default_spell_map)
if spell.action_type == 'Magic' then
if spell.skill == 'Enhancing Magic' then
if spell.english:startswith('En') then
return 'EnSpells'
elseif spell.english:startswith('Gain') then
return 'GainSpells'
elseif spell.english:startswith('Phalanx') then
return 'Phalanx'
elseif spell.english:startswith('Bar') then
return 'Bar'
elseif spell.english:startswith('Temper') then
return 'Temper'
elseif spell.english:startswith('Haste') then
if spell.target.type == 'SELF' then
return 'HasteSelf'
end
elseif spell.english:startswith('Refresh') then
if spell.target.type == 'SELF' then
return 'RefreshSelf'
end
end
elseif default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
if player.status == 'Engaged' then
return "CureMelee"
end
end
if spell.action_type == 'Magic' then
if spell.skill == 'Enfeebling Magic' then
if spell.type == 'WhiteMagic' then
return 'MndEnfeebles'
else
return 'IntEnfeebles'
end
elseif spell.skill == 'Elemental Magic' then
if LowNukes:contains(spell.name) then
return 'Low'
else
return
end
end
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
if stateField == 'Offense Mode' then
if newValue == 'None' then
enable('main','sub','range')
else
disable('main','sub','range')
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- General hooks for change 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 we gain or lose any haste buffs, adjust which gear set we target.
if S{'haste','march', 'madrigal','embrava','haste samba'}:contains(buff:lower()) then
determine_haste_group()
handle_equipping_gear(player.status)
end
if state.Buff[buff] ~= nil then
state.Buff[buff] = gain
if not midaction() then
handle_equipping_gear(player.status)
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- 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 customize_melee_set(meleeSet)
if player.sub_job == 'DNC' or player.sub_job == 'NIN' then
meleeSet = set_combine(meleeSet, sets.engaged.DW)
end
return meleeSet
end
-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
display_current_caster_state()
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function determine_haste_group()
classes.CustomMeleeGroups:clear()
-- assuming +4 for marches (ghorn has +5)
-- Haste (white magic) 15%
-- Haste Samba (Sub) 5%
-- Haste (Merited DNC) 10% (never account for this)
-- Victory March +0/+3/+4/+5 9.4/14%/15.6%/17.1% +0
-- Advancing March +0/+3/+4/+5 6.3/10.9%/12.5%/14% +0
-- Embrava 30% with 500 enhancing skill
-- Mighty Guard - 15%
-- buffactive[580] = geo haste
-- buffactive[33] = regular haste
-- buffactive[604] = mighty guard
-- state.HasteMode = toggle for when you know Haste II is being cast on you
-- Hi = Haste II is being cast. This is clunky to use when both haste II and haste I are being cast
if ( ( (buffactive[33] or buffactive[580] or buffactive.embrava) and (buffactive.march or buffactive[604]) ) or
( buffactive[33] and (buffactive[580] or buffactive.embrava) ) or
( buffactive.march == 2 and buffactive[604] ) ) then
add_to_chat(8, '-------------Haste 43%-------------')
classes.CustomMeleeGroups:append('Haste_43')
elseif buffactive.embrava and buffactive.haste then
add_to_chat(8, '-------------Haste 40%-------------')
classes.CustomMeleeGroups:append('Haste_40')
elseif ( (buffactive[33] or buffactive.march == 2 or buffactive[580]) and buffactive['haste samba'] ) then
add_to_chat(8, '-------------Haste 35%-------------')
classes.CustomMeleeGroups:append('Haste_35')
elseif ( ( buffactive[580] or buffactive[33] or buffactive.march == 2 ) or
( buffactive.march == 1 and buffactive[604] ) ) then
add_to_chat(8, '-------------Haste 30%-------------')
classes.CustomMeleeGroups:append('Haste_30')
elseif ( buffactive.march == 1 or buffactive[604] ) then
add_to_chat(8, '-------------Haste 15%-------------')
classes.CustomMeleeGroups:append('Haste_15')
elseif ( buffactive[580] and ( buffactive.march or buffactive[33] or buffactive.embrava or buffactive[604]) ) or -- geo haste + anything
( buffactive.embrava and (buffactive.march or buffactive[33] or buffactive[604]) ) or -- embrava + anything
( buffactive.march == 2 and (buffactive[33] or buffactive[604]) ) or -- two marches + anything
( buffactive[33] and buffactive[604] and buffactive.march ) then -- haste + mighty guard + any marches
add_to_chat(8, '-------------Max Haste Mode Enabled--------------')
classes.CustomMeleeGroups:append('Haste_43')
elseif ( (buffactive[604] or buffactive[33]) and buffactive['haste samba'] and buffactive.march == 1) or -- MG or haste + samba with 1 march
( buffactive.march == 2 and buffactive['haste samba'] ) or
( buffactive[580] and buffactive['haste samba'] ) then
add_to_chat(8, '-------------Haste 35%-------------')
classes.CustomMeleeGroups:append('Haste_35')
elseif ( buffactive.march == 2 ) or -- two marches from ghorn
( (buffactive[33] or buffactive[604]) and buffactive.march == 1 ) or -- MG or haste + 1 march
( buffactive[580] ) or -- geo haste
( buffactive[33] and buffactive[604] ) then -- haste with MG
add_to_chat(8, '-------------Haste 30%-------------')
classes.CustomMeleeGroups:append('Haste_30')
elseif buffactive[33] or buffactive[604] or buffactive.march == 1 then
add_to_chat(8, '-------------Haste 15%-------------')
classes.CustomMeleeGroups:append('Haste_15')
end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
-- Default macro set/book
if player.sub_job == 'DNC' then
set_macro_page(2, 4)
elseif player.sub_job == 'WHM' then
set_macro_page(3, 4)
elseif player.sub_job == 'NIN' then
set_macro_page(10, 4)
elseif player.sub_job == 'THF' then
set_macro_page(4, 4)
elseif player.sub_job == 'BLM' then
set_macro_page(5, 4)
else
set_macro_page(1, 4)
end
end
Bismarck.Mitchel
サーバ: Bismarck
Game: FFXI
Posts: 153
By Bismarck.Mitchel 2016-10-25 17:41:09
Could anyone help explain how I would go about adding a new cycle to my gearswap, e.g lowacc/midacc, for Quick Draw (STP/Resistant etc)?
-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
--[[
Custom commands:
gs c shot
Uses the currently configured shot on the target, with either <t> or <stnpc> depending on setting.
gs c shot t
Uses the currently configured shot on the target, but forces use of <t>.
Configuration commands:
gs c cycle mainshot
Cycles through the available steps to use as the primary shot when using one of the above commands.
gs c cycle altshot
Cycles through the available steps to use for alternating with the configured main shot.
gs c toggle usealtshot
Toggles whether or not to use an alternate shot.
gs c toggle selectshottarget
Toggles whether or not to use <stnpc> (as opposed to <t>) when using a shot.
gs c toggle LuzafRing -- Toggles use of Luzaf Ring on and off
Offense mode is melee or ranged. Used ranged offense mode if you are engaged
for ranged weaponskills, but not actually meleeing.
Weaponskill mode, if set to 'Normal', is handled separately for melee and ranged weaponskills.
--]]
-- Initialization function for this job file.
function get_sets()
mote_include_version = 2
-- Load and initialize the include file.
include('Mote-Include.lua')
include('Mote-Globals.lua')
end
-- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
function job_setup()
-- QuickDraw Selector
state.MainShot = M{['description']='Primary Shot', 'Dark Shot', 'Earth Shot', 'Water Shot', 'Wind Shot', 'Fire Shot', 'Ice Shot', 'Thunder Shot'}
state.AltShot = M{['description']='Secondary Shot', 'Earth Shot', 'Water Shot', 'Wind Shot', 'Fire Shot', 'Ice Shot', 'Thunder Shot', 'Dark Shot'}
state.UseAltShot = M(false, 'Use Secondary Shot')
state.SelectShotTarget = M(false, 'Select Quick Draw Target')
state.IgnoreTargetting = M(false, 'Ignore Targetting')
state.CurrentShot = M{['description']='Current Quick Draw', 'Main', 'Alt'}
-- Whether to use Luzaf's Ring
state.LuzafRing = M(false, "Luzaf's Ring")
-- Whether a warning has been given for low ammo
state.warned = M(false)
define_roll_values()
determine_haste_group()
end
-------------------------------------------------------------------------------------------------------------------
-- User setup functions for this job. Recommend that these be overridden in a sidecar file.
-------------------------------------------------------------------------------------------------------------------
-- Setup vars that are user-dependent. Can override this function in a sidecar file.
function user_setup()
state.OffenseMode:options('Normal', 'LowAcc', 'MidAcc', 'HighAcc', 'Fodder')
state.RangedMode:options('Normal', 'Acc', 'Fodder')
state.WeaponskillMode:options('Normal', 'Acc')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'DT')
gear.RAbullet = "Adlivun Bullet"
gear.WSbullet = "Adlivun Bullet"
gear.MAbullet = "Orichalc. Bullet"
gear.QDbullet = "Animikii Bullet"
options.ammo_warning_limit = 5
-- Additional local binds
send_command('bind ^` input /ja "Double-up" <me>')
send_command('bind !` input /ja "Bolter\'s Roll" <me>')
send_command ('bind @` gs c toggle LuzafRing')
send_command('bind ^- gs c cycleback mainshot')
send_command('bind ^= gs c cycle mainshot')
send_command('bind !- gs c cycle altshot')
send_command('bind != gs c cycleback altshot')
send_command('bind ^[ gs c toggle selectshottarget')
send_command('bind ^] gs c toggle usealtshot')
send_command('bind ^, input /ja "Spectral Jig" <me>')
send_command('unbind ^.')
select_default_macro_book()
end
-- Called when this job file is unloaded (eg: job change)
function user_unload()
send_command('unbind ^`')
send_command('unbind !`')
send_command('unbind @`')
send_command('unbind ^-')
send_command('unbind ^=')
send_command('unbind !-')
send_command('unbind !=')
send_command('unbind ^[')
send_command('unbind ^]')
send_command('unbind ^,')
end
-- Define sets and vars used by this job file.
function init_gear_sets()
--------------------------------------
-- Start defining the sets
--------------------------------------
-- Augmented Gear
-- Herculean
gear.Herc_MAB_Head = {name="Herculean Helm", augments={'Mag. Acc.+20 "Mag.Atk.Bns."+20','INT+7','"Mag.Atk.Bns."+11',}}
gear.Herc_TP_Gloves = {name="Herculean Gloves", augments={'Accuracy+30','"Triple Atk."+3','DEX+3',}}
gear.Herc_TP_Legs = {name="Herculean Trousers", augments={'Attack+23','"Triple Atk."+4','STR+3','Accuracy+8',}}
gear.Herc_MAB_Legs = { name="Herculean Trousers", augments={'"Mag.Atk.Bns."+25','Weapon skill damage +3%','MND+10',}}
gear.Herc_MAB_Feet = {name="Herculean Boots", augments={'Mag. Acc.+18 "Mag.Atk.Bns."+18','STR+10','Mag. Acc.+11','"Mag.Atk.Bns."+12',}}
gear.Herc_TP_Feet = {name="Herculean Boots", augments={'Accuracy+27','"Triple Atk."+2','DEX+7',}}
-- Taeon
gear.Taeon_WS_Head = {name="Taeon Chapeau", augments={'Mag. Acc.+15 "Mag.Atk.Bns."+15','Weapon skill damage +2%',}}
gear.Taeon_TP_Head = {name="Taeon Chapeau", augments={'Accuracy+23','"Triple Atk."+1',}}
gear.Taeon_TP_Legs = {name="Taeon Tights", augments={'Accuracy+23','"Triple Atk."+2',}}
-- Ambuscade Capes
gear.COR_WS_Cape = {name="Camulus's Mantle", augments={'AGI+20','Mag. Acc+20 /Mag. Dmg.+20','Weapon skill damage +10%',}}
gear.COR_WS2_Cape = {name="Ankou's Mantle", augments={'STR+20','Accuracy+20 Attack+20','Weapon skill damage +10%',}}
gear.COR_TP_Cape = { name="Camulus's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10',}}
-- Precast Sets
sets.precast.JA['Triple Shot'] = {body="Chasseur's Frac",back=gear.COR_WS_Cape}
sets.precast.JA['Snake Eye'] = {legs="Commodore Culottes +2"}
sets.precast.JA['Wild Card'] = {feet="Lanun Bottes +1"}
sets.precast.JA['Random Deal'] = {body="Lanun Frac +1"}
sets.precast.CorsairRoll = {
head="Lanun Tricorne",
body="Meg. Cuirie +1",
hands="Chasseur's Gants",
legs="Desultor Tassets",
feet="Lanun Bottes +1",
neck="Twilight Torque",
ear1="Darkness earring",
ear2="Darkness earring",
ring1="Luzaf's Ring",
ring2="Barataria Ring",
back="Camulus's Mantle",
waist="Flume Belt",
}
-- sets.precast.CorsairRoll["Caster's Roll"] = set_combine(sets.precast.CorsairRoll, {legs="Chas. Culottes"})
sets.precast.CorsairRoll["Courser's Roll"] = set_combine(sets.precast.CorsairRoll, {feet="Chass. Bottes"})
sets.precast.CorsairRoll["Blitzer's Roll"] = set_combine(sets.precast.CorsairRoll, {head="Chass. Tricorne"})
sets.precast.CorsairRoll["Tactician's Roll"] = set_combine(sets.precast.CorsairRoll, {body="Chasseur's Frac"})
sets.precast.CorsairRoll["Allies' Roll"] = set_combine(sets.precast.CorsairRoll, {hands="Chasseur's Gants"})
sets.precast.LuzafRing = {ring2="Luzaf's Ring"}
sets.precast.FoldDoubleBust = {hands="Lanun Gants"}
sets.precast.CorsairShot = {}
sets.precast.Waltz = {
hands="Slither Gloves +1",
legs="Desultor Tassets",
ring1="Asklepian Ring",
ring2="Valseur's Ring",
} -- CHR and VIT
sets.precast.Waltz['Healing Waltz'] = {}
sets.precast.FC = {
head="Carmine Mask", --12
body="Taeon Tabard", --7
hands="Leyline Gloves", --8
legs="Rawhide Trousers", --5
feet="Carmine Greaves", --7
neck="Orunmila's Torque", --5
ear1="Loquacious Earring", --2
ear2="Halasz Earring", --1
ring1="Prolix Ring", --2
ring2="Weatherspoon ring", --5(3)
waist="Flume belt",
}
sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {
neck="Magoraga Beads",
ring1="Lebeche Ring",
})
sets.precast.RA = {
ammo=gear.RAbullet,
head="Aurore Beret +1", --5
body="Pursuer's Doublet", --6
hands="Carmine Fin. Ga. +1", --8
legs="Chasseur's culottes", --6
feet="Meg. Jam. +1", --8
back="Navarch's Mantle", --6.5
waist="Impulse Belt", --3
}
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {
ammo=gear.WSbullet,
head="Meghanada Visor +1",
body="Meg. Cuirie +1",
hands="Meghanada gloves +1",
legs="Meg. Chausses +1",
feet="Meg. Jam. +1",
neck="Fotia Gorget",
ear1="Moonshade Earring",
ear2="Ishvara Earring",
ring1="Arvina Ringlet +1",
ring2="Garuda Ring",
back=gear.COR_WS_Cape,
waist="Fotia belt",
}
sets.precast.WS.Acc = set_combine(sets.precast.WS, {
hands="Meg. Gloves +1",
})
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS["Last Stand"] = set_combine(sets.precast.WS['Last Stand'], {
hands="Meg. Gloves +1",
ring1="Garuda Ring",
})
sets.precast.WS['Last Stand'].Acc = set_combine(sets.precast.WS['Last Stand'], {
ammo=gear.WSbullet,
hands="Meg. Gloves +1",
ear2="Volley Earring",
ring1="Cacoethic Ring +1",
back="Gunslinger's cape",
})
sets.precast.WS['Wildfire'] = {
ammo=gear.MAbullet,
head=gear.Herc_MAB_Head,
body="Samnuha Coat",
hands="Carmine Fin. Ga. +1",
legs=gear.Herc_MAB_Legs,
feet=gear.Herc_MAB_Feet,
neck="Sanctity Necklace",
ear1="Hecate's Earring",
ear2="Friomisi Earring",
ring1="Arvina Ringlet +1",
ring2="Garuda Ring",
back=gear.COR_WS_Cape,
waist="Eschan Stone",
}
sets.precast.WS['Leaden Salute'] = {
ammo=gear.MAbullet,
head="Pixie Hairpin +1",
body="Samnuha Coat",
hands="Carmine Fin. Ga. +1",
legs=gear.Herc_MAB_Legs,
feet=gear.Herc_MAB_Feet,
neck="Sanctity Necklace",
ear1="Moonshade Earring",
ear2="Friomisi Earring",
ring1="Archon Ring",
ring2="Arvina Ringlet +1",
back=gear.COR_WS_Cape,
waist="Eschan Stone",
}
sets.precast.WS['Aeolian Edge'] = {
ammo=gear.MAbullet,
head=gear.Herc_MAB_Head,
body="Samnuha Coat",
hands="Leyline gloves",
legs=gear.Herc_MAB_Legs,
feet=gear.Herc_MAB_Feet,
neck="Sanctity Necklace",
ear1="Hecate's Earring",
ear2="Friomisi Earring",
ring1="Arvina Ringlet +1",
ring2="Garuda Ring",
back=gear.COR_WS_Cape,
waist="Eschan Stone",
}
sets.precast.WS['Evisceration'] = {
head="",
body="Meg. Cuirie +1",
hands="Meg. Gloves +1",
legs="",
feet="",
neck="Fotia gorget",
ear1="Moonshade Earring",
ear2="Brutal Earring",
ring1="",
ring2="Epona's Ring",
back="",
waist="Fotia belt",
}
sets.precast.WS['Savage Blade'] = {
head="Meghanada Visor +1",
body="Meg. Cuirie +1",
hands="Meghanada gloves +1",
legs="Meg. Chausses +1",
feet="Rawhide boots",
neck="Caro necklace",
ear1="Moonshade Earring",
ear2="Ishvara Earring",
ring1="Ifrit Ring",
ring2="Ifrit Ring",
back=gear.COR_WS2_Cape,
waist="Prosilio belt +1",
}
sets.precast.WS['Savage Blade'].Acc = set_combine(sets.precast.WS['Savage Blade'], {
ring1="Rufescent Ring",
waist="Grunfeld Rope",
})
sets.precast.WS['Requiescat'] = set_combine(sets.precast.WS['Savage Blade'], {
neck="Fotia gorget",
ring1="Rufescent Ring",
ring2="Epona's Ring",
back="Bleating Mantle",
waist="Fotia Belt",
}) --MND
sets.precast.WS['Requiescat'].Acc = set_combine(sets.precast.WS['Requiescat'], {
head="Carmine Mask"
})
-- Midcast Sets
sets.midcast.CorsairRoll = {
head="Lanun Tricorne",
body="Meg. Cuirie +1",
hands="Chasseur's Gants",
legs="Desultor Tassets",
feet="Lanun Bottes +1",
neck="Twilight Torque",
ear1="Darkness earring",
ear2="Darkness earring",
ring1="Luzaf's Ring",
ring2="Barataria Ring",
back="Camulus's Mantle",
waist="Flume Belt",
}
sets.midcast.FastRecast = {
ear1="Loquacious Earring",
ear2="",
}
sets.midcast.Cure = {
neck="Incanter's Torque",
ear1="Roundel Earring",
ear2="Mendi. Earring",
ring1="",
ring2="",
waist="",
}
sets.midcast.Utsusemi = {
waist="Pya'ekue belt",
}
sets.midcast.CorsairShot = {
ammo=gear.QDbullet,
head=gear.Herc_MAB_Head,
body="Mirke wardecors",
hands="Carmine Fin. Ga. +1",
legs="Laksamana's trews +1",
feet=gear.Herc_MAB_Feet,
neck="Sanctity Necklace",
ear1="Hecate's Earring",
ear2="Friomisi Earring",
ring1="Arvina Ringlet +1",
ring2="Acumen Ring",
back=gear.COR_WS_Cape,
waist="Eschan Stone",
}
sets.midcast.CorsairShot.STP = {
ammo=gear.QDbullet,
head="",
body="Mirke wardecors",
hands="Schutzen Mittens",
legs="Chas. Culottes",
feet="Carmine Greaves",
neck="Sanctity Necklace",
ear1="",
ear2="",
ring1="Raja Ring",
ring2="Petrov Ring",
back=gear.COR_TP_Cape,
waist="Goading Belt",
}
sets.midcast.CorsairShot.Resistant = {
ammo=gear.QDbullet,
head="Carmine Mask",
body="Mirke wardecors",
hands="Leyline gloves",
legs="Rawhide Trousers",
feet=gear.Herc_MAB_Feet,
neck="Sanctity Necklace",
ear1="Lifestorm Earring",
ear2="Psystorm Earring",
ring1="Weatherspoon ring",
ring2="Etana Ring",
back=gear.COR_WS_Cape,
waist="Eschan Stone",
}
sets.midcast.CorsairShot['Light Shot'] = set_combine(sets.midcast.CorsairShot, {
hands="Leyline gloves",
head="Carmine Mask",
legs="Rawhide Trousers",
ear1="Lifestorm Earring",
ear2="Psystorm Earring",
ring1="Weatherspoon ring",
ring2="Etana Ring",
})
sets.midcast.CorsairShot['Dark Shot'] = set_combine(sets.midcast.CorsairShot, {
hands="Leyline gloves",
head="Pixie Hairpin +1",
legs="Rawhide Trousers",
ear1="Lifestorm Earring",
ear2="Psystorm Earring",
ring1="Weatherspoon ring",
ring2="Archon Ring",
})
-- Ranged gear
sets.midcast.RA = {
ammo=gear.RAbullet,
head="Pursuer's Beret",
body="Pursuer's Doublet",
hands="Carmine Fin. Ga. +1",
legs="Meg. Chausses +1",
feet="Meg. Jam. +1",
neck="Marked Gorget",
ear1="Navarch's Earring",
ear2="Volley Earring",
ring1="Arvina Ringlet +1",
ring2="Garuda Ring",
back="Gunslinger's Cape",
waist="Eschan Stone",
}
sets.midcast.RA.Acc = set_combine(sets.midcast.RA, {
ammo=gear.RAbullet,
hands="Meg. Gloves +1",
body="Meg. Cuirie +1",
ring1="Cacoethic Ring +1",
ring1="Hadjuk Ring",
})
sets.midcast.RA.Fodder = set_combine(sets.midcast.RA, {
ammo=gear.RAbullet,
neck="Ocachi Gorget",
})
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {}
-- Idle sets
sets.idle = {
ammo=gear.RAbullet,
head="Meghanada visor +1",
body="Meg. Cuirie +1",
hands="Kurys gloves",
legs="Carmine Cuisses +1",
feet="Lanun bottes +1",
neck="Sanctity Necklace",
ear1="Eabani Earring",
ear2="Infused Earring",
ring1="Paguroidea Ring",
ring2="Sheltered Ring",
back="Solemnity Cape",
waist="Flume Belt",
}
sets.idle.DT = set_combine (sets.idle, {
head="Meghanada visor +1", --4/0
body="Meg. Cuirie +1", --7/0
hands="Meg. Gloves +1", --3/0
legs="Meg. Chausses +1", --5/0
feet="Lanun Bottes +1", --4/0
neck="Twilight Torque", --5/5
ear1="Darkness Earring", --2/0
ear2="Darkness Earring", --2/0
ring1="Gelatinous Ring +1", --6/(-2)
ring2="Dark Ring", --0/4
back="Solemnity Cape", --4/4
waist="Flume Belt", --4/0
})
sets.idle.Town = set_combine(sets.idle, {
hands="Carmine Fin. Ga. +1",
back=gear.COR_WS_Cape,
waist="Eschan Stone",
})
-- Defense sets
sets.defense.PDT = {
head="Meghanada visor +1", --4/0
body="Meg. Cuirie +1", --7/0
hands="Meg. Gloves +1", --3/0
legs="Meg. Chausses +1", --5/0
feet="Lanun Bottes +1", --4/0
neck="Twilight Torque", --5/5
ear1="Darkness Earring", --2/0
ear2="Darkness Earring", --2/0
ring1="Gelatinous Ring +1", --6/(-2)
ring2="Jelly Ring", --10/10
back="Solemnity Cape", --4/4
waist="Flume Belt", --4/0
}
sets.defense.MDT = set_combine(sets.defense.PDT, {
ear1="Merman's Earring", --0/2
ear2="Merman's Earring", --0/2
ring1="Dark Ring", --0/4
ring2="Minerva's Ring", --(-8)/8
})
sets.Kiting = {legs="Crimson cuisses"}
-- 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=gear.RAbullet,
head="Adhemar Bonnet",
body="Adhemar Jacket",
hands="Adhemar Wristbands",
legs="Carmine cuisses +1",
feet="Taeon boots",
neck="Lissome Necklace",
ear1="Eabani Earring",
ear2="Suppanomimi",
ring1="Petrov Ring",
ring2="Epona's Ring",
back="Bleating Mantle",
waist="Windbuffet Belt +1",
}
sets.engaged.LowAcc = set_combine(sets.engaged, {
ring2="Rajas Ring",
back=gear.COR_TP_Cape,
})
sets.engaged.MidAcc = set_combine(sets.engaged.LowAcc, {
ear1="Cessance Earring",
feet=gear.Herc_TP_Feet,
waist="Kentarch Belt +1",
})
sets.engaged.HighAcc = set_combine(sets.engaged.MidAcc, {
head="Carmine Mask",
neck="Subtlety spectacles",
ear2="Mache Earring",
ring1="Cacoethic Ring +1",
ring2="Enlivened Ring",
back=gear.COR_TP_Cape,
})
sets.engaged.Fodder = set_combine(sets.engaged, {
body="Thaumas Coat",
neck="Asperity Necklace",
})
sets.engaged.HighHaste = {
ammo=gear.RAbullet,
head="Adhemar Bonnet",
body="Adhemar Jacket", --5
hands="Adhemar Wristbands", --3
legs=gear.Herc_TP_Legs,
feet=gear.Herc_TP_Feet,
neck="Lissome Necklace",
ear1="Cessance Earring",
ear2="Suppanomimi", --5
ring1="Petrov Ring",
ring2="Epona's Ring",
back="Bleating Mantle",
waist="Windbuffet Belt +1",
}
sets.engaged.HighHaste.LowAcc = set_combine(sets.engaged.HighHaste, {
ring2="Rajas Ring",
back=gear.COR_TP_Cape,
})
sets.engaged.HighHaste.MidAcc = set_combine(sets.engaged.HighHaste.LowAcc, {
legs="Taeon tights",
ring1="Cacoethic Ring +1",
waist="Kentarch Belt +1",
})
sets.engaged.HighHaste.HighAcc = set_combine(sets.engaged.HighHaste.MidAcc, {
head="Carmine Mask",
legs="Carmine cuisses +1",
neck="Subtlety spectacles",
ear2="Mache Earring",
ring2="Enlivened Ring",
})
sets.engaged.HighHaste.Fodder = set_combine(sets.engaged.HighHaste, {
body="Thaumas Coat",
neck="Asperity Necklace",
})
sets.engaged.MaxHaste = {
ammo=gear.RAbullet,
head="Adhemar Bonnet",
body="Adhemar Jacket", --5
hands="Adhemar Wristbands", --3
legs=gear.Herc_TP_legs,
feet=gear.Herc_TP_feet,
neck="Lissome Necklace",
ear1="Cessance Earring",
ear2="Suppanomimi",
ring1="Petrov Ring",
ring2="Epona's Ring",
back="Bleating Mantle",
waist="Windbuffet Belt +1",
}
sets.engaged.MaxHaste.LowAcc = set_combine(sets.engaged.HighHaste, {
ring2="Rajas Ring",
back=gear.COR_TP_Cape,
})
sets.engaged.MaxHaste.MidAcc = set_combine(sets.engaged.MaxHaste.LowAcc, {
legs="Taeon tights",
ring1="Cacoethic Ring +1",
waist="Kentarch Belt +1",
})
sets.engaged.MaxHaste.HighAcc = set_combine(sets.engaged.MaxHaste.MidAcc, {
head="Carmine Mask",
neck="Subtlety spectacles",
ear2="Mache Earring",
ring2="Enlivened Ring",
})
sets.engaged.MaxHaste.Fodder = set_combine(sets.engaged.MaxHaste, {
body="Thaumas Coat",
neck="Asperity Necklace",
})
sets.Obi = {waist="Hachirin-no-Obi"}
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)
-- Check that proper ammo is available if we're using ranged attacks or similar.
if spell.action_type == 'Ranged Attack' or spell.type == 'WeaponSkill' or spell.type == 'CorsairShot' then
do_bullet_checks(spell, spellMap, eventArgs)
end
-- gear sets
if (spell.type == 'CorsairRoll' or spell.english == "Double-Up") and state.LuzafRing.value then
equip(sets.precast.LuzafRing)
elseif spell.type == 'CorsairShot' and state.CastingMode.value == 'Resistant' then
classes.CustomClass = 'Acc'
elseif spell.english == 'Fold' and buffactive['Bust'] == 2 then
if sets.precast.FoldDoubleBust then
equip(sets.precast.FoldDoubleBust)
eventArgs.handled = true
end
end
end
function job_post_precast(spell, action, spellMap, eventArgs)
-- Equip obi if weather/day matches for WS/Quick Draw.
if spell.type == 'WeaponSkill' or spell.type == 'CorsairShot' then
if spell.english == 'Leaden Salute' and (world.weather_element == 'Dark' or world.day_element == 'Dark') then
equip(sets.Obi)
elseif spell.english == 'Wildfire' and (world.weather_element == 'Fire' or world.day_element == 'Fire') then
equip(sets.Obi)
elseif spell.type == 'CorsairShot' and (spell.element == world.weather_element or spell.element == world.day_element) then
equip(sets.Obi)
end
end
end
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
function job_aftercast(spell, action, spellMap, eventArgs)
if spell.type == 'CorsairRoll' and not spell.interrupted then
display_roll_info(spell)
end
end
function job_status_change(new_status, old_status)
if new_status == 'Engaged' then
determine_haste_group()
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- Return a customized weaponskill mode to use for weaponskill sets.
-- Don't return anything if you're not overriding the default value.
function job_update(cmdParams, eventArgs)
determine_haste_group()
end
-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function job_update(cmdParams, eventArgs)
determine_haste_group()
end
function get_custom_wsmode(spell, spellMap, default_wsmode)
if buffactive['Transcendancy'] then
return 'Brew'
end
end
-- Called by the 'update' self-command, for common needs.
-- Set eventArgs.handled to true if we don't want automatic equipping of gear.
function job_update(cmdParams, eventArgs)
if newStatus == 'Engaged' and player.equipment.main == 'Chatoyant Staff' then
state.OffenseMode:set('Ranged')
end
end
-- Handle auto-targetting based on local setup.
function job_auto_change_target(spell, action, spellMap, eventArgs)
if spell.type == 'CorsairShot' then
if state.IgnoreTargetting.value == true then
state.IgnoreTargetting:reset()
eventArgs.handled = true
end
eventArgs.SelectNPCTargets = state.SelectShotTarget.value
end
end
-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
local msg = ''
msg = msg .. '[ Offense/Ranged: '..state.OffenseMode.current..'/'..state.RangedMode.current
msg = msg .. ' ][ WS: '..state.WeaponskillMode.current
if state.DefenseMode.value ~= 'None' then
msg = msg .. ' ][ Defense: ' .. state.DefenseMode.value .. state[state.DefenseMode.value .. 'DefenseMode'].value
end
if state.Kiting.value then
msg = msg .. ' ][ Kiting Mode: ON'
end
msg = msg .. ' ][ '..state.MainShot.current
if state.UseAltShot.value == true then
msg = msg .. '/'..state.AltShot.current
end
msg = msg .. ' ]'
add_to_chat(061, msg)
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- User self-commands.
-------------------------------------------------------------------------------------------------------------------
-- Called for custom player commands.
function job_self_command(cmdParams, eventArgs)
if cmdParams[1] == 'Shot' then
if cmdParams[2] == 't' then
state.IgnoreTargetting:set()
end
local doShot = ''
if state.UseAltShot.value == true then
doShot = state[state.CurrentShot.current..'Shot'].current
state.CurrentShot:cycle()
else
doShot = state.MainShot.current
end
send_command('@input /ja "'..doShot..'" <t>')
end
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function determine_haste_group()
-- We have three groups of DW in gear: Charis body, Charis neck + DW earrings, and Patentia Sash.
-- For high haste, we want to be able to drop one of the 10% groups (body, preferably).
-- High haste buffs:
-- 2x Marches + Haste
-- 2x Marches + Haste Samba
-- 1x March + Haste + Haste Samba
-- Embrava + any other haste buff
-- For max haste, we probably need to consider dropping all DW gear.
-- Max haste buffs:
-- Embrava + Haste/March + Haste Samba
-- 2x March + Haste + Haste Samba
classes.CustomMeleeGroups:clear()
if buffactive.embrava and (buffactive.haste or buffactive.march) then
classes.CustomMeleeGroups:append('MaxHaste')
elseif buffactive.march == 2 and buffactive.haste then
classes.CustomMeleeGroups:append('MaxHaste')
elseif buffactive.embrava and (buffactive.haste or buffactive.march) then
classes.CustomMeleeGroups:append('HighHaste')
elseif buffactive.march == 1 and buffactive.haste then
classes.CustomMeleeGroups:append('HighHaste')
elseif buffactive.march == 2 and buffactive.haste then
classes.CustomMeleeGroups:append('HighHaste')
end
end
function define_roll_values()
rolls = {
["Corsair's Roll"] = {lucky=5, unlucky=9, bonus="Experience Points"},
["Ninja Roll"] = {lucky=4, unlucky=8, bonus="Evasion"},
["Hunter's Roll"] = {lucky=4, unlucky=8, bonus="Accuracy"},
["Chaos Roll"] = {lucky=4, unlucky=8, bonus="Attack"},
["Magus's Roll"] = {lucky=2, unlucky=6, bonus="Magic Defense"},
["Healer's Roll"] = {lucky=3, unlucky=7, bonus="Cure Potency Received"},
["Drachen Roll"] = {lucky=4, unlucky=8, bonus="Pet Magic Accuracy/Attack"},
["Choral Roll"] = {lucky=2, unlucky=6, bonus="Spell Interruption Rate"},
["Monk's Roll"] = {lucky=3, unlucky=7, bonus="Subtle Blow"},
["Beast Roll"] = {lucky=4, unlucky=8, bonus="Pet Attack"},
["Samurai Roll"] = {lucky=2, unlucky=6, bonus="Store TP"},
["Evoker's Roll"] = {lucky=5, unlucky=9, bonus="Refresh"},
["Rogue's Roll"] = {lucky=5, unlucky=9, bonus="Critical Hit Rate"},
["Warlock's Roll"] = {lucky=4, unlucky=8, bonus="Magic Accuracy"},
["Fighter's Roll"] = {lucky=5, unlucky=9, bonus="Double Attack Rate"},
["Puppet Roll"] = {lucky=3, unlucky=7, bonus="Pet Magic Attack/Accuracy"},
["Gallant's Roll"] = {lucky=3, unlucky=7, bonus="Defense"},
["Wizard's Roll"] = {lucky=5, unlucky=9, bonus="Magic Attack"},
["Dancer's Roll"] = {lucky=3, unlucky=7, bonus="Regen"},
["Scholar's Roll"] = {lucky=2, unlucky=6, bonus="Conserve MP"},
["Naturalist's Roll"] = {lucky=3, unlucky=7, bonus="Enh. Magic Duration"},
["Runeist's Roll"] = {lucky=4, unlucky=8, bonus="Magic Evasion"},
["Bolter's Roll"] = {lucky=3, unlucky=9, bonus="Movement Speed"},
["Caster's Roll"] = {lucky=2, unlucky=7, bonus="Fast Cast"},
["Courser's Roll"] = {lucky=3, unlucky=9, bonus="Snapshot"},
["Blitzer's Roll"] = {lucky=4, unlucky=9, bonus="Attack Delay"},
["Tactician's Roll"] = {lucky=5, unlucky=8, bonus="Regain"},
["Allies's Roll"] = {lucky=3, unlucky=10, bonus="Skillchain Damage"},
["Miser's Roll"] = {lucky=5, unlucky=7, bonus="Save TP"},
["Companion's Roll"] = {lucky=2, unlucky=10, bonus="Pet Regain and Regen"},
["Avenger's Roll"] = {lucky=4, unlucky=8, bonus="Counter Rate"},
}
end
function display_roll_info(spell)
rollinfo = rolls[spell.english]
local rollsize = (state.LuzafRing.value and 'Large') or 'Small'
if rollinfo then
add_to_chat(104, '[ Lucky: '..tostring(rollinfo.lucky)..' / Unlucky: '..tostring(rollinfo.unlucky)..' ] '..spell.english..': '..rollinfo.bonus..' ('..rollsize..') ')
end
end
-- Determine whether we have sufficient ammo for the action being attempted.
function do_bullet_checks(spell, spellMap, eventArgs)
local bullet_name
local bullet_min_count = 1
if spell.type == 'WeaponSkill' then
if spell.skill == "Marksmanship" then
if spell.element == 'None' then
-- physical weaponskills
bullet_name = gear.WSbullet
else
-- magical weaponskills
bullet_name = gear.MAbullet
end
else
-- Ignore non-ranged weaponskills
return
end
elseif spell.type == 'CorsairShot' then
bullet_name = gear.QDbullet
elseif spell.action_type == 'Ranged Attack' then
bullet_name = gear.RAbullet
if buffactive['Triple Shot'] then
bullet_min_count = 3
end
end
local available_bullets = player.inventory[bullet_name] or player.wardrobe[bullet_name]
-- If no ammo is available, give appropriate warning and end.
if not available_bullets then
if spell.type == 'CorsairShot' and player.equipment.ammo ~= 'empty' then
add_to_chat(104, 'No Quick Draw ammo left. Using what\'s currently equipped ('..player.equipment.ammo..').')
return
elseif spell.type == 'WeaponSkill' and player.equipment.ammo == gear.RAbullet then
-- add_to_chat(104, 'No weaponskill ammo left. Using what\'s currently equipped (standard ranged bullets: '..player.equipment.ammo..').')
return
else
add_to_chat(104, 'No ammo ('..tostring(bullet_name)..') available for that action.')
eventArgs.cancel = true
return
end
end
-- Don't allow shooting or weaponskilling with ammo reserved for quick draw.
if spell.type ~= 'CorsairShot' and bullet_name == gear.QDbullet and available_bullets.count <= bullet_min_count then
add_to_chat(104, 'No ammo will be left for Quick Draw. Cancelling.')
eventArgs.cancel = true
return
end
-- Low ammo warning.
if spell.type ~= 'CorsairShot' and state.warned.value == false
and available_bullets.count > 1 and available_bullets.count <= options.ammo_warning_limit then
local msg = '***** LOW AMMO WARNING: '..bullet_name..' *****'
--local border = string.repeat("*", #msg)
local border = ""
for i = 1, #msg do
border = border .. "*"
end
add_to_chat(104, border)
add_to_chat(104, msg)
add_to_chat(104, border)
state.warned:set()
elseif available_bullets.count > options.ammo_warning_limit and state.warned then
state.warned:reset()
end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
if player.sub_job == 'DNC' then
set_macro_page(1, 10)
else
set_macro_page(1, 10)
end
end
サーバ: Odin
Game: FFXI
Posts: 45
By Odin.Blizzy 2016-10-25 22:33:15
Need a bit of help please, I am currently trying to fit this months Ambuscade gear into my gearswap, but when I do //gs export, I recive the message: Gearswap: you are wearing an item that is not in the resources yet. I have also tried to //update and no fix. Is there a way to fix this
Odin.Lygre
サーバ: Odin
Game: FFXI
Posts: 89
By Odin.Lygre 2016-10-26 09:30:18
Ok, I am back with more questions....
I managed to add/define sets based of the amount of magical haste I have. So now if I have no haste it equips one set of gear, if I get haste 1 or haste 2 it equips based on value of haste all the way up to capped haste.
What I would like additionally is for it to auto equip the single wield gearset in the event I don't have a dual wield subjob, furthermore I would like a way to add in additional sets if I am using /dnc instead of my normal /nin, because the native DW traits are different I would need to add a whole bunch of rules and sets, the problem is I have NO FRIGGIN' IDEA how to do any of that. I literally stole all my haste defined rules from a thf lua and spent like 3 hours til I got it to work.
Edit: Ideally I would like to do this same thing for my terribly designed cor lua, that way I don't have to cycle through 14 sets
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()
determine_haste_group()
state.Buff.Saboteur = buffactive.saboteur or false
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', 'Mid', 'Acc', 'SingleWield')
state.HybridMode:options('Normal', 'PhysicalDef', 'MagicalDef')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'PDT', 'MDT')
select_default_macro_book()
gear.CureStaff = {name=""}
gear.CureFeet = {name=""}
state.MagicBurst = M(false, 'Magic Burst')
state.CureHate = M(false, 'Cure Hate')
send_command('bind !` gs c toggle MagicBurst')
send_command('bind ^` gs c toggle CureHate')
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['Chainspell'] = {body="Vitivation Tabard +1"}
-- Waltz set (chr and vit)
sets.precast.Waltz = {}
-- Don't need any special gear for Healing Waltz.
sets.precast.Waltz['Healing Waltz'] = {}
-- Fast cast sets for spells
-- 80% Fast Cast (including trait) for all spells, plus 5% quick cast
-- No other FC sets necessary.
sets.precast.FC = {}
sets.precast.FC.Impact = set_combine(sets.precast.FC, {head=empty,body="Twilight Cloak"})
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {}
sets.precast.WS['Circle Blade'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Sanguine Blade'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Requiescat'] = {}
sets.precast.WS['Aeolian Edge'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Savage Blade'] = {}
sets.precast.WS['Chant du Cygne'] = {}
sets.precast.WS['True Strike'] = {}
sets.precast.WS['Exenterator'] = {}
sets.precast.WS['Evisceration'] = {}
sets.precast.WS['Death Blossom'] = {}
-- Midcast Sets
sets.midcast.Cure = {}
sets.midcast.Curaga = sets.midcast.Cure
sets.midcast.CureWeather = {}
sets.midcast.CureSelf = {}
sets.midcast.CureMelee = {}
sets.midcast['Enhancing Magic'] = {}
sets.midcast['Enhancing Magic'].Temper = {}
sets.midcast['Enhancing Magic'].RegenSelf = {}
sets.midcast['Enhancing Magic'].RefreshSelf = {}
sets.midcast['Enhancing Magic'].HasteSelf = {}
sets.midcast['Enhancing Magic'].EnSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.midcast['Enhancing Magic'].GainSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.midcast['Enhancing Magic'].BarSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.buff.ComposureOther = {head="Lethargy Chappel +1",body="Lethargy Sayon +1",
legs="Lethargy Fuseau +1",feet="Lethargy Houseaux +1"}
sets.midcast.Protect = {}
sets.midcast.Shell = sets.midcast.Protect
sets.midcast['Enhancing Magic'].Phalanx = {}
sets.midcast.Cursna = {}
sets.midcast.Stoneskin = {}
sets.midcast['Enfeebling Magic'] = {}
sets.midcast.MndEnfeebles = {}
sets.midcast.IntEnfeebles = {}
sets.midcast.Blind = {}
sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
sets.midcast.Distract = {}
sets.midcast.Frazzle = {}
sets.midcast['Distract II'] = sets.midcast.Distract
sets.midcast['Distract III'] = sets.midcast.Distract
sets.midcast['Frazzle II'] = {}
sets.midcast['Frazzle III'] = sets.midcast.Frazzle
sets.midcast['Dia III'] = set_combine(sets.midcast['Enfeebling Magic'], {head="Vitivation Chapeau +1"})
sets.midcast['Slow II'] = set_combine(sets.midcast['Enfeebling Magic'], {head="Vitivation Chapeau +1"})
sets.Lunge = {}
sets.Convert = {main="Murgleis"}
sets.midcast['Elemental Magic'] ={}
sets.midcast['Elemental Magic']['Low'] = {}
sets.midcast.Impact = set_combine(sets.midcast['Elemental Magic'], {head=empty,body="Twilight Cloak"})
sets.midcast['Stun'] = {}
sets.midcast.Drain = {}
sets.midcast.Aspir = sets.midcast.Drain
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {}
-- Idle sets
sets.idle = {}
sets.idle.Town = {}
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.Mid = {}
sets.engaged.Acc = {}
sets.engaged.SingleWield = {}
sets.engaged.Evasion = sets.engaged
sets.engaged.Mid.Evasion = sets.engaged.Mid
sets.engaged.Acc.Evasion = sets.engaged.Acc
sets.engaged.PDT = sets.defense.PDT
sets.engaged.Mid.PDT = sets.defense.MDT
sets.engaged.Acc.PDT = sets.defense.PDT
-- Haste 43%
sets.engaged.Haste_43 = set_combine(sets.engaged, {})
sets.engaged.Mid.Haste_43 = sets.engaged.Mid
sets.engaged.Acc.Haste_43 = sets.engaged.Acc
sets.engaged.Evasion.Haste_43 = sets.engaged.Haste_43
sets.engaged.PDT.Haste_43 = sets.defense.PDT
-- 40
sets.engaged.Haste_40 = set_combine(sets.engaged.Haste_43, {})
sets.engaged.Mid.Haste_40 = sets.engaged.Mid
sets.engaged.Acc.Haste_40 = sets.engaged.Acc
sets.engaged.Evasion.Haste_40 = sets.engaged.Haste_40
sets.engaged.PDT.Haste_40 = sets.defense.PDT
-- 30
sets.engaged.Haste_30 = sets.engaged
sets.engaged.Mid.Haste_30 = sets.engaged.Mid
sets.engaged.Acc.Haste_30 = sets.engaged.Acc
sets.engaged.Evasion.Haste_30 = sets.engaged
sets.engaged.PDT.Haste_30 = sets.defense.PDT
-- 25
sets.engaged.Haste_25 = set_combine(sets.engaged.Haste_30, {})
sets.engaged.Acc.Haste_25 = sets.engaged.Acc
sets.engaged.Mid.Haste_25 = sets.engaged.Mid
sets.engaged.Evasion.Haste_25 = sets.engaged
sets.engaged.PDT.Haste_25 = sets.defense.PDT
sets.magic_burst = {}
sets.cure_hate = {}
sets.Enmity = {}
-- Sets for special buff conditions on spells.
sets.buff.Saboteur = {hands="Lethargy Gantherots +1"}
end
LowNukes = S{'Stone' , 'Aero' , 'Blizzard' , 'Fire' , 'Water' , 'Thunder' ,
'Stone II' , 'Aero II' , 'Blizzard II' , 'Fire II' , 'Water II' , 'Thunder II',
'Stonega' , 'Aeroga' , 'Blizzaga' , 'Firaga' , 'Waterga' , 'Thundaga',
'Stonega II' , 'Aeroga II' , 'Blizzaga II' , 'Firaga II' , 'Waterga II' , 'Thundaga II'}
MndEnfeebles = S{'Slow' , 'Silence' , 'Paralyze' , 'Addle' , 'Slow II' , 'Paralyze II' , 'Addle II'}
IntEnfeebles = S{'Bind' , 'Break' , 'Gravity' , 'Poison' , 'Sleep' , 'Gravity II' , 'Poison II' , 'Sleep II'}
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
function job_precast(spell, action, spellMap, eventArgs)
if spell.skill == 'Healing Magic' and spellMap ~= 'StatusRemoval' then
gear.CureFeet.name = "Vanya Clogs"
if player.status == 'Engaged' then
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
if spell.target.type == 'SELF' then
gear.CureFeet.name = "Medium's Sabots"
else
gear.CureFeet.name = "Vanya Clogs"
end
else
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
end
if spell.target.type == 'SELF' then
gear.default.obi_waist = "Chuq'aba Belt"
else
gear.default.obi_waist = "Salire belt"
end
if world.weather_element == 'Light' then
gear.CureStaff.name = "Chatoyant Staff"
else
gear.CureStaff.name = "Serenity"
end
else
gear.default.obi_waist = "Salire belt"
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
end
if spell.name == 'Lunge' or spell.name == 'Swipe' then
equip(sets.Lunge)
end
if spell.name == 'Vallation' then
equip(sets.Enmity)
end
if spell.name == 'Pflug' then
equip(sets.Enmity)
end
if spell.name == 'Warcry'
or spell.name == 'Swordplay' or spell.name == 'Rayke' or spell.name == 'Meditate' or spell.name == 'Provoke' then
equip(sets.Enmity)
end
--prevents casting Utsusemi if you already have 3 or more shadows
if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) then
cancel_spell()
end
if buffactive['terror'] or buffactive['petrification'] or buffactive['stun'] or buffactive['sleep'] then
if TP_ind == 4 then
equip(sets.defense.MDT) else
equip(sets.defense.PDT)
end
end
if spell.name == 'Convert' then
equip(sets.Convert)
end
if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
cancel_spell()
send_command('input /item "Echo Drops" <me>')
end
end
-- Run after the default midcast() is done.
-- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.skill == 'Enfeebling Magic' and state.Buff.Saboteur then
equip(sets.buff.Saboteur)
elseif spell.skill == 'Enhancing Magic' and not spell.english == 'Stoneskin' then
equip(sets.midcast.EnhancingDuration)
if buffactive.composure and spell.target.type == 'PLAYER' then
equip(sets.buff.ComposureOther)
end
elseif spellMap == 'Cure' then
if spell.target.type == 'SELF' then
equip(sets.midcast.CureSelf)
end
if state.CureHate.value then
equip(sets.cure_hate)
end
if world.weather_element == 'Light' then
equip(sets.midcast.CureWeather)
end
elseif spell.skill == 'Elemental Magic' then
if state.MagicBurst.value then
equip(sets.magic_burst)
end
if spell.element == world.day_element or spell.element == world.weather_element then
equip({waist="Hachirin-no-Obi"})
end
elseif spell.skill == "Ninjutsu" then
equip(sets.midcast.Recast)
if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' then
if buffactive['Copy Image'] then
windower.ffxi.cancel_buff(66)
elseif buffactive['Copy Image (2)'] then
windower.ffxi.cancel_buff(444)
elseif buffactive['Copy Image (3)'] then
windower.ffxi.cancel_buff(445)
elseif buffactive['Copy Image (4+)'] then
windower.ffxi.cancel_buff(446)
end
elseif spell.name == 'Monomi: Ichi' and buffactive.Sneak and spell.target.type == 'SELF' then
windower.ffxi.cancel_buff(71)
end
end
if spell.name == 'Foil' or spell.name == 'Flash' or spell.name == 'Blank Gaze'
or spell.name == 'Geist Wall' or spell.name == 'Poison Breath' or spell.name == 'Jettatura'
or spell.name == 'Cocoon' or spell.name == 'Soporific' or spell.name == 'Sheep Song'
or spell.name == 'Refueling' then
equip(sets.Enmity)
end
end
function job_get_spell_map(spell, default_spell_map)
if spell.action_type == 'Magic' then
if spell.skill == 'Enhancing Magic' then
if spell.english:startswith('En') then
return 'EnSpells'
elseif spell.english:startswith('Gain') then
return 'GainSpells'
elseif spell.english:startswith('Phalanx') then
return 'Phalanx'
elseif spell.english:startswith('Bar') then
return 'Bar'
elseif spell.english:startswith('Temper') then
return 'Temper'
elseif spell.english:startswith('Haste') then
if spell.target.type == 'SELF' then
return 'HasteSelf'
end
elseif spell.english:startswith('Refresh') then
if spell.target.type == 'SELF' then
return 'RefreshSelf'
end
end
elseif default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
if player.status == 'Engaged' then
return "CureMelee"
end
end
if spell.action_type == 'Magic' then
if spell.skill == 'Enfeebling Magic' then
if spell.type == 'WhiteMagic' then
return 'MndEnfeebles'
else
return 'IntEnfeebles'
end
elseif spell.skill == 'Elemental Magic' then
if LowNukes:contains(spell.name) then
return 'Low'
else
return
end
end
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
if stateField == 'Offense Mode' then
if newValue == 'None' then
enable('main','sub','range')
else
disable('main','sub','range')
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- General hooks for change 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 we gain or lose any haste buffs, adjust which gear set we target.
if S{'haste','march', 'madrigal','embrava','haste samba'}:contains(buff:lower()) then
determine_haste_group()
handle_equipping_gear(player.status)
end
if state.Buff[buff] ~= nil then
state.Buff[buff] = gain
if not midaction() then
handle_equipping_gear(player.status)
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- 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 customize_melee_set(meleeSet)
if player.sub_job == 'DNC' or player.sub_job == 'NIN' then
meleeSet = set_combine(meleeSet, sets.engaged.DW)
end
return meleeSet
end
-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
display_current_caster_state()
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function determine_haste_group()
classes.CustomMeleeGroups:clear()
-- assuming +4 for marches (ghorn has +5)
-- Haste (white magic) 15%
-- Haste Samba (Sub) 5%
-- Haste (Merited DNC) 10% (never account for this)
-- Victory March +0/+3/+4/+5 9.4/14%/15.6%/17.1% +0
-- Advancing March +0/+3/+4/+5 6.3/10.9%/12.5%/14% +0
-- Embrava 30% with 500 enhancing skill
-- Mighty Guard - 15%
-- buffactive[580] = geo haste
-- buffactive[33] = regular haste
-- buffactive[604] = mighty guard
-- state.HasteMode = toggle for when you know Haste II is being cast on you
-- Hi = Haste II is being cast. This is clunky to use when both haste II and haste I are being cast
if ( ( (buffactive[33] or buffactive[580] or buffactive.embrava) and (buffactive.march or buffactive[604]) ) or
( buffactive[33] and (buffactive[580] or buffactive.embrava) ) or
( buffactive.march == 2 and buffactive[604] ) ) then
add_to_chat(8, '-------------Haste 43%-------------')
classes.CustomMeleeGroups:append('Haste_43')
elseif buffactive.embrava and buffactive.haste then
add_to_chat(8, '-------------Haste 40%-------------')
classes.CustomMeleeGroups:append('Haste_40')
elseif ( (buffactive[33] or buffactive.march == 2 or buffactive[580]) and buffactive['haste samba'] ) then
add_to_chat(8, '-------------Haste 35%-------------')
classes.CustomMeleeGroups:append('Haste_35')
elseif ( ( buffactive[580] or buffactive[33] or buffactive.march == 2 ) or
( buffactive.march == 1 and buffactive[604] ) ) then
add_to_chat(8, '-------------Haste 30%-------------')
classes.CustomMeleeGroups:append('Haste_30')
elseif ( buffactive.march == 1 or buffactive[604] ) then
add_to_chat(8, '-------------Haste 15%-------------')
classes.CustomMeleeGroups:append('Haste_15')
elseif ( buffactive[580] and ( buffactive.march or buffactive[33] or buffactive.embrava or buffactive[604]) ) or -- geo haste + anything
( buffactive.embrava and (buffactive.march or buffactive[33] or buffactive[604]) ) or -- embrava + anything
( buffactive.march == 2 and (buffactive[33] or buffactive[604]) ) or -- two marches + anything
( buffactive[33] and buffactive[604] and buffactive.march ) then -- haste + mighty guard + any marches
add_to_chat(8, '-------------Max Haste Mode Enabled--------------')
classes.CustomMeleeGroups:append('Haste_43')
elseif ( (buffactive[604] or buffactive[33]) and buffactive['haste samba'] and buffactive.march == 1) or -- MG or haste + samba with 1 march
( buffactive.march == 2 and buffactive['haste samba'] ) or
( buffactive[580] and buffactive['haste samba'] ) then
add_to_chat(8, '-------------Haste 35%-------------')
classes.CustomMeleeGroups:append('Haste_35')
elseif ( buffactive.march == 2 ) or -- two marches from ghorn
( (buffactive[33] or buffactive[604]) and buffactive.march == 1 ) or -- MG or haste + 1 march
( buffactive[580] ) or -- geo haste
( buffactive[33] and buffactive[604] ) then -- haste with MG
add_to_chat(8, '-------------Haste 30%-------------')
classes.CustomMeleeGroups:append('Haste_30')
elseif buffactive[33] or buffactive[604] or buffactive.march == 1 then
add_to_chat(8, '-------------Haste 15%-------------')
classes.CustomMeleeGroups:append('Haste_15')
end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
-- Default macro set/book
if player.sub_job == 'DNC' then
set_macro_page(2, 4)
elseif player.sub_job == 'WHM' then
set_macro_page(3, 4)
elseif player.sub_job == 'NIN' then
set_macro_page(10, 4)
elseif player.sub_job == 'THF' then
set_macro_page(4, 4)
elseif player.sub_job == 'BLM' then
set_macro_page(5, 4)
else
set_macro_page(1, 4)
end
end 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()
determine_haste_group()
state.Buff.Saboteur = buffactive.saboteur or false
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', 'Mid', 'Acc')
state.HybridMode:options('Normal', 'PDT', 'Evasion')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'PDT', 'MDT')
select_default_macro_book()
gear.CureStaff = {name=""}
gear.CureFeet = {name=""}
state.MagicBurst = M(false, 'Magic Burst')
state.CureHate = M(false, 'Cure Hate')
Shields = S{'Genmei Shield','Culminus'}
LowNukes = S{'Stone' , 'Aero' , 'Blizzard' , 'Fire' , 'Water' , 'Thunder' ,
'Stone II' , 'Aero II' , 'Blizzard II' , 'Fire II' , 'Water II' , 'Thunder II',
'Stonega' , 'Aeroga' , 'Blizzaga' , 'Firaga' , 'Waterga' , 'Thundaga',
'Stonega II' , 'Aeroga II' , 'Blizzaga II' , 'Firaga II' , 'Waterga II' , 'Thundaga II'}
MndEnfeebles = S{'Slow' , 'Silence' , 'Paralyze' , 'Addle' , 'Slow II' , 'Paralyze II' , 'Addle II'}
IntEnfeebles = S{'Bind' , 'Break' , 'Gravity' , 'Poison' , 'Sleep' , 'Gravity II' , 'Poison II' , 'Sleep II'}
send_command('bind !` gs c toggle MagicBurst')
send_command('bind ^` gs c toggle CureHate')
update_combat_form()
determine_haste_group()
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['Chainspell'] = {body="Vitivation Tabard +1"}
-- Waltz set (chr and vit)
sets.precast.Waltz = {}
-- Don't need any special gear for Healing Waltz.
sets.precast.Waltz['Healing Waltz'] = {}
-- Fast cast sets for spells
-- 80% Fast Cast (including trait) for all spells, plus 5% quick cast
-- No other FC sets necessary.
sets.precast.FC = {}
sets.precast.FC.Impact = set_combine(sets.precast.FC, {head=empty,body="Twilight Cloak"})
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {}
sets.precast.WS['Circle Blade'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Sanguine Blade'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Requiescat'] = {}
sets.precast.WS['Aeolian Edge'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Savage Blade'] = {}
sets.precast.WS['Chant du Cygne'] = {}
sets.precast.WS['True Strike'] = {}
sets.precast.WS['Exenterator'] = {}
sets.precast.WS['Evisceration'] = {}
sets.precast.WS['Death Blossom'] = {}
-- Midcast Sets
sets.midcast.Cure = {}
sets.midcast.Curaga = sets.midcast.Cure
sets.midcast.CureWeather = {}
sets.midcast.CureSelf = {}
sets.midcast.CureMelee = {}
sets.midcast['Enhancing Magic'] = {}
sets.midcast['Enhancing Magic'].Temper = {}
sets.midcast['Enhancing Magic'].RegenSelf = {}
sets.midcast['Enhancing Magic'].RefreshSelf = {}
sets.midcast['Enhancing Magic'].HasteSelf = {}
sets.midcast['Enhancing Magic'].EnSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.midcast['Enhancing Magic'].GainSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.midcast['Enhancing Magic'].BarSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.buff.ComposureOther = {head="Lethargy Chappel +1",body="Lethargy Sayon +1",
legs="Lethargy Fuseau +1",feet="Lethargy Houseaux +1"}
sets.midcast.Protect = {}
sets.midcast.Shell = sets.midcast.Protect
sets.midcast['Enhancing Magic'].Phalanx = {}
sets.midcast.Cursna = {}
sets.midcast.Stoneskin = {}
sets.midcast['Enfeebling Magic'] = {}
sets.midcast.MndEnfeebles = {}
sets.midcast.IntEnfeebles = {}
sets.midcast.Blind = {}
sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
sets.midcast.Distract = {}
sets.midcast.Frazzle = {}
sets.midcast['Distract II'] = sets.midcast.Distract
sets.midcast['Distract III'] = sets.midcast.Distract
sets.midcast['Frazzle II'] = {}
sets.midcast['Frazzle III'] = sets.midcast.Frazzle
sets.midcast['Dia III'] = set_combine(sets.midcast['Enfeebling Magic'], {head="Vitivation Chapeau +1"})
sets.midcast['Slow II'] = set_combine(sets.midcast['Enfeebling Magic'], {head="Vitivation Chapeau +1"})
sets.Lunge = {}
sets.Convert = {main="Murgleis"}
sets.midcast['Elemental Magic'] ={}
sets.midcast['Elemental Magic']['Low'] = {}
sets.midcast.Impact = set_combine(sets.midcast['Elemental Magic'], {head=empty,body="Twilight Cloak"})
sets.midcast['Stun'] = {}
sets.midcast.Drain = {}
sets.midcast.Aspir = sets.midcast.Drain
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {}
-- Idle sets
sets.idle = {}
sets.idle.Town = {}
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.Mid = {}
sets.engaged.Acc = {}
sets.engaged.Evasion = sets.engaged
sets.engaged.Mid.Evasion = sets.engaged.Mid
sets.engaged.Acc.Evasion = sets.engaged.Acc
sets.engaged.PDT = sets.defense.PDT
sets.engaged.Mid.PDT = sets.defense.MDT
sets.engaged.Acc.PDT = sets.defense.PDT
-- Haste 43%
sets.engaged.Haste_43 = set_combine(sets.engaged, {})
sets.engaged.Mid.Haste_43 = sets.engaged.Mid
sets.engaged.Acc.Haste_43 = sets.engaged.Acc
sets.engaged.Evasion.Haste_43 = sets.engaged.Haste_43
sets.engaged.PDT.Haste_43 = sets.defense.PDT
-- 40
sets.engaged.Haste_40 = set_combine(sets.engaged.Haste_43, {})
sets.engaged.Mid.Haste_40 = sets.engaged.Mid
sets.engaged.Acc.Haste_40 = sets.engaged.Acc
sets.engaged.Evasion.Haste_40 = sets.engaged.Haste_40
sets.engaged.PDT.Haste_40 = sets.defense.PDT
-- 30
sets.engaged.Haste_30 = sets.engaged
sets.engaged.Mid.Haste_30 = sets.engaged.Mid
sets.engaged.Acc.Haste_30 = sets.engaged.Acc
sets.engaged.Evasion.Haste_30 = sets.engaged
sets.engaged.PDT.Haste_30 = sets.defense.PDT
-- 25
sets.engaged.Haste_25 = set_combine(sets.engaged.Haste_30, {})
sets.engaged.Acc.Haste_25 = sets.engaged.Acc
sets.engaged.Mid.Haste_25 = sets.engaged.Mid
sets.engaged.Evasion.Haste_25 = sets.engaged
sets.engaged.PDT.Haste_25 = sets.defense.PDT
-- DW nin sub melee group
sets.engaged.DW_nin = {}
sets.engaged.DW_nin.Mid = {}
sets.engaged.DW_nin.Acc = {}
sets.engaged.DW_nin.Evasion = sets.engaged.DW_nin
sets.engaged.DW_nin.Mid.Evasion = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Acc.Evasion = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.PDT = sets.defense.PDT
sets.engaged.DW_nin.Mid.PDT = sets.defense.MDT
sets.engaged.DW_nin.Acc.PDT = sets.defense.PDT
-- Haste 43%
sets.engaged.DW_nin.Haste_43 = set_combine(sets.engaged.DW_nin, {})
sets.engaged.DW_nin.Mid.Haste_43 = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Acc.Haste_43 = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.Evasion.Haste_43 = sets.engaged.DW_nin.Haste_43
sets.engaged.DW_nin.PDT.Haste_43 = sets.defense.PDT
-- 40
sets.engaged.DW_nin.Haste_40 = set_combine(sets.engaged.DW_nin.Haste_43, {})
sets.engaged.DW_nin.Mid.Haste_40 = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Acc.Haste_40 = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.Evasion.Haste_40 = sets.engaged.DW_nin.Haste_40
sets.engaged.DW_nin.PDT.Haste_40 = sets.defense.PDT
-- 30
sets.engaged.DW_nin.Haste_30 = sets.engaged.DW_nin
sets.engaged.DW_nin.Mid.Haste_30 = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Acc.Haste_30 = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.Evasion.Haste_30 = sets.engaged.DW_nin
sets.engaged.DW_nin.PDT.Haste_30 = sets.defense.PDT
-- 25
sets.engaged.DW_nin.Haste_25 = set_combine(sets.engaged.DW_nin.Haste_30, {})
sets.engaged.DW_nin.Acc.Haste_25 = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.Mid.Haste_25 = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Evasion.Haste_25 = sets.engaged.DW_nin
sets.engaged.DW_nin.PDT.Haste_25 = sets.defense.PDT
-- DW dnc sub melee group
sets.engaged.DW_dnc = {}
sets.engaged.DW_dnc.Mid = {}
sets.engaged.DW_dnc.Acc = {}
sets.engaged.DW_dnc.Evasion = sets.engaged.DW_dnc
sets.engaged.DW_dnc.Mid.Evasion = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Acc.Evasion = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.PDT = sets.defense.PDT
sets.engaged.DW_dnc.Mid.PDT = sets.defense.MDT
sets.engaged.DW_dnc.Acc.PDT = sets.defense.PDT
-- Haste 43%
sets.engaged.DW_dnc.Haste_43 = set_combine(sets.engaged.DW_dnc, {})
sets.engaged.DW_dnc.Mid.Haste_43 = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Acc.Haste_43 = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.Evasion.Haste_43 = sets.engaged.DW_dnc.Haste_43
sets.engaged.DW_dnc.PDT.Haste_43 = sets.defense.PDT
-- 40
sets.engaged.DW_dnc.Haste_40 = set_combine(sets.engaged.DW_dnc.Haste_43, {})
sets.engaged.DW_dnc.Mid.Haste_40 = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Acc.Haste_40 = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.Evasion.Haste_40 = sets.engaged.DW_dnc.Haste_40
sets.engaged.DW_dnc.PDT.Haste_40 = sets.defense.PDT
-- 30
sets.engaged.DW_dnc.Haste_30 = sets.engaged.DW_dnc
sets.engaged.DW_dnc.Mid.Haste_30 = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Acc.Haste_30 = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.Evasion.Haste_30 = sets.engaged.DW_dnc
sets.engaged.DW_dnc.PDT.Haste_30 = sets.defense.PDT
-- 25
sets.engaged.DW_dnc.Haste_25 = set_combine(sets.engaged.DW_dnc.Haste_30, {})
sets.engaged.DW_dnc.Acc.Haste_25 = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.Mid.Haste_25 = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Evasion.Haste_25 = sets.engaged.DW_dnc
sets.engaged.DW_dnc.PDT.Haste_25 = sets.defense.PDT
sets.magic_burst = {}
sets.cure_hate = {}
sets.Enmity = {}
-- Sets for special buff conditions on spells.
sets.buff.Saboteur = {hands="Lethargy Gantherots +1"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
function job_precast(spell, action, spellMap, eventArgs)
if spell.skill == 'Healing Magic' and spellMap ~= 'StatusRemoval' then
gear.CureFeet.name = "Vanya Clogs"
if player.status == 'Engaged' then
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
if spell.target.type == 'SELF' then
gear.CureFeet.name = "Medium's Sabots"
else
gear.CureFeet.name = "Vanya Clogs"
end
else
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
end
if spell.target.type == 'SELF' then
gear.default.obi_waist = "Chuq'aba Belt"
else
gear.default.obi_waist = "Salire belt"
end
if world.weather_element == 'Light' then
gear.CureStaff.name = "Chatoyant Staff"
else
gear.CureStaff.name = "Serenity"
end
else
gear.default.obi_waist = "Salire belt"
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
end
if spell.name == 'Lunge' or spell.name == 'Swipe' then
equip(sets.Lunge)
end
if spell.name == 'Vallation' then
equip(sets.Enmity)
end
if spell.name == 'Pflug' then
equip(sets.Enmity)
end
if spell.name == 'Warcry'
or spell.name == 'Swordplay' or spell.name == 'Rayke' or spell.name == 'Meditate' or spell.name == 'Provoke' then
equip(sets.Enmity)
end
--prevents casting Utsusemi if you already have 3 or more shadows
if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) then
cancel_spell()
end
if buffactive['terror'] or buffactive['petrification'] or buffactive['stun'] or buffactive['sleep'] then
if TP_ind == 4 then
equip(sets.defense.MDT) else
equip(sets.defense.PDT)
end
end
if spell.name == 'Convert' then
equip(sets.Convert)
end
if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
cancel_spell()
send_command('input /item "Echo Drops" <me>')
end
end
-- Run after the default midcast() is done.
-- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.skill == 'Enfeebling Magic' and state.Buff.Saboteur then
equip(sets.buff.Saboteur)
elseif spell.skill == 'Enhancing Magic' and not spell.english == 'Stoneskin' then
equip(sets.midcast.EnhancingDuration)
if buffactive.composure and spell.target.type == 'PLAYER' then
equip(sets.buff.ComposureOther)
end
elseif spellMap == 'Cure' then
if spell.target.type == 'SELF' then
equip(sets.midcast.CureSelf)
end
if state.CureHate.value then
equip(sets.cure_hate)
end
if world.weather_element == 'Light' then
equip(sets.midcast.CureWeather)
end
elseif spell.skill == 'Elemental Magic' then
if state.MagicBurst.value then
equip(sets.magic_burst)
end
if spell.element == world.day_element or spell.element == world.weather_element then
equip({waist="Hachirin-no-Obi"})
end
elseif spell.skill == "Ninjutsu" then
equip(sets.midcast.Recast)
if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' then
if buffactive['Copy Image'] then
windower.ffxi.cancel_buff(66)
elseif buffactive['Copy Image (2)'] then
windower.ffxi.cancel_buff(444)
elseif buffactive['Copy Image (3)'] then
windower.ffxi.cancel_buff(445)
elseif buffactive['Copy Image (4+)'] then
windower.ffxi.cancel_buff(446)
end
elseif spell.name == 'Monomi: Ichi' and buffactive.Sneak and spell.target.type == 'SELF' then
windower.ffxi.cancel_buff(71)
end
end
if spell.name == 'Foil' or spell.name == 'Flash' or spell.name == 'Blank Gaze'
or spell.name == 'Geist Wall' or spell.name == 'Poison Breath' or spell.name == 'Jettatura'
or spell.name == 'Cocoon' or spell.name == 'Soporific' or spell.name == 'Sheep Song'
or spell.name == 'Refueling' then
equip(sets.Enmity)
end
end
function job_get_spell_map(spell, default_spell_map)
if spell.action_type == 'Magic' then
if spell.skill == 'Enhancing Magic' then
if spell.english:startswith('En') then
return 'EnSpells'
elseif spell.english:startswith('Gain') then
return 'GainSpells'
elseif spell.english:startswith('Phalanx') then
return 'Phalanx'
elseif spell.english:startswith('Bar') then
return 'Bar'
elseif spell.english:startswith('Temper') then
return 'Temper'
elseif spell.english:startswith('Haste') then
if spell.target.type == 'SELF' then
return 'HasteSelf'
end
elseif spell.english:startswith('Refresh') then
if spell.target.type == 'SELF' then
return 'RefreshSelf'
end
end
elseif default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
if player.status == 'Engaged' then
return "CureMelee"
end
end
if spell.action_type == 'Magic' then
if spell.skill == 'Enfeebling Magic' then
if spell.type == 'WhiteMagic' then
return 'MndEnfeebles'
else
return 'IntEnfeebles'
end
elseif spell.skill == 'Elemental Magic' then
if LowNukes:contains(spell.name) then
return 'Low'
else
return
end
end
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
if stateField == 'Offense Mode' then
if newValue == 'None' then
enable('main','sub','range')
else
disable('main','sub','range')
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- General hooks for change 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 we gain or lose any haste buffs, adjust which gear set we target.
if S{'haste','march', 'madrigal','embrava','haste samba'}:contains(buff:lower()) then
determine_haste_group()
handle_equipping_gear(player.status)
end
if state.Buff[buff] ~= nil then
state.Buff[buff] = gain
if not midaction() then
handle_equipping_gear(player.status)
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- 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 customize_melee_set(meleeSet)
-- if player.sub_job == 'DNC' or player.sub_job == 'NIN' then
-- meleeSet = set_combine(meleeSet, sets.engaged.DW)
-- end
-- return meleeSet
-- end
function update_combat_form()
-- Check for H2H or single-wielding
if player.equipment.sub == 'empty' then
state.CombatForm:reset()
elseif Shields:contains(player.equipment.sub) then
state.CombatForm:reset()
else
if player.sub_job == 'NIN' then
state.CombatForm:set('DW_nin')
elseif player.sub_job == 'DNC' then
state.CombatForm:set('DW_dnc')
end
end
end
function job_update(cmdParams, eventArgs)
update_combat_form()
determine_haste_group()
end
-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
display_current_caster_state()
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function determine_haste_group()
classes.CustomMeleeGroups:clear()
-- assuming +4 for marches (ghorn has +5)
-- Haste (white magic) 15%
-- Haste Samba (Sub) 5%
-- Haste (Merited DNC) 10% (never account for this)
-- Victory March +0/+3/+4/+5 9.4/14%/15.6%/17.1% +0
-- Advancing March +0/+3/+4/+5 6.3/10.9%/12.5%/14% +0
-- Embrava 30% with 500 enhancing skill
-- Mighty Guard - 15%
-- buffactive[580] = geo haste
-- buffactive[33] = regular haste
-- buffactive[604] = mighty guard
-- state.HasteMode = toggle for when you know Haste II is being cast on you
-- Hi = Haste II is being cast. This is clunky to use when both haste II and haste I are being cast
if ( ( (buffactive[33] or buffactive[580] or buffactive.embrava) and (buffactive.march or buffactive[604]) ) or
( buffactive[33] and (buffactive[580] or buffactive.embrava) ) or
( buffactive.march == 2 and buffactive[604] ) ) then
add_to_chat(8, '-------------Haste 43%-------------')
classes.CustomMeleeGroups:append('Haste_43')
elseif buffactive.embrava and buffactive.haste then
add_to_chat(8, '-------------Haste 40%-------------')
classes.CustomMeleeGroups:append('Haste_40')
elseif ( (buffactive[33] or buffactive.march == 2 or buffactive[580]) and buffactive['haste samba'] ) then
add_to_chat(8, '-------------Haste 35%-------------')
classes.CustomMeleeGroups:append('Haste_35')
elseif ( ( buffactive[580] or buffactive[33] or buffactive.march == 2 ) or
( buffactive.march == 1 and buffactive[604] ) ) then
add_to_chat(8, '-------------Haste 30%-------------')
classes.CustomMeleeGroups:append('Haste_30')
elseif ( buffactive.march == 1 or buffactive[604] ) then
add_to_chat(8, '-------------Haste 15%-------------')
classes.CustomMeleeGroups:append('Haste_15')
elseif ( buffactive[580] and ( buffactive.march or buffactive[33] or buffactive.embrava or buffactive[604]) ) or -- geo haste + anything
( buffactive.embrava and (buffactive.march or buffactive[33] or buffactive[604]) ) or -- embrava + anything
( buffactive.march == 2 and (buffactive[33] or buffactive[604]) ) or -- two marches + anything
( buffactive[33] and buffactive[604] and buffactive.march ) then -- haste + mighty guard + any marches
add_to_chat(8, '-------------Max Haste Mode Enabled--------------')
classes.CustomMeleeGroups:append('Haste_43')
elseif ( (buffactive[604] or buffactive[33]) and buffactive['haste samba'] and buffactive.march == 1) or -- MG or haste + samba with 1 march
( buffactive.march == 2 and buffactive['haste samba'] ) or
( buffactive[580] and buffactive['haste samba'] ) then
add_to_chat(8, '-------------Haste 35%-------------')
classes.CustomMeleeGroups:append('Haste_35')
elseif ( buffactive.march == 2 ) or -- two marches from ghorn
( (buffactive[33] or buffactive[604]) and buffactive.march == 1 ) or -- MG or haste + 1 march
( buffactive[580] ) or -- geo haste
( buffactive[33] and buffactive[604] ) then -- haste with MG
add_to_chat(8, '-------------Haste 30%-------------')
classes.CustomMeleeGroups:append('Haste_30')
elseif buffactive[33] or buffactive[604] or buffactive.march == 1 then
add_to_chat(8, '-------------Haste 15%-------------')
classes.CustomMeleeGroups:append('Haste_15')
end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
-- Default macro set/book
if player.sub_job == 'DNC' then
set_macro_page(2, 4)
elseif player.sub_job == 'WHM' then
set_macro_page(3, 4)
elseif player.sub_job == 'NIN' then
set_macro_page(10, 4)
elseif player.sub_job == 'THF' then
set_macro_page(4, 4)
elseif player.sub_job == 'BLM' then
set_macro_page(5, 4)
else
set_macro_page(1, 4)
end
end
I added a list called 'Shields' under user_seup that you'll need to update with any shields you want gearswap to look for to automatically identify single-wielding. It will also identify single-wielding if your sub slot is empty.
You'll also need to continue/finish iterating hybrid sets over the different combat forms (DW_nin and DW_dnc, e.g. sets.engaged.DW_nin.Acc.PDT.Haste_43), I just didn't feel like doing it all.
Odin.Lygre
サーバ: Odin
Game: FFXI
Posts: 89
By Odin.Lygre 2016-10-26 09:37:10
Could anyone help explain how I would go about adding a new cycle to my gearswap, e.g lowacc/midacc, for Quick Draw (STP/Resistant etc)? Code -------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
--[[
Custom commands:
gs c shot
Uses the currently configured shot on the target, with either <t> or <stnpc> depending on setting.
gs c shot t
Uses the currently configured shot on the target, but forces use of <t>.
Configuration commands:
gs c cycle mainshot
Cycles through the available steps to use as the primary shot when using one of the above commands.
gs c cycle altshot
Cycles through the available steps to use for alternating with the configured main shot.
gs c toggle usealtshot
Toggles whether or not to use an alternate shot.
gs c toggle selectshottarget
Toggles whether or not to use <stnpc> (as opposed to <t>) when using a shot.
gs c toggle LuzafRing -- Toggles use of Luzaf Ring on and off
gs c cycle QuickDraw -- Cycles through Normal, STP, Resistant QuickDraw sets.
--If set to Resistant and using light/dark shot, will use sets.precast.CorsairShot.StatusShot
--Other shots will use sets.precast.CorsairShot.Resistant
Offense mode is melee or ranged. Used ranged offense mode if you are engaged
for ranged weaponskills, but not actually meleeing.
Weaponskill mode, if set to 'Normal', is handled separately for melee and ranged weaponskills.
--]]
-- Initialization function for this job file.
function get_sets()
mote_include_version = 2
-- Load and initialize the include file.
include('Mote-Include.lua')
include('Mote-Globals.lua')
end
-- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
function job_setup()
-- QuickDraw Selector
state.MainShot = M{['description']='Primary Shot', 'Dark Shot', 'Earth Shot', 'Water Shot', 'Wind Shot', 'Fire Shot', 'Ice Shot', 'Thunder Shot'}
state.AltShot = M{['description']='Secondary Shot', 'Earth Shot', 'Water Shot', 'Wind Shot', 'Fire Shot', 'Ice Shot', 'Thunder Shot', 'Dark Shot'}
state.UseAltShot = M(false, 'Use Secondary Shot')
state.SelectShotTarget = M(false, 'Select Quick Draw Target')
state.IgnoreTargetting = M(false, 'Ignore Targetting')
state.CurrentShot = M{['description']='Current Quick Draw', 'Main', 'Alt'}
state.QuickDraw = M{['description']='QD Mode', 'Normal','STP', 'Resistant'}
-- Whether to use Luzaf's Ring
state.LuzafRing = M(false, "Luzaf's Ring")
-- Whether a warning has been given for low ammo
state.warned = M(false)
define_roll_values()
determine_haste_group()
end
-------------------------------------------------------------------------------------------------------------------
-- User setup functions for this job. Recommend that these be overridden in a sidecar file.
-------------------------------------------------------------------------------------------------------------------
-- Setup vars that are user-dependent. Can override this function in a sidecar file.
function user_setup()
state.OffenseMode:options('Normal', 'LowAcc', 'MidAcc', 'HighAcc', 'Fodder')
state.RangedMode:options('Normal', 'Acc', 'Fodder')
state.WeaponskillMode:options('Normal', 'Acc')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'DT')
gear.RAbullet = "Adlivun Bullet"
gear.WSbullet = "Adlivun Bullet"
gear.MAbullet = "Orichalc. Bullet"
gear.QDbullet = "Animikii Bullet"
options.ammo_warning_limit = 5
-- Additional local binds
send_command('bind ^` input /ja "Double-up" <me>')
send_command('bind !` input /ja "Bolter\'s Roll" <me>')
send_command ('bind @` gs c toggle LuzafRing')
send_command('bind ^- gs c cycleback mainshot')
send_command('bind ^= gs c cycle mainshot')
send_command('bind !- gs c cycle altshot')
send_command('bind != gs c cycleback altshot')
send_command('bind ^[ gs c toggle selectshottarget')
send_command('bind ^] gs c toggle usealtshot')
send_command('bind ^, input /ja "Spectral Jig" <me>')
send_command('unbind ^.')
select_default_macro_book()
end
-- Called when this job file is unloaded (eg: job change)
function user_unload()
send_command('unbind ^`')
send_command('unbind !`')
send_command('unbind @`')
send_command('unbind ^-')
send_command('unbind ^=')
send_command('unbind !-')
send_command('unbind !=')
send_command('unbind ^[')
send_command('unbind ^]')
send_command('unbind ^,')
end
-- Define sets and vars used by this job file.
function init_gear_sets()
--------------------------------------
-- Start defining the sets
--------------------------------------
-- Augmented Gear
-- Herculean
gear.Herc_MAB_Head = {name="Herculean Helm", augments={'Mag. Acc.+20 "Mag.Atk.Bns."+20','INT+7','"Mag.Atk.Bns."+11',}}
gear.Herc_TP_Gloves = {name="Herculean Gloves", augments={'Accuracy+30','"Triple Atk."+3','DEX+3',}}
gear.Herc_TP_Legs = {name="Herculean Trousers", augments={'Attack+23','"Triple Atk."+4','STR+3','Accuracy+8',}}
gear.Herc_MAB_Legs = { name="Herculean Trousers", augments={'"Mag.Atk.Bns."+25','Weapon skill damage +3%','MND+10',}}
gear.Herc_MAB_Feet = {name="Herculean Boots", augments={'Mag. Acc.+18 "Mag.Atk.Bns."+18','STR+10','Mag. Acc.+11','"Mag.Atk.Bns."+12',}}
gear.Herc_TP_Feet = {name="Herculean Boots", augments={'Accuracy+27','"Triple Atk."+2','DEX+7',}}
-- Taeon
gear.Taeon_WS_Head = {name="Taeon Chapeau", augments={'Mag. Acc.+15 "Mag.Atk.Bns."+15','Weapon skill damage +2%',}}
gear.Taeon_TP_Head = {name="Taeon Chapeau", augments={'Accuracy+23','"Triple Atk."+1',}}
gear.Taeon_TP_Legs = {name="Taeon Tights", augments={'Accuracy+23','"Triple Atk."+2',}}
-- Ambuscade Capes
gear.COR_WS_Cape = {name="Camulus's Mantle", augments={'AGI+20','Mag. Acc+20 /Mag. Dmg.+20','Weapon skill damage +10%',}}
gear.COR_WS2_Cape = {name="Ankou's Mantle", augments={'STR+20','Accuracy+20 Attack+20','Weapon skill damage +10%',}}
gear.COR_TP_Cape = { name="Camulus's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10',}}
-- Precast Sets
sets.precast.JA['Triple Shot'] = {body="Chasseur's Frac",back=gear.COR_WS_Cape}
sets.precast.JA['Snake Eye'] = {legs="Commodore Culottes +2"}
sets.precast.JA['Wild Card'] = {feet="Lanun Bottes +1"}
sets.precast.JA['Random Deal'] = {body="Lanun Frac +1"}
sets.precast.CorsairRoll = {
head="Lanun Tricorne",
body="Meg. Cuirie +1",
hands="Chasseur's Gants",
legs="Desultor Tassets",
feet="Lanun Bottes +1",
neck="Twilight Torque",
ear1="Darkness earring",
ear2="Darkness earring",
ring1="Luzaf's Ring",
ring2="Barataria Ring",
back="Camulus's Mantle",
waist="Flume Belt",
}
-- sets.precast.CorsairRoll["Caster's Roll"] = set_combine(sets.precast.CorsairRoll, {legs="Chas. Culottes"})
sets.precast.CorsairRoll["Courser's Roll"] = set_combine(sets.precast.CorsairRoll, {feet="Chass. Bottes"})
sets.precast.CorsairRoll["Blitzer's Roll"] = set_combine(sets.precast.CorsairRoll, {head="Chass. Tricorne"})
sets.precast.CorsairRoll["Tactician's Roll"] = set_combine(sets.precast.CorsairRoll, {body="Chasseur's Frac"})
sets.precast.CorsairRoll["Allies' Roll"] = set_combine(sets.precast.CorsairRoll, {hands="Chasseur's Gants"})
sets.precast.LuzafRing = {ring2="Luzaf's Ring"}
sets.precast.FoldDoubleBust = {hands="Lanun Gants"}
sets.precast.CorsairShot = {
ammo=gear.QDbullet,
head=gear.Herc_MAB_Head,
body="Mirke wardecors",
hands="Carmine Fin. Ga. +1",
legs="Laksamana's trews +1",
feet=gear.Herc_MAB_Feet,
neck="Sanctity Necklace",
ear1="Hecate's Earring",
ear2="Friomisi Earring",
ring1="Arvina Ringlet +1",
ring2="Acumen Ring",
back=gear.COR_WS_Cape,
waist="Eschan Stone",
}
sets.precast.CorsairShot.STP = {
ammo=gear.QDbullet,
head="",
body="Mirke wardecors",
hands="Schutzen Mittens",
legs="Chas. Culottes",
feet="Carmine Greaves",
neck="Sanctity Necklace",
ear1="",
ear2="",
ring1="Raja Ring",
ring2="Petrov Ring",
back=gear.COR_TP_Cape,
waist="Goading Belt",
}
sets.precast.CorsairShot.Resistant = {
ammo=gear.QDbullet,
head="Carmine Mask",
body="Mirke wardecors",
hands="Leyline gloves",
legs="Rawhide Trousers",
feet=gear.Herc_MAB_Feet,
neck="Sanctity Necklace",
ear1="Lifestorm Earring",
ear2="Psystorm Earring",
ring1="Weatherspoon ring",
ring2="Etana Ring",
back=gear.COR_WS_Cape,
waist="Eschan Stone",
}
sets.precast.CorsairShot.StatusShot = {
ammo=gear.QDbullet,
head="Carmine Mask",
body="Mirke wardecors",
hands="Leyline gloves",
legs="Rawhide Trousers",
feet=gear.Herc_MAB_Feet,
neck="Sanctity Necklace",
ear1="Lifestorm Earring",
ear2="Psystorm Earring",
ring1="Weatherspoon ring",
ring2="Etana Ring",
back=gear.COR_WS_Cape,
waist="Eschan Stone",
}
sets.precast.CorsairShot['Light Shot'] = set_combine(sets.precast.CorsairShot, {
hands="Leyline gloves",
head="Carmine Mask",
legs="Rawhide Trousers",
ear1="Lifestorm Earring",
ear2="Psystorm Earring",
ring1="Weatherspoon ring",
ring2="Etana Ring",
})
sets.precast.CorsairShot['Dark Shot'] = set_combine(sets.precast.CorsairShot, {
hands="Leyline gloves",
head="Pixie Hairpin +1",
legs="Rawhide Trousers",
ear1="Lifestorm Earring",
ear2="Psystorm Earring",
ring1="Weatherspoon ring",
ring2="Archon Ring",
})
sets.precast.Waltz = {
hands="Slither Gloves +1",
legs="Desultor Tassets",
ring1="Asklepian Ring",
ring2="Valseur's Ring",
} -- CHR and VIT
sets.precast.Waltz['Healing Waltz'] = {}
sets.precast.FC = {
head="Carmine Mask", --12
body="Taeon Tabard", --7
hands="Leyline Gloves", --8
legs="Rawhide Trousers", --5
feet="Carmine Greaves", --7
neck="Orunmila's Torque", --5
ear1="Loquacious Earring", --2
ear2="Halasz Earring", --1
ring1="Prolix Ring", --2
ring2="Weatherspoon ring", --5(3)
waist="Flume belt",
}
sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {
neck="Magoraga Beads",
ring1="Lebeche Ring",
})
sets.precast.RA = {
ammo=gear.RAbullet,
head="Aurore Beret +1", --5
body="Pursuer's Doublet", --6
hands="Carmine Fin. Ga. +1", --8
legs="Chasseur's culottes", --6
feet="Meg. Jam. +1", --8
back="Navarch's Mantle", --6.5
waist="Impulse Belt", --3
}
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {
ammo=gear.WSbullet,
head="Meghanada Visor +1",
body="Meg. Cuirie +1",
hands="Meghanada gloves +1",
legs="Meg. Chausses +1",
feet="Meg. Jam. +1",
neck="Fotia Gorget",
ear1="Moonshade Earring",
ear2="Ishvara Earring",
ring1="Arvina Ringlet +1",
ring2="Garuda Ring",
back=gear.COR_WS_Cape,
waist="Fotia belt",
}
sets.precast.WS.Acc = set_combine(sets.precast.WS, {
hands="Meg. Gloves +1",
})
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS["Last Stand"] = set_combine(sets.precast.WS['Last Stand'], {
hands="Meg. Gloves +1",
ring1="Garuda Ring",
})
sets.precast.WS['Last Stand'].Acc = set_combine(sets.precast.WS['Last Stand'], {
ammo=gear.WSbullet,
hands="Meg. Gloves +1",
ear2="Volley Earring",
ring1="Cacoethic Ring +1",
back="Gunslinger's cape",
})
sets.precast.WS['Wildfire'] = {
ammo=gear.MAbullet,
head=gear.Herc_MAB_Head,
body="Samnuha Coat",
hands="Carmine Fin. Ga. +1",
legs=gear.Herc_MAB_Legs,
feet=gear.Herc_MAB_Feet,
neck="Sanctity Necklace",
ear1="Hecate's Earring",
ear2="Friomisi Earring",
ring1="Arvina Ringlet +1",
ring2="Garuda Ring",
back=gear.COR_WS_Cape,
waist="Eschan Stone",
}
sets.precast.WS['Leaden Salute'] = {
ammo=gear.MAbullet,
head="Pixie Hairpin +1",
body="Samnuha Coat",
hands="Carmine Fin. Ga. +1",
legs=gear.Herc_MAB_Legs,
feet=gear.Herc_MAB_Feet,
neck="Sanctity Necklace",
ear1="Moonshade Earring",
ear2="Friomisi Earring",
ring1="Archon Ring",
ring2="Arvina Ringlet +1",
back=gear.COR_WS_Cape,
waist="Eschan Stone",
}
sets.precast.WS['Aeolian Edge'] = {
ammo=gear.MAbullet,
head=gear.Herc_MAB_Head,
body="Samnuha Coat",
hands="Leyline gloves",
legs=gear.Herc_MAB_Legs,
feet=gear.Herc_MAB_Feet,
neck="Sanctity Necklace",
ear1="Hecate's Earring",
ear2="Friomisi Earring",
ring1="Arvina Ringlet +1",
ring2="Garuda Ring",
back=gear.COR_WS_Cape,
waist="Eschan Stone",
}
sets.precast.WS['Evisceration'] = {
head="",
body="Meg. Cuirie +1",
hands="Meg. Gloves +1",
legs="",
feet="",
neck="Fotia gorget",
ear1="Moonshade Earring",
ear2="Brutal Earring",
ring1="",
ring2="Epona's Ring",
back="",
waist="Fotia belt",
}
sets.precast.WS['Savage Blade'] = {
head="Meghanada Visor +1",
body="Meg. Cuirie +1",
hands="Meghanada gloves +1",
legs="Meg. Chausses +1",
feet="Rawhide boots",
neck="Caro necklace",
ear1="Moonshade Earring",
ear2="Ishvara Earring",
ring1="Ifrit Ring",
ring2="Ifrit Ring",
back=gear.COR_WS2_Cape,
waist="Prosilio belt +1",
}
sets.precast.WS['Savage Blade'].Acc = set_combine(sets.precast.WS['Savage Blade'], {
ring1="Rufescent Ring",
waist="Grunfeld Rope",
})
sets.precast.WS['Requiescat'] = set_combine(sets.precast.WS['Savage Blade'], {
neck="Fotia gorget",
ring1="Rufescent Ring",
ring2="Epona's Ring",
back="Bleating Mantle",
waist="Fotia Belt",
}) --MND
sets.precast.WS['Requiescat'].Acc = set_combine(sets.precast.WS['Requiescat'], {
head="Carmine Mask"
})
-- Midcast Sets
sets.midcast.CorsairRoll = {
head="Lanun Tricorne",
body="Meg. Cuirie +1",
hands="Chasseur's Gants",
legs="Desultor Tassets",
feet="Lanun Bottes +1",
neck="Twilight Torque",
ear1="Darkness earring",
ear2="Darkness earring",
ring1="Luzaf's Ring",
ring2="Barataria Ring",
back="Camulus's Mantle",
waist="Flume Belt",
}
sets.midcast.FastRecast = {
ear1="Loquacious Earring",
ear2="",
}
sets.midcast.Cure = {
neck="Incanter's Torque",
ear1="Roundel Earring",
ear2="Mendi. Earring",
ring1="",
ring2="",
waist="",
}
sets.midcast.Utsusemi = {
waist="Pya'ekue belt",
}
-- Ranged gear
sets.midcast.RA = {
ammo=gear.RAbullet,
head="Pursuer's Beret",
body="Pursuer's Doublet",
hands="Carmine Fin. Ga. +1",
legs="Meg. Chausses +1",
feet="Meg. Jam. +1",
neck="Marked Gorget",
ear1="Navarch's Earring",
ear2="Volley Earring",
ring1="Arvina Ringlet +1",
ring2="Garuda Ring",
back="Gunslinger's Cape",
waist="Eschan Stone",
}
sets.midcast.RA.Acc = set_combine(sets.midcast.RA, {
ammo=gear.RAbullet,
hands="Meg. Gloves +1",
body="Meg. Cuirie +1",
ring1="Cacoethic Ring +1",
ring1="Hadjuk Ring",
})
sets.midcast.RA.Fodder = set_combine(sets.midcast.RA, {
ammo=gear.RAbullet,
neck="Ocachi Gorget",
})
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {}
-- Idle sets
sets.idle = {
ammo=gear.RAbullet,
head="Meghanada visor +1",
body="Meg. Cuirie +1",
hands="Kurys gloves",
legs="Carmine Cuisses +1",
feet="Lanun bottes +1",
neck="Sanctity Necklace",
ear1="Eabani Earring",
ear2="Infused Earring",
ring1="Paguroidea Ring",
ring2="Sheltered Ring",
back="Solemnity Cape",
waist="Flume Belt",
}
sets.idle.DT = set_combine (sets.idle, {
head="Meghanada visor +1", --4/0
body="Meg. Cuirie +1", --7/0
hands="Meg. Gloves +1", --3/0
legs="Meg. Chausses +1", --5/0
feet="Lanun Bottes +1", --4/0
neck="Twilight Torque", --5/5
ear1="Darkness Earring", --2/0
ear2="Darkness Earring", --2/0
ring1="Gelatinous Ring +1", --6/(-2)
ring2="Dark Ring", --0/4
back="Solemnity Cape", --4/4
waist="Flume Belt", --4/0
})
sets.idle.Town = set_combine(sets.idle, {
hands="Carmine Fin. Ga. +1",
back=gear.COR_WS_Cape,
waist="Eschan Stone",
})
-- Defense sets
sets.defense.PDT = {
head="Meghanada visor +1", --4/0
body="Meg. Cuirie +1", --7/0
hands="Meg. Gloves +1", --3/0
legs="Meg. Chausses +1", --5/0
feet="Lanun Bottes +1", --4/0
neck="Twilight Torque", --5/5
ear1="Darkness Earring", --2/0
ear2="Darkness Earring", --2/0
ring1="Gelatinous Ring +1", --6/(-2)
ring2="Jelly Ring", --10/10
back="Solemnity Cape", --4/4
waist="Flume Belt", --4/0
}
sets.defense.MDT = set_combine(sets.defense.PDT, {
ear1="Merman's Earring", --0/2
ear2="Merman's Earring", --0/2
ring1="Dark Ring", --0/4
ring2="Minerva's Ring", --(-8)/8
})
sets.Kiting = {legs="Crimson cuisses"}
-- 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=gear.RAbullet,
head="Adhemar Bonnet",
body="Adhemar Jacket",
hands="Adhemar Wristbands",
legs="Carmine cuisses +1",
feet="Taeon boots",
neck="Lissome Necklace",
ear1="Eabani Earring",
ear2="Suppanomimi",
ring1="Petrov Ring",
ring2="Epona's Ring",
back="Bleating Mantle",
waist="Windbuffet Belt +1",
}
sets.engaged.LowAcc = set_combine(sets.engaged, {
ring2="Rajas Ring",
back=gear.COR_TP_Cape,
})
sets.engaged.MidAcc = set_combine(sets.engaged.LowAcc, {
ear1="Cessance Earring",
feet=gear.Herc_TP_Feet,
waist="Kentarch Belt +1",
})
sets.engaged.HighAcc = set_combine(sets.engaged.MidAcc, {
head="Carmine Mask",
neck="Subtlety spectacles",
ear2="Mache Earring",
ring1="Cacoethic Ring +1",
ring2="Enlivened Ring",
back=gear.COR_TP_Cape,
})
sets.engaged.Fodder = set_combine(sets.engaged, {
body="Thaumas Coat",
neck="Asperity Necklace",
})
sets.engaged.HighHaste = {
ammo=gear.RAbullet,
head="Adhemar Bonnet",
body="Adhemar Jacket", --5
hands="Adhemar Wristbands", --3
legs=gear.Herc_TP_Legs,
feet=gear.Herc_TP_Feet,
neck="Lissome Necklace",
ear1="Cessance Earring",
ear2="Suppanomimi", --5
ring1="Petrov Ring",
ring2="Epona's Ring",
back="Bleating Mantle",
waist="Windbuffet Belt +1",
}
sets.engaged.HighHaste.LowAcc = set_combine(sets.engaged.HighHaste, {
ring2="Rajas Ring",
back=gear.COR_TP_Cape,
})
sets.engaged.HighHaste.MidAcc = set_combine(sets.engaged.HighHaste.LowAcc, {
legs="Taeon tights",
ring1="Cacoethic Ring +1",
waist="Kentarch Belt +1",
})
sets.engaged.HighHaste.HighAcc = set_combine(sets.engaged.HighHaste.MidAcc, {
head="Carmine Mask",
legs="Carmine cuisses +1",
neck="Subtlety spectacles",
ear2="Mache Earring",
ring2="Enlivened Ring",
})
sets.engaged.HighHaste.Fodder = set_combine(sets.engaged.HighHaste, {
body="Thaumas Coat",
neck="Asperity Necklace",
})
sets.engaged.MaxHaste = {
ammo=gear.RAbullet,
head="Adhemar Bonnet",
body="Adhemar Jacket", --5
hands="Adhemar Wristbands", --3
legs=gear.Herc_TP_legs,
feet=gear.Herc_TP_feet,
neck="Lissome Necklace",
ear1="Cessance Earring",
ear2="Suppanomimi",
ring1="Petrov Ring",
ring2="Epona's Ring",
back="Bleating Mantle",
waist="Windbuffet Belt +1",
}
sets.engaged.MaxHaste.LowAcc = set_combine(sets.engaged.HighHaste, {
ring2="Rajas Ring",
back=gear.COR_TP_Cape,
})
sets.engaged.MaxHaste.MidAcc = set_combine(sets.engaged.MaxHaste.LowAcc, {
legs="Taeon tights",
ring1="Cacoethic Ring +1",
waist="Kentarch Belt +1",
})
sets.engaged.MaxHaste.HighAcc = set_combine(sets.engaged.MaxHaste.MidAcc, {
head="Carmine Mask",
neck="Subtlety spectacles",
ear2="Mache Earring",
ring2="Enlivened Ring",
})
sets.engaged.MaxHaste.Fodder = set_combine(sets.engaged.MaxHaste, {
body="Thaumas Coat",
neck="Asperity Necklace",
})
sets.Obi = {waist="Hachirin-no-Obi"}
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)
-- Check that proper ammo is available if we're using ranged attacks or similar.
if spell.action_type == 'Ranged Attack' or spell.type == 'WeaponSkill' or spell.type == 'CorsairShot' then
do_bullet_checks(spell, spellMap, eventArgs)
end
if (spell.type == 'CorsairRoll' or spell.english == "Double-Up") and state.LuzafRing.value then
equip(sets.precast.LuzafRing)
elseif spell.type == 'CorsairShot' and S{'Dark Shot','Light Shot'}:contains(spell.english) then
if state.CastingMode.value == 'Resistant' or state.QuickDraw.value == 'Resistant' then
--To specify a FULL M.ACC set for LightShot/DarkShot, whereas for other shots, the resistant mode would prefer a different ratio of m.acc/mab
classes.CustomClass = 'StatusShot'
end
elseif spell.type == 'CorsairShot' and state.QuickDraw.value ~= 'Normal' then
classes.CustomClass = state.QuickDraw.value
elseif spell.english == 'Fold' and buffactive['Bust'] == 2 then
if sets.precast.FoldDoubleBust then
equip(sets.precast.FoldDoubleBust)
eventArgs.handled = true
end
end
end
function job_post_precast(spell, action, spellMap, eventArgs)
-- Equip obi if weather/day matches for WS/Quick Draw.
if spell.type == 'WeaponSkill' or spell.type == 'CorsairShot' then
if spell.english == 'Leaden Salute' and (world.weather_element == 'Dark' or world.day_element == 'Dark') then
equip(sets.Obi)
elseif spell.english == 'Wildfire' and (world.weather_element == 'Fire' or world.day_element == 'Fire') then
equip(sets.Obi)
elseif spell.type == 'CorsairShot' and (spell.element == world.weather_element or spell.element == world.day_element) then
equip(sets.Obi)
end
end
end
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
function job_aftercast(spell, action, spellMap, eventArgs)
if spell.type == 'CorsairRoll' and not spell.interrupted then
display_roll_info(spell)
end
end
function job_status_change(new_status, old_status)
if new_status == 'Engaged' then
determine_haste_group()
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- Return a customized weaponskill mode to use for weaponskill sets.
-- Don't return anything if you're not overriding the default value.
-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function job_update(cmdParams, eventArgs)
determine_haste_group()
end
function get_custom_wsmode(spell, spellMap, default_wsmode)
if buffactive['Transcendancy'] then
return 'Brew'
end
end
-- Called by the 'update' self-command, for common needs.
-- Set eventArgs.handled to true if we don't want automatic equipping of gear.
function job_update(cmdParams, eventArgs)
if newStatus == 'Engaged' and player.equipment.main == 'Chatoyant Staff' then
state.OffenseMode:set('Ranged')
end
end
-- Handle auto-targetting based on local setup.
function job_auto_change_target(spell, action, spellMap, eventArgs)
if spell.type == 'CorsairShot' then
if state.IgnoreTargetting.value == true then
state.IgnoreTargetting:reset()
eventArgs.handled = true
end
eventArgs.SelectNPCTargets = state.SelectShotTarget.value
end
end
-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
local msg = ''
msg = msg .. '[ Offense/Ranged: '..state.OffenseMode.current..'/'..state.RangedMode.current
msg = msg .. ' ][ WS: '..state.WeaponskillMode.current
if state.DefenseMode.value ~= 'None' then
msg = msg .. ' ][ Defense: ' .. state.DefenseMode.value .. state[state.DefenseMode.value .. 'DefenseMode'].value
end
if state.Kiting.value then
msg = msg .. ' ][ Kiting Mode: ON'
end
msg = msg .. ' ][ '..state.MainShot.current
if state.UseAltShot.value == true then
msg = msg .. '/'..state.AltShot.current
end
msg = msg .. ' ]'
add_to_chat(061, msg)
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- User self-commands.
-------------------------------------------------------------------------------------------------------------------
-- Called for custom player commands.
function job_self_command(cmdParams, eventArgs)
if cmdParams[1] == 'Shot' then
if cmdParams[2] == 't' then
state.IgnoreTargetting:set()
end
local doShot = ''
if state.UseAltShot.value == true then
doShot = state[state.CurrentShot.current..'Shot'].current
state.CurrentShot:cycle()
else
doShot = state.MainShot.current
end
send_command('@input /ja "'..doShot..'" <t>')
end
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function determine_haste_group()
-- We have three groups of DW in gear: Charis body, Charis neck + DW earrings, and Patentia Sash.
-- For high haste, we want to be able to drop one of the 10% groups (body, preferably).
-- High haste buffs:
-- 2x Marches + Haste
-- 2x Marches + Haste Samba
-- 1x March + Haste + Haste Samba
-- Embrava + any other haste buff
-- For max haste, we probably need to consider dropping all DW gear.
-- Max haste buffs:
-- Embrava + Haste/March + Haste Samba
-- 2x March + Haste + Haste Samba
classes.CustomMeleeGroups:clear()
if buffactive.embrava and (buffactive.haste or buffactive.march) then
classes.CustomMeleeGroups:append('MaxHaste')
elseif buffactive.march == 2 and buffactive.haste then
classes.CustomMeleeGroups:append('MaxHaste')
elseif buffactive.embrava and (buffactive.haste or buffactive.march) then
classes.CustomMeleeGroups:append('HighHaste')
elseif buffactive.march == 1 and buffactive.haste then
classes.CustomMeleeGroups:append('HighHaste')
elseif buffactive.march == 2 and buffactive.haste then
classes.CustomMeleeGroups:append('HighHaste')
end
end
function define_roll_values()
rolls = {
["Corsair's Roll"] = {lucky=5, unlucky=9, bonus="Experience Points"},
["Ninja Roll"] = {lucky=4, unlucky=8, bonus="Evasion"},
["Hunter's Roll"] = {lucky=4, unlucky=8, bonus="Accuracy"},
["Chaos Roll"] = {lucky=4, unlucky=8, bonus="Attack"},
["Magus's Roll"] = {lucky=2, unlucky=6, bonus="Magic Defense"},
["Healer's Roll"] = {lucky=3, unlucky=7, bonus="Cure Potency Received"},
["Drachen Roll"] = {lucky=4, unlucky=8, bonus="Pet Magic Accuracy/Attack"},
["Choral Roll"] = {lucky=2, unlucky=6, bonus="Spell Interruption Rate"},
["Monk's Roll"] = {lucky=3, unlucky=7, bonus="Subtle Blow"},
["Beast Roll"] = {lucky=4, unlucky=8, bonus="Pet Attack"},
["Samurai Roll"] = {lucky=2, unlucky=6, bonus="Store TP"},
["Evoker's Roll"] = {lucky=5, unlucky=9, bonus="Refresh"},
["Rogue's Roll"] = {lucky=5, unlucky=9, bonus="Critical Hit Rate"},
["Warlock's Roll"] = {lucky=4, unlucky=8, bonus="Magic Accuracy"},
["Fighter's Roll"] = {lucky=5, unlucky=9, bonus="Double Attack Rate"},
["Puppet Roll"] = {lucky=3, unlucky=7, bonus="Pet Magic Attack/Accuracy"},
["Gallant's Roll"] = {lucky=3, unlucky=7, bonus="Defense"},
["Wizard's Roll"] = {lucky=5, unlucky=9, bonus="Magic Attack"},
["Dancer's Roll"] = {lucky=3, unlucky=7, bonus="Regen"},
["Scholar's Roll"] = {lucky=2, unlucky=6, bonus="Conserve MP"},
["Naturalist's Roll"] = {lucky=3, unlucky=7, bonus="Enh. Magic Duration"},
["Runeist's Roll"] = {lucky=4, unlucky=8, bonus="Magic Evasion"},
["Bolter's Roll"] = {lucky=3, unlucky=9, bonus="Movement Speed"},
["Caster's Roll"] = {lucky=2, unlucky=7, bonus="Fast Cast"},
["Courser's Roll"] = {lucky=3, unlucky=9, bonus="Snapshot"},
["Blitzer's Roll"] = {lucky=4, unlucky=9, bonus="Attack Delay"},
["Tactician's Roll"] = {lucky=5, unlucky=8, bonus="Regain"},
["Allies's Roll"] = {lucky=3, unlucky=10, bonus="Skillchain Damage"},
["Miser's Roll"] = {lucky=5, unlucky=7, bonus="Save TP"},
["Companion's Roll"] = {lucky=2, unlucky=10, bonus="Pet Regain and Regen"},
["Avenger's Roll"] = {lucky=4, unlucky=8, bonus="Counter Rate"},
}
end
function display_roll_info(spell)
rollinfo = rolls[spell.english]
local rollsize = (state.LuzafRing.value and 'Large') or 'Small'
if rollinfo then
add_to_chat(104, '[ Lucky: '..tostring(rollinfo.lucky)..' / Unlucky: '..tostring(rollinfo.unlucky)..' ] '..spell.english..': '..rollinfo.bonus..' ('..rollsize..') ')
end
end
-- Determine whether we have sufficient ammo for the action being attempted.
function do_bullet_checks(spell, spellMap, eventArgs)
local bullet_name
local bullet_min_count = 1
if spell.type == 'WeaponSkill' then
if spell.skill == "Marksmanship" then
if spell.element == 'None' then
-- physical weaponskills
bullet_name = gear.WSbullet
else
-- magical weaponskills
bullet_name = gear.MAbullet
end
else
-- Ignore non-ranged weaponskills
return
end
elseif spell.type == 'CorsairShot' then
bullet_name = gear.QDbullet
elseif spell.action_type == 'Ranged Attack' then
bullet_name = gear.RAbullet
if buffactive['Triple Shot'] then
bullet_min_count = 3
end
end
local available_bullets = player.inventory[bullet_name] or player.wardrobe[bullet_name]
-- If no ammo is available, give appropriate warning and end.
if not available_bullets then
if spell.type == 'CorsairShot' and player.equipment.ammo ~= 'empty' then
add_to_chat(104, 'No Quick Draw ammo left. Using what\'s currently equipped ('..player.equipment.ammo..').')
return
elseif spell.type == 'WeaponSkill' and player.equipment.ammo == gear.RAbullet then
-- add_to_chat(104, 'No weaponskill ammo left. Using what\'s currently equipped (standard ranged bullets: '..player.equipment.ammo..').')
return
else
add_to_chat(104, 'No ammo ('..tostring(bullet_name)..') available for that action.')
eventArgs.cancel = true
return
end
end
-- Don't allow shooting or weaponskilling with ammo reserved for quick draw.
if spell.type ~= 'CorsairShot' and bullet_name == gear.QDbullet and available_bullets.count <= bullet_min_count then
add_to_chat(104, 'No ammo will be left for Quick Draw. Cancelling.')
eventArgs.cancel = true
return
end
-- Low ammo warning.
if spell.type ~= 'CorsairShot' and state.warned.value == false
and available_bullets.count > 1 and available_bullets.count <= options.ammo_warning_limit then
local msg = '***** LOW AMMO WARNING: '..bullet_name..' *****'
--local border = string.repeat("*", #msg)
local border = ""
for i = 1, #msg do
border = border .. "*"
end
add_to_chat(104, border)
add_to_chat(104, msg)
add_to_chat(104, border)
state.warned:set()
elseif available_bullets.count > options.ammo_warning_limit and state.warned then
state.warned:reset()
end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
if player.sub_job == 'DNC' then
set_macro_page(1, 10)
else
set_macro_page(1, 10)
end
end
Is this what you are looking for? Added self-command and brief explanation where you have the others at the beginning of the file
[+]
サーバ: Odin
Game: FFXI
Posts: 42
By Odin.Psycooo 2016-10-26 12:43:51
Ok, I am back with more questions....
I managed to add/define sets based of the amount of magical haste I have. So now if I have no haste it equips one set of gear, if I get haste 1 or haste 2 it equips based on value of haste all the way up to capped haste.
What I would like additionally is for it to auto equip the single wield gearset in the event I don't have a dual wield subjob, furthermore I would like a way to add in additional sets if I am using /dnc instead of my normal /nin, because the native DW traits are different I would need to add a whole bunch of rules and sets, the problem is I have NO FRIGGIN' IDEA how to do any of that. I literally stole all my haste defined rules from a thf lua and spent like 3 hours til I got it to work.
Edit: Ideally I would like to do this same thing for my terribly designed cor lua, that way I don't have to cycle through 14 sets
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()
determine_haste_group()
state.Buff.Saboteur = buffactive.saboteur or false
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', 'Mid', 'Acc', 'SingleWield')
state.HybridMode:options('Normal', 'PhysicalDef', 'MagicalDef')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'PDT', 'MDT')
select_default_macro_book()
gear.CureStaff = {name=""}
gear.CureFeet = {name=""}
state.MagicBurst = M(false, 'Magic Burst')
state.CureHate = M(false, 'Cure Hate')
send_command('bind !` gs c toggle MagicBurst')
send_command('bind ^` gs c toggle CureHate')
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['Chainspell'] = {body="Vitivation Tabard +1"}
-- Waltz set (chr and vit)
sets.precast.Waltz = {}
-- Don't need any special gear for Healing Waltz.
sets.precast.Waltz['Healing Waltz'] = {}
-- Fast cast sets for spells
-- 80% Fast Cast (including trait) for all spells, plus 5% quick cast
-- No other FC sets necessary.
sets.precast.FC = {}
sets.precast.FC.Impact = set_combine(sets.precast.FC, {head=empty,body="Twilight Cloak"})
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {}
sets.precast.WS['Circle Blade'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Sanguine Blade'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Requiescat'] = {}
sets.precast.WS['Aeolian Edge'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Savage Blade'] = {}
sets.precast.WS['Chant du Cygne'] = {}
sets.precast.WS['True Strike'] = {}
sets.precast.WS['Exenterator'] = {}
sets.precast.WS['Evisceration'] = {}
sets.precast.WS['Death Blossom'] = {}
-- Midcast Sets
sets.midcast.Cure = {}
sets.midcast.Curaga = sets.midcast.Cure
sets.midcast.CureWeather = {}
sets.midcast.CureSelf = {}
sets.midcast.CureMelee = {}
sets.midcast['Enhancing Magic'] = {}
sets.midcast['Enhancing Magic'].Temper = {}
sets.midcast['Enhancing Magic'].RegenSelf = {}
sets.midcast['Enhancing Magic'].RefreshSelf = {}
sets.midcast['Enhancing Magic'].HasteSelf = {}
sets.midcast['Enhancing Magic'].EnSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.midcast['Enhancing Magic'].GainSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.midcast['Enhancing Magic'].BarSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.buff.ComposureOther = {head="Lethargy Chappel +1",body="Lethargy Sayon +1",
legs="Lethargy Fuseau +1",feet="Lethargy Houseaux +1"}
sets.midcast.Protect = {}
sets.midcast.Shell = sets.midcast.Protect
sets.midcast['Enhancing Magic'].Phalanx = {}
sets.midcast.Cursna = {}
sets.midcast.Stoneskin = {}
sets.midcast['Enfeebling Magic'] = {}
sets.midcast.MndEnfeebles = {}
sets.midcast.IntEnfeebles = {}
sets.midcast.Blind = {}
sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
sets.midcast.Distract = {}
sets.midcast.Frazzle = {}
sets.midcast['Distract II'] = sets.midcast.Distract
sets.midcast['Distract III'] = sets.midcast.Distract
sets.midcast['Frazzle II'] = {}
sets.midcast['Frazzle III'] = sets.midcast.Frazzle
sets.midcast['Dia III'] = set_combine(sets.midcast['Enfeebling Magic'], {head="Vitivation Chapeau +1"})
sets.midcast['Slow II'] = set_combine(sets.midcast['Enfeebling Magic'], {head="Vitivation Chapeau +1"})
sets.Lunge = {}
sets.Convert = {main="Murgleis"}
sets.midcast['Elemental Magic'] ={}
sets.midcast['Elemental Magic']['Low'] = {}
sets.midcast.Impact = set_combine(sets.midcast['Elemental Magic'], {head=empty,body="Twilight Cloak"})
sets.midcast['Stun'] = {}
sets.midcast.Drain = {}
sets.midcast.Aspir = sets.midcast.Drain
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {}
-- Idle sets
sets.idle = {}
sets.idle.Town = {}
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.Mid = {}
sets.engaged.Acc = {}
sets.engaged.SingleWield = {}
sets.engaged.Evasion = sets.engaged
sets.engaged.Mid.Evasion = sets.engaged.Mid
sets.engaged.Acc.Evasion = sets.engaged.Acc
sets.engaged.PDT = sets.defense.PDT
sets.engaged.Mid.PDT = sets.defense.MDT
sets.engaged.Acc.PDT = sets.defense.PDT
-- Haste 43%
sets.engaged.Haste_43 = set_combine(sets.engaged, {})
sets.engaged.Mid.Haste_43 = sets.engaged.Mid
sets.engaged.Acc.Haste_43 = sets.engaged.Acc
sets.engaged.Evasion.Haste_43 = sets.engaged.Haste_43
sets.engaged.PDT.Haste_43 = sets.defense.PDT
-- 40
sets.engaged.Haste_40 = set_combine(sets.engaged.Haste_43, {})
sets.engaged.Mid.Haste_40 = sets.engaged.Mid
sets.engaged.Acc.Haste_40 = sets.engaged.Acc
sets.engaged.Evasion.Haste_40 = sets.engaged.Haste_40
sets.engaged.PDT.Haste_40 = sets.defense.PDT
-- 30
sets.engaged.Haste_30 = sets.engaged
sets.engaged.Mid.Haste_30 = sets.engaged.Mid
sets.engaged.Acc.Haste_30 = sets.engaged.Acc
sets.engaged.Evasion.Haste_30 = sets.engaged
sets.engaged.PDT.Haste_30 = sets.defense.PDT
-- 25
sets.engaged.Haste_25 = set_combine(sets.engaged.Haste_30, {})
sets.engaged.Acc.Haste_25 = sets.engaged.Acc
sets.engaged.Mid.Haste_25 = sets.engaged.Mid
sets.engaged.Evasion.Haste_25 = sets.engaged
sets.engaged.PDT.Haste_25 = sets.defense.PDT
sets.magic_burst = {}
sets.cure_hate = {}
sets.Enmity = {}
-- Sets for special buff conditions on spells.
sets.buff.Saboteur = {hands="Lethargy Gantherots +1"}
end
LowNukes = S{'Stone' , 'Aero' , 'Blizzard' , 'Fire' , 'Water' , 'Thunder' ,
'Stone II' , 'Aero II' , 'Blizzard II' , 'Fire II' , 'Water II' , 'Thunder II',
'Stonega' , 'Aeroga' , 'Blizzaga' , 'Firaga' , 'Waterga' , 'Thundaga',
'Stonega II' , 'Aeroga II' , 'Blizzaga II' , 'Firaga II' , 'Waterga II' , 'Thundaga II'}
MndEnfeebles = S{'Slow' , 'Silence' , 'Paralyze' , 'Addle' , 'Slow II' , 'Paralyze II' , 'Addle II'}
IntEnfeebles = S{'Bind' , 'Break' , 'Gravity' , 'Poison' , 'Sleep' , 'Gravity II' , 'Poison II' , 'Sleep II'}
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
function job_precast(spell, action, spellMap, eventArgs)
if spell.skill == 'Healing Magic' and spellMap ~= 'StatusRemoval' then
gear.CureFeet.name = "Vanya Clogs"
if player.status == 'Engaged' then
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
if spell.target.type == 'SELF' then
gear.CureFeet.name = "Medium's Sabots"
else
gear.CureFeet.name = "Vanya Clogs"
end
else
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
end
if spell.target.type == 'SELF' then
gear.default.obi_waist = "Chuq'aba Belt"
else
gear.default.obi_waist = "Salire belt"
end
if world.weather_element == 'Light' then
gear.CureStaff.name = "Chatoyant Staff"
else
gear.CureStaff.name = "Serenity"
end
else
gear.default.obi_waist = "Salire belt"
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
end
if spell.name == 'Lunge' or spell.name == 'Swipe' then
equip(sets.Lunge)
end
if spell.name == 'Vallation' then
equip(sets.Enmity)
end
if spell.name == 'Pflug' then
equip(sets.Enmity)
end
if spell.name == 'Warcry'
or spell.name == 'Swordplay' or spell.name == 'Rayke' or spell.name == 'Meditate' or spell.name == 'Provoke' then
equip(sets.Enmity)
end
--prevents casting Utsusemi if you already have 3 or more shadows
if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) then
cancel_spell()
end
if buffactive['terror'] or buffactive['petrification'] or buffactive['stun'] or buffactive['sleep'] then
if TP_ind == 4 then
equip(sets.defense.MDT) else
equip(sets.defense.PDT)
end
end
if spell.name == 'Convert' then
equip(sets.Convert)
end
if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
cancel_spell()
send_command('input /item "Echo Drops" <me>')
end
end
-- Run after the default midcast() is done.
-- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.skill == 'Enfeebling Magic' and state.Buff.Saboteur then
equip(sets.buff.Saboteur)
elseif spell.skill == 'Enhancing Magic' and not spell.english == 'Stoneskin' then
equip(sets.midcast.EnhancingDuration)
if buffactive.composure and spell.target.type == 'PLAYER' then
equip(sets.buff.ComposureOther)
end
elseif spellMap == 'Cure' then
if spell.target.type == 'SELF' then
equip(sets.midcast.CureSelf)
end
if state.CureHate.value then
equip(sets.cure_hate)
end
if world.weather_element == 'Light' then
equip(sets.midcast.CureWeather)
end
elseif spell.skill == 'Elemental Magic' then
if state.MagicBurst.value then
equip(sets.magic_burst)
end
if spell.element == world.day_element or spell.element == world.weather_element then
equip({waist="Hachirin-no-Obi"})
end
elseif spell.skill == "Ninjutsu" then
equip(sets.midcast.Recast)
if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' then
if buffactive['Copy Image'] then
windower.ffxi.cancel_buff(66)
elseif buffactive['Copy Image (2)'] then
windower.ffxi.cancel_buff(444)
elseif buffactive['Copy Image (3)'] then
windower.ffxi.cancel_buff(445)
elseif buffactive['Copy Image (4+)'] then
windower.ffxi.cancel_buff(446)
end
elseif spell.name == 'Monomi: Ichi' and buffactive.Sneak and spell.target.type == 'SELF' then
windower.ffxi.cancel_buff(71)
end
end
if spell.name == 'Foil' or spell.name == 'Flash' or spell.name == 'Blank Gaze'
or spell.name == 'Geist Wall' or spell.name == 'Poison Breath' or spell.name == 'Jettatura'
or spell.name == 'Cocoon' or spell.name == 'Soporific' or spell.name == 'Sheep Song'
or spell.name == 'Refueling' then
equip(sets.Enmity)
end
end
function job_get_spell_map(spell, default_spell_map)
if spell.action_type == 'Magic' then
if spell.skill == 'Enhancing Magic' then
if spell.english:startswith('En') then
return 'EnSpells'
elseif spell.english:startswith('Gain') then
return 'GainSpells'
elseif spell.english:startswith('Phalanx') then
return 'Phalanx'
elseif spell.english:startswith('Bar') then
return 'Bar'
elseif spell.english:startswith('Temper') then
return 'Temper'
elseif spell.english:startswith('Haste') then
if spell.target.type == 'SELF' then
return 'HasteSelf'
end
elseif spell.english:startswith('Refresh') then
if spell.target.type == 'SELF' then
return 'RefreshSelf'
end
end
elseif default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
if player.status == 'Engaged' then
return "CureMelee"
end
end
if spell.action_type == 'Magic' then
if spell.skill == 'Enfeebling Magic' then
if spell.type == 'WhiteMagic' then
return 'MndEnfeebles'
else
return 'IntEnfeebles'
end
elseif spell.skill == 'Elemental Magic' then
if LowNukes:contains(spell.name) then
return 'Low'
else
return
end
end
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
if stateField == 'Offense Mode' then
if newValue == 'None' then
enable('main','sub','range')
else
disable('main','sub','range')
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- General hooks for change 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 we gain or lose any haste buffs, adjust which gear set we target.
if S{'haste','march', 'madrigal','embrava','haste samba'}:contains(buff:lower()) then
determine_haste_group()
handle_equipping_gear(player.status)
end
if state.Buff[buff] ~= nil then
state.Buff[buff] = gain
if not midaction() then
handle_equipping_gear(player.status)
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- 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 customize_melee_set(meleeSet)
if player.sub_job == 'DNC' or player.sub_job == 'NIN' then
meleeSet = set_combine(meleeSet, sets.engaged.DW)
end
return meleeSet
end
-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
display_current_caster_state()
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function determine_haste_group()
classes.CustomMeleeGroups:clear()
-- assuming +4 for marches (ghorn has +5)
-- Haste (white magic) 15%
-- Haste Samba (Sub) 5%
-- Haste (Merited DNC) 10% (never account for this)
-- Victory March +0/+3/+4/+5 9.4/14%/15.6%/17.1% +0
-- Advancing March +0/+3/+4/+5 6.3/10.9%/12.5%/14% +0
-- Embrava 30% with 500 enhancing skill
-- Mighty Guard - 15%
-- buffactive[580] = geo haste
-- buffactive[33] = regular haste
-- buffactive[604] = mighty guard
-- state.HasteMode = toggle for when you know Haste II is being cast on you
-- Hi = Haste II is being cast. This is clunky to use when both haste II and haste I are being cast
if ( ( (buffactive[33] or buffactive[580] or buffactive.embrava) and (buffactive.march or buffactive[604]) ) or
( buffactive[33] and (buffactive[580] or buffactive.embrava) ) or
( buffactive.march == 2 and buffactive[604] ) ) then
add_to_chat(8, '-------------Haste 43%-------------')
classes.CustomMeleeGroups:append('Haste_43')
elseif buffactive.embrava and buffactive.haste then
add_to_chat(8, '-------------Haste 40%-------------')
classes.CustomMeleeGroups:append('Haste_40')
elseif ( (buffactive[33] or buffactive.march == 2 or buffactive[580]) and buffactive['haste samba'] ) then
add_to_chat(8, '-------------Haste 35%-------------')
classes.CustomMeleeGroups:append('Haste_35')
elseif ( ( buffactive[580] or buffactive[33] or buffactive.march == 2 ) or
( buffactive.march == 1 and buffactive[604] ) ) then
add_to_chat(8, '-------------Haste 30%-------------')
classes.CustomMeleeGroups:append('Haste_30')
elseif ( buffactive.march == 1 or buffactive[604] ) then
add_to_chat(8, '-------------Haste 15%-------------')
classes.CustomMeleeGroups:append('Haste_15')
elseif ( buffactive[580] and ( buffactive.march or buffactive[33] or buffactive.embrava or buffactive[604]) ) or -- geo haste + anything
( buffactive.embrava and (buffactive.march or buffactive[33] or buffactive[604]) ) or -- embrava + anything
( buffactive.march == 2 and (buffactive[33] or buffactive[604]) ) or -- two marches + anything
( buffactive[33] and buffactive[604] and buffactive.march ) then -- haste + mighty guard + any marches
add_to_chat(8, '-------------Max Haste Mode Enabled--------------')
classes.CustomMeleeGroups:append('Haste_43')
elseif ( (buffactive[604] or buffactive[33]) and buffactive['haste samba'] and buffactive.march == 1) or -- MG or haste + samba with 1 march
( buffactive.march == 2 and buffactive['haste samba'] ) or
( buffactive[580] and buffactive['haste samba'] ) then
add_to_chat(8, '-------------Haste 35%-------------')
classes.CustomMeleeGroups:append('Haste_35')
elseif ( buffactive.march == 2 ) or -- two marches from ghorn
( (buffactive[33] or buffactive[604]) and buffactive.march == 1 ) or -- MG or haste + 1 march
( buffactive[580] ) or -- geo haste
( buffactive[33] and buffactive[604] ) then -- haste with MG
add_to_chat(8, '-------------Haste 30%-------------')
classes.CustomMeleeGroups:append('Haste_30')
elseif buffactive[33] or buffactive[604] or buffactive.march == 1 then
add_to_chat(8, '-------------Haste 15%-------------')
classes.CustomMeleeGroups:append('Haste_15')
end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
-- Default macro set/book
if player.sub_job == 'DNC' then
set_macro_page(2, 4)
elseif player.sub_job == 'WHM' then
set_macro_page(3, 4)
elseif player.sub_job == 'NIN' then
set_macro_page(10, 4)
elseif player.sub_job == 'THF' then
set_macro_page(4, 4)
elseif player.sub_job == 'BLM' then
set_macro_page(5, 4)
else
set_macro_page(1, 4)
end
end 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()
determine_haste_group()
state.Buff.Saboteur = buffactive.saboteur or false
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', 'Mid', 'Acc')
state.HybridMode:options('Normal', 'PDT', 'Evasion')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'PDT', 'MDT')
select_default_macro_book()
gear.CureStaff = {name=""}
gear.CureFeet = {name=""}
state.MagicBurst = M(false, 'Magic Burst')
state.CureHate = M(false, 'Cure Hate')
Shields = S{'Genmei Shield','Culminus'}
LowNukes = S{'Stone' , 'Aero' , 'Blizzard' , 'Fire' , 'Water' , 'Thunder' ,
'Stone II' , 'Aero II' , 'Blizzard II' , 'Fire II' , 'Water II' , 'Thunder II',
'Stonega' , 'Aeroga' , 'Blizzaga' , 'Firaga' , 'Waterga' , 'Thundaga',
'Stonega II' , 'Aeroga II' , 'Blizzaga II' , 'Firaga II' , 'Waterga II' , 'Thundaga II'}
MndEnfeebles = S{'Slow' , 'Silence' , 'Paralyze' , 'Addle' , 'Slow II' , 'Paralyze II' , 'Addle II'}
IntEnfeebles = S{'Bind' , 'Break' , 'Gravity' , 'Poison' , 'Sleep' , 'Gravity II' , 'Poison II' , 'Sleep II'}
send_command('bind !` gs c toggle MagicBurst')
send_command('bind ^` gs c toggle CureHate')
update_combat_form()
determine_haste_group()
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['Chainspell'] = {body="Vitivation Tabard +1"}
-- Waltz set (chr and vit)
sets.precast.Waltz = {}
-- Don't need any special gear for Healing Waltz.
sets.precast.Waltz['Healing Waltz'] = {}
-- Fast cast sets for spells
-- 80% Fast Cast (including trait) for all spells, plus 5% quick cast
-- No other FC sets necessary.
sets.precast.FC = {}
sets.precast.FC.Impact = set_combine(sets.precast.FC, {head=empty,body="Twilight Cloak"})
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {}
sets.precast.WS['Circle Blade'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Sanguine Blade'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Requiescat'] = {}
sets.precast.WS['Aeolian Edge'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Savage Blade'] = {}
sets.precast.WS['Chant du Cygne'] = {}
sets.precast.WS['True Strike'] = {}
sets.precast.WS['Exenterator'] = {}
sets.precast.WS['Evisceration'] = {}
sets.precast.WS['Death Blossom'] = {}
-- Midcast Sets
sets.midcast.Cure = {}
sets.midcast.Curaga = sets.midcast.Cure
sets.midcast.CureWeather = {}
sets.midcast.CureSelf = {}
sets.midcast.CureMelee = {}
sets.midcast['Enhancing Magic'] = {}
sets.midcast['Enhancing Magic'].Temper = {}
sets.midcast['Enhancing Magic'].RegenSelf = {}
sets.midcast['Enhancing Magic'].RefreshSelf = {}
sets.midcast['Enhancing Magic'].HasteSelf = {}
sets.midcast['Enhancing Magic'].EnSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.midcast['Enhancing Magic'].GainSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.midcast['Enhancing Magic'].BarSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.buff.ComposureOther = {head="Lethargy Chappel +1",body="Lethargy Sayon +1",
legs="Lethargy Fuseau +1",feet="Lethargy Houseaux +1"}
sets.midcast.Protect = {}
sets.midcast.Shell = sets.midcast.Protect
sets.midcast['Enhancing Magic'].Phalanx = {}
sets.midcast.Cursna = {}
sets.midcast.Stoneskin = {}
sets.midcast['Enfeebling Magic'] = {}
sets.midcast.MndEnfeebles = {}
sets.midcast.IntEnfeebles = {}
sets.midcast.Blind = {}
sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
sets.midcast.Distract = {}
sets.midcast.Frazzle = {}
sets.midcast['Distract II'] = sets.midcast.Distract
sets.midcast['Distract III'] = sets.midcast.Distract
sets.midcast['Frazzle II'] = {}
sets.midcast['Frazzle III'] = sets.midcast.Frazzle
sets.midcast['Dia III'] = set_combine(sets.midcast['Enfeebling Magic'], {head="Vitivation Chapeau +1"})
sets.midcast['Slow II'] = set_combine(sets.midcast['Enfeebling Magic'], {head="Vitivation Chapeau +1"})
sets.Lunge = {}
sets.Convert = {main="Murgleis"}
sets.midcast['Elemental Magic'] ={}
sets.midcast['Elemental Magic']['Low'] = {}
sets.midcast.Impact = set_combine(sets.midcast['Elemental Magic'], {head=empty,body="Twilight Cloak"})
sets.midcast['Stun'] = {}
sets.midcast.Drain = {}
sets.midcast.Aspir = sets.midcast.Drain
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {}
-- Idle sets
sets.idle = {}
sets.idle.Town = {}
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.Mid = {}
sets.engaged.Acc = {}
sets.engaged.Evasion = sets.engaged
sets.engaged.Mid.Evasion = sets.engaged.Mid
sets.engaged.Acc.Evasion = sets.engaged.Acc
sets.engaged.PDT = sets.defense.PDT
sets.engaged.Mid.PDT = sets.defense.MDT
sets.engaged.Acc.PDT = sets.defense.PDT
-- Haste 43%
sets.engaged.Haste_43 = set_combine(sets.engaged, {})
sets.engaged.Mid.Haste_43 = sets.engaged.Mid
sets.engaged.Acc.Haste_43 = sets.engaged.Acc
sets.engaged.Evasion.Haste_43 = sets.engaged.Haste_43
sets.engaged.PDT.Haste_43 = sets.defense.PDT
-- 40
sets.engaged.Haste_40 = set_combine(sets.engaged.Haste_43, {})
sets.engaged.Mid.Haste_40 = sets.engaged.Mid
sets.engaged.Acc.Haste_40 = sets.engaged.Acc
sets.engaged.Evasion.Haste_40 = sets.engaged.Haste_40
sets.engaged.PDT.Haste_40 = sets.defense.PDT
-- 30
sets.engaged.Haste_30 = sets.engaged
sets.engaged.Mid.Haste_30 = sets.engaged.Mid
sets.engaged.Acc.Haste_30 = sets.engaged.Acc
sets.engaged.Evasion.Haste_30 = sets.engaged
sets.engaged.PDT.Haste_30 = sets.defense.PDT
-- 25
sets.engaged.Haste_25 = set_combine(sets.engaged.Haste_30, {})
sets.engaged.Acc.Haste_25 = sets.engaged.Acc
sets.engaged.Mid.Haste_25 = sets.engaged.Mid
sets.engaged.Evasion.Haste_25 = sets.engaged
sets.engaged.PDT.Haste_25 = sets.defense.PDT
-- DW nin sub melee group
sets.engaged.DW_nin = {}
sets.engaged.DW_nin.Mid = {}
sets.engaged.DW_nin.Acc = {}
sets.engaged.DW_nin.Evasion = sets.engaged.DW_nin
sets.engaged.DW_nin.Mid.Evasion = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Acc.Evasion = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.PDT = sets.defense.PDT
sets.engaged.DW_nin.Mid.PDT = sets.defense.MDT
sets.engaged.DW_nin.Acc.PDT = sets.defense.PDT
-- Haste 43%
sets.engaged.DW_nin.Haste_43 = set_combine(sets.engaged.DW_nin, {})
sets.engaged.DW_nin.Mid.Haste_43 = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Acc.Haste_43 = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.Evasion.Haste_43 = sets.engaged.DW_nin.Haste_43
sets.engaged.DW_nin.PDT.Haste_43 = sets.defense.PDT
-- 40
sets.engaged.DW_nin.Haste_40 = set_combine(sets.engaged.DW_nin.Haste_43, {})
sets.engaged.DW_nin.Mid.Haste_40 = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Acc.Haste_40 = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.Evasion.Haste_40 = sets.engaged.DW_nin.Haste_40
sets.engaged.DW_nin.PDT.Haste_40 = sets.defense.PDT
-- 30
sets.engaged.DW_nin.Haste_30 = sets.engaged.DW_nin
sets.engaged.DW_nin.Mid.Haste_30 = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Acc.Haste_30 = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.Evasion.Haste_30 = sets.engaged.DW_nin
sets.engaged.DW_nin.PDT.Haste_30 = sets.defense.PDT
-- 25
sets.engaged.DW_nin.Haste_25 = set_combine(sets.engaged.DW_nin.Haste_30, {})
sets.engaged.DW_nin.Acc.Haste_25 = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.Mid.Haste_25 = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Evasion.Haste_25 = sets.engaged.DW_nin
sets.engaged.DW_nin.PDT.Haste_25 = sets.defense.PDT
-- DW dnc sub melee group
sets.engaged.DW_dnc = {}
sets.engaged.DW_dnc.Mid = {}
sets.engaged.DW_dnc.Acc = {}
sets.engaged.DW_dnc.Evasion = sets.engaged.DW_dnc
sets.engaged.DW_dnc.Mid.Evasion = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Acc.Evasion = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.PDT = sets.defense.PDT
sets.engaged.DW_dnc.Mid.PDT = sets.defense.MDT
sets.engaged.DW_dnc.Acc.PDT = sets.defense.PDT
-- Haste 43%
sets.engaged.DW_dnc.Haste_43 = set_combine(sets.engaged.DW_dnc, {})
sets.engaged.DW_dnc.Mid.Haste_43 = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Acc.Haste_43 = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.Evasion.Haste_43 = sets.engaged.DW_dnc.Haste_43
sets.engaged.DW_dnc.PDT.Haste_43 = sets.defense.PDT
-- 40
sets.engaged.DW_dnc.Haste_40 = set_combine(sets.engaged.DW_dnc.Haste_43, {})
sets.engaged.DW_dnc.Mid.Haste_40 = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Acc.Haste_40 = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.Evasion.Haste_40 = sets.engaged.DW_dnc.Haste_40
sets.engaged.DW_dnc.PDT.Haste_40 = sets.defense.PDT
-- 30
sets.engaged.DW_dnc.Haste_30 = sets.engaged.DW_dnc
sets.engaged.DW_dnc.Mid.Haste_30 = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Acc.Haste_30 = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.Evasion.Haste_30 = sets.engaged.DW_dnc
sets.engaged.DW_dnc.PDT.Haste_30 = sets.defense.PDT
-- 25
sets.engaged.DW_dnc.Haste_25 = set_combine(sets.engaged.DW_dnc.Haste_30, {})
sets.engaged.DW_dnc.Acc.Haste_25 = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.Mid.Haste_25 = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Evasion.Haste_25 = sets.engaged.DW_dnc
sets.engaged.DW_dnc.PDT.Haste_25 = sets.defense.PDT
sets.magic_burst = {}
sets.cure_hate = {}
sets.Enmity = {}
-- Sets for special buff conditions on spells.
sets.buff.Saboteur = {hands="Lethargy Gantherots +1"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
function job_precast(spell, action, spellMap, eventArgs)
if spell.skill == 'Healing Magic' and spellMap ~= 'StatusRemoval' then
gear.CureFeet.name = "Vanya Clogs"
if player.status == 'Engaged' then
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
if spell.target.type == 'SELF' then
gear.CureFeet.name = "Medium's Sabots"
else
gear.CureFeet.name = "Vanya Clogs"
end
else
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
end
if spell.target.type == 'SELF' then
gear.default.obi_waist = "Chuq'aba Belt"
else
gear.default.obi_waist = "Salire belt"
end
if world.weather_element == 'Light' then
gear.CureStaff.name = "Chatoyant Staff"
else
gear.CureStaff.name = "Serenity"
end
else
gear.default.obi_waist = "Salire belt"
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
end
if spell.name == 'Lunge' or spell.name == 'Swipe' then
equip(sets.Lunge)
end
if spell.name == 'Vallation' then
equip(sets.Enmity)
end
if spell.name == 'Pflug' then
equip(sets.Enmity)
end
if spell.name == 'Warcry'
or spell.name == 'Swordplay' or spell.name == 'Rayke' or spell.name == 'Meditate' or spell.name == 'Provoke' then
equip(sets.Enmity)
end
--prevents casting Utsusemi if you already have 3 or more shadows
if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) then
cancel_spell()
end
if buffactive['terror'] or buffactive['petrification'] or buffactive['stun'] or buffactive['sleep'] then
if TP_ind == 4 then
equip(sets.defense.MDT) else
equip(sets.defense.PDT)
end
end
if spell.name == 'Convert' then
equip(sets.Convert)
end
if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
cancel_spell()
send_command('input /item "Echo Drops" <me>')
end
end
-- Run after the default midcast() is done.
-- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.skill == 'Enfeebling Magic' and state.Buff.Saboteur then
equip(sets.buff.Saboteur)
elseif spell.skill == 'Enhancing Magic' and not spell.english == 'Stoneskin' then
equip(sets.midcast.EnhancingDuration)
if buffactive.composure and spell.target.type == 'PLAYER' then
equip(sets.buff.ComposureOther)
end
elseif spellMap == 'Cure' then
if spell.target.type == 'SELF' then
equip(sets.midcast.CureSelf)
end
if state.CureHate.value then
equip(sets.cure_hate)
end
if world.weather_element == 'Light' then
equip(sets.midcast.CureWeather)
end
elseif spell.skill == 'Elemental Magic' then
if state.MagicBurst.value then
equip(sets.magic_burst)
end
if spell.element == world.day_element or spell.element == world.weather_element then
equip({waist="Hachirin-no-Obi"})
end
elseif spell.skill == "Ninjutsu" then
equip(sets.midcast.Recast)
if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' then
if buffactive['Copy Image'] then
windower.ffxi.cancel_buff(66)
elseif buffactive['Copy Image (2)'] then
windower.ffxi.cancel_buff(444)
elseif buffactive['Copy Image (3)'] then
windower.ffxi.cancel_buff(445)
elseif buffactive['Copy Image (4+)'] then
windower.ffxi.cancel_buff(446)
end
elseif spell.name == 'Monomi: Ichi' and buffactive.Sneak and spell.target.type == 'SELF' then
windower.ffxi.cancel_buff(71)
end
end
if spell.name == 'Foil' or spell.name == 'Flash' or spell.name == 'Blank Gaze'
or spell.name == 'Geist Wall' or spell.name == 'Poison Breath' or spell.name == 'Jettatura'
or spell.name == 'Cocoon' or spell.name == 'Soporific' or spell.name == 'Sheep Song'
or spell.name == 'Refueling' then
equip(sets.Enmity)
end
end
function job_get_spell_map(spell, default_spell_map)
if spell.action_type == 'Magic' then
if spell.skill == 'Enhancing Magic' then
if spell.english:startswith('En') then
return 'EnSpells'
elseif spell.english:startswith('Gain') then
return 'GainSpells'
elseif spell.english:startswith('Phalanx') then
return 'Phalanx'
elseif spell.english:startswith('Bar') then
return 'Bar'
elseif spell.english:startswith('Temper') then
return 'Temper'
elseif spell.english:startswith('Haste') then
if spell.target.type == 'SELF' then
return 'HasteSelf'
end
elseif spell.english:startswith('Refresh') then
if spell.target.type == 'SELF' then
return 'RefreshSelf'
end
end
elseif default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
if player.status == 'Engaged' then
return "CureMelee"
end
end
if spell.action_type == 'Magic' then
if spell.skill == 'Enfeebling Magic' then
if spell.type == 'WhiteMagic' then
return 'MndEnfeebles'
else
return 'IntEnfeebles'
end
elseif spell.skill == 'Elemental Magic' then
if LowNukes:contains(spell.name) then
return 'Low'
else
return
end
end
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
if stateField == 'Offense Mode' then
if newValue == 'None' then
enable('main','sub','range')
else
disable('main','sub','range')
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- General hooks for change 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 we gain or lose any haste buffs, adjust which gear set we target.
if S{'haste','march', 'madrigal','embrava','haste samba'}:contains(buff:lower()) then
determine_haste_group()
handle_equipping_gear(player.status)
end
if state.Buff[buff] ~= nil then
state.Buff[buff] = gain
if not midaction() then
handle_equipping_gear(player.status)
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- 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 customize_melee_set(meleeSet)
-- if player.sub_job == 'DNC' or player.sub_job == 'NIN' then
-- meleeSet = set_combine(meleeSet, sets.engaged.DW)
-- end
-- return meleeSet
-- end
function update_combat_form()
-- Check for H2H or single-wielding
if player.equipment.sub == 'empty' then
state.CombatForm:reset()
elseif Shields:contains(player.equipment.sub) then
state.CombatForm:reset()
else
if player.sub_job == 'NIN' then
state.CombatForm:set('DW_nin')
elseif player.sub_job == 'DNC' then
state.CombatForm:set('DW_dnc')
end
end
end
function job_update(cmdParams, eventArgs)
update_combat_form()
determine_haste_group()
end
-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
display_current_caster_state()
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function determine_haste_group()
classes.CustomMeleeGroups:clear()
-- assuming +4 for marches (ghorn has +5)
-- Haste (white magic) 15%
-- Haste Samba (Sub) 5%
-- Haste (Merited DNC) 10% (never account for this)
-- Victory March +0/+3/+4/+5 9.4/14%/15.6%/17.1% +0
-- Advancing March +0/+3/+4/+5 6.3/10.9%/12.5%/14% +0
-- Embrava 30% with 500 enhancing skill
-- Mighty Guard - 15%
-- buffactive[580] = geo haste
-- buffactive[33] = regular haste
-- buffactive[604] = mighty guard
-- state.HasteMode = toggle for when you know Haste II is being cast on you
-- Hi = Haste II is being cast. This is clunky to use when both haste II and haste I are being cast
if ( ( (buffactive[33] or buffactive[580] or buffactive.embrava) and (buffactive.march or buffactive[604]) ) or
( buffactive[33] and (buffactive[580] or buffactive.embrava) ) or
( buffactive.march == 2 and buffactive[604] ) ) then
add_to_chat(8, '-------------Haste 43%-------------')
classes.CustomMeleeGroups:append('Haste_43')
elseif buffactive.embrava and buffactive.haste then
add_to_chat(8, '-------------Haste 40%-------------')
classes.CustomMeleeGroups:append('Haste_40')
elseif ( (buffactive[33] or buffactive.march == 2 or buffactive[580]) and buffactive['haste samba'] ) then
add_to_chat(8, '-------------Haste 35%-------------')
classes.CustomMeleeGroups:append('Haste_35')
elseif ( ( buffactive[580] or buffactive[33] or buffactive.march == 2 ) or
( buffactive.march == 1 and buffactive[604] ) ) then
add_to_chat(8, '-------------Haste 30%-------------')
classes.CustomMeleeGroups:append('Haste_30')
elseif ( buffactive.march == 1 or buffactive[604] ) then
add_to_chat(8, '-------------Haste 15%-------------')
classes.CustomMeleeGroups:append('Haste_15')
elseif ( buffactive[580] and ( buffactive.march or buffactive[33] or buffactive.embrava or buffactive[604]) ) or -- geo haste + anything
( buffactive.embrava and (buffactive.march or buffactive[33] or buffactive[604]) ) or -- embrava + anything
( buffactive.march == 2 and (buffactive[33] or buffactive[604]) ) or -- two marches + anything
( buffactive[33] and buffactive[604] and buffactive.march ) then -- haste + mighty guard + any marches
add_to_chat(8, '-------------Max Haste Mode Enabled--------------')
classes.CustomMeleeGroups:append('Haste_43')
elseif ( (buffactive[604] or buffactive[33]) and buffactive['haste samba'] and buffactive.march == 1) or -- MG or haste + samba with 1 march
( buffactive.march == 2 and buffactive['haste samba'] ) or
( buffactive[580] and buffactive['haste samba'] ) then
add_to_chat(8, '-------------Haste 35%-------------')
classes.CustomMeleeGroups:append('Haste_35')
elseif ( buffactive.march == 2 ) or -- two marches from ghorn
( (buffactive[33] or buffactive[604]) and buffactive.march == 1 ) or -- MG or haste + 1 march
( buffactive[580] ) or -- geo haste
( buffactive[33] and buffactive[604] ) then -- haste with MG
add_to_chat(8, '-------------Haste 30%-------------')
classes.CustomMeleeGroups:append('Haste_30')
elseif buffactive[33] or buffactive[604] or buffactive.march == 1 then
add_to_chat(8, '-------------Haste 15%-------------')
classes.CustomMeleeGroups:append('Haste_15')
end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
-- Default macro set/book
if player.sub_job == 'DNC' then
set_macro_page(2, 4)
elseif player.sub_job == 'WHM' then
set_macro_page(3, 4)
elseif player.sub_job == 'NIN' then
set_macro_page(10, 4)
elseif player.sub_job == 'THF' then
set_macro_page(4, 4)
elseif player.sub_job == 'BLM' then
set_macro_page(5, 4)
else
set_macro_page(1, 4)
end
end
I added a list called 'Shields' under user_seup that you'll need to update with any shields you want gearswap to look for to automatically identify single-wielding. It will also identify single-wielding if your sub slot is empty.
You'll also need to continue/finish iterating hybrid sets over the different combat forms (DW_nin and DW_dnc, e.g. sets.engaged.DW_nin.Acc.PDT.Haste_43), I just didn't feel like doing it all.
Holy crap thank you, hopefully one day I will have everything I want in this lua and not bother you with it anymore.
edit: Just tried and it wouldn't swap the sets based on haste, I know I need to adjust this code here for that, but when I thought about it I realized I would need a subjob variable in there as well otherwise I would just cycle one of the sets. Thank you for any help in advace.
Also I realized it doesn't recognize the difference in haste 1 vs haste 2
Code -------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function determine_haste_group()
classes.CustomMeleeGroups:clear()
-- assuming +4 for marches (ghorn has +5)
-- Haste (white magic) 15%
-- Haste Samba (Sub) 5%
-- Haste (Merited DNC) 10% (never account for this)
-- Victory March +0/+3/+4/+5 9.4/14%/15.6%/17.1% +0
-- Advancing March +0/+3/+4/+5 6.3/10.9%/12.5%/14% +0
-- Embrava 30% with 500 enhancing skill
-- Mighty Guard - 15%
-- buffactive[580] = geo haste
-- buffactive[33] = regular haste
-- buffactive[604] = mighty guard
-- state.HasteMode = toggle for when you know Haste II is being cast on you
-- Hi = Haste II is being cast. This is clunky to use when both haste II and haste I are being cast
if ( ( (buffactive[33] or buffactive[580] or buffactive.embrava) and (buffactive.march or buffactive[604]) ) or
( buffactive[33] and (buffactive[580] or buffactive.embrava) ) or
( buffactive.march == 2 and buffactive[604] ) ) then
add_to_chat(8, '-------------Haste 43%-------------')
classes.CustomMeleeGroups:append('Haste_43')
elseif buffactive.embrava and buffactive.haste then
add_to_chat(8, '-------------Haste 40%-------------')
classes.CustomMeleeGroups:append('Haste_40')
elseif ( (buffactive[33] or buffactive.march == 2 or buffactive[580]) and buffactive['haste samba'] ) then
add_to_chat(8, '-------------Haste 35%-------------')
classes.CustomMeleeGroups:append('Haste_35')
elseif ( ( buffactive[580] or buffactive[33] or buffactive.march == 2 ) or
( buffactive.march == 1 and buffactive[604] ) ) then
add_to_chat(8, '-------------Haste 30%-------------')
classes.CustomMeleeGroups:append('Haste_30')
elseif ( buffactive.march == 1 or buffactive[604] ) then
add_to_chat(8, '-------------Haste 15%-------------')
classes.CustomMeleeGroups:append('Haste_15')
elseif ( buffactive[580] and ( buffactive.march or buffactive[33] or buffactive.embrava or buffactive[604]) ) or -- geo haste + anything
( buffactive.embrava and (buffactive.march or buffactive[33] or buffactive[604]) ) or -- embrava + anything
( buffactive.march == 2 and (buffactive[33] or buffactive[604]) ) or -- two marches + anything
( buffactive[33] and buffactive[604] and buffactive.march ) then -- haste + mighty guard + any marches
add_to_chat(8, '-------------Max Haste Mode Enabled--------------')
classes.CustomMeleeGroups:append('Haste_43')
elseif ( (buffactive[604] or buffactive[33]) and buffactive['haste samba'] and buffactive.march == 1) or -- MG or haste + samba with 1 march
( buffactive.march == 2 and buffactive['haste samba'] ) or
( buffactive[580] and buffactive['haste samba'] ) then
add_to_chat(8, '-------------Haste 35%-------------')
classes.CustomMeleeGroups:append('Haste_35')
elseif ( buffactive.march == 2 ) or -- two marches from ghorn
( (buffactive[33] or buffactive[604]) and buffactive.march == 1 ) or -- MG or haste + 1 march
( buffactive[580] ) or -- geo haste
( buffactive[33] and buffactive[604] ) then -- haste with MG
add_to_chat(8, '-------------Haste 30%-------------')
classes.CustomMeleeGroups:append('Haste_30')
elseif buffactive[33] or buffactive[604] or buffactive.march == 1 then
add_to_chat(8, '-------------Haste 15%-------------')
classes.CustomMeleeGroups:append('Haste_15')
end
end
サーバ: Shiva
Game: FFXI
Posts: 357
By Shiva.Berzerk 2016-10-27 04:35:18
Currently have a BLU gs that doesn't auto-switch macro books/pages, so was going to try the kinematics lua since it already has it built in, but it's not switching to engaged set when i go to attack something. Have tried looking at other luas to add macro functionality to the other GS or to add an auto-equip engaged to the kinematics one but no luck. 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()
state.Buff['Burst Affinity'] = buffactive['Burst Affinity'] or false
state.Buff['Chain Affinity'] = buffactive['Chain Affinity'] or false
state.Buff.Convergence = buffactive.Convergence or false
state.Buff.Diffusion = buffactive.Diffusion or false
state.Buff.Efflux = buffactive.Efflux or false
state.Buff['Unbridled Learning'] = buffactive['Unbridled Learning'] or false
blue_magic_maps = {}
-- Mappings for gear sets to use for various blue magic spells.
-- While Str isn't listed for each, it's generally assumed as being at least
-- moderately signficant, even for spells with other mods.
-- Physical Spells --
-- Physical spells with no particular (or known) stat mods
blue_magic_maps.Physical = S{
'Bilgestorm'
}
-- Spells with heavy accuracy penalties, that need to prioritize accuracy first.
blue_magic_maps.PhysicalAcc = S{
'Heavy Strike',
}
-- Physical spells with Str stat mod
blue_magic_maps.PhysicalStr = S{
'Battle Dance','Bloodrake','Death Scissors','Dimensional Death',
'Empty Thrash','Quadrastrike','Sinker Drill','Spinal Cleave',
'Uppercut','Vertical Cleave'
}
-- Physical spells with Dex stat mod
blue_magic_maps.PhysicalDex = S{
'Amorphic Spikes','Asuran Claws','Barbed Crescent','Claw Cyclone','Disseverment',
'Foot Kick','Frenetic Rip','Goblin Rush','Hysteric Barrage','Paralyzing Triad',
'Seedspray','Sickle Slash','Smite of Rage','Terror Touch','Thrashing Assault',
'Vanity Dive'
}
-- Physical spells with Vit stat mod
blue_magic_maps.PhysicalVit = S{
'Body Slam','Cannonball','Delta Thrust','Glutinous Dart','Grand Slam',
'Power Attack','Quad. Continuum','Sprout Smack','Sub-zero Smash'
}
-- Physical spells with Agi stat mod
blue_magic_maps.PhysicalAgi = S{
'Benthic Typhoon','Feather Storm','Helldive','Hydro Shot','Jet Stream',
'Pinecone Bomb','Spiral Spin','Wild Oats'
}
-- Physical spells with Int stat mod
blue_magic_maps.PhysicalInt = S{
'Mandibular Bite','Queasyshroom'
}
-- Physical spells with Mnd stat mod
blue_magic_maps.PhysicalMnd = S{
'Ram Charge','Screwdriver','Tourbillion'
}
-- Physical spells with Chr stat mod
blue_magic_maps.PhysicalChr = S{
'Bludgeon'
}
-- Physical spells with HP stat mod
blue_magic_maps.PhysicalHP = S{
'Final Sting'
}
-- Magical Spells --
-- Magical spells with the typical Int mod
blue_magic_maps.Magical = S{
'Blastbomb','Blazing Bound','Bomb Toss','Cursed Sphere','Dark Orb','Death Ray',
'Diffusion Ray','Droning Whirlwind','Embalming Earth','Firespit','Foul Waters',
'Ice Break','Leafstorm','Maelstrom','Rail Cannon','Regurgitation','Rending Deluge',
'Retinal Glare','Subduction','Tem. Upheaval','Water Bomb'
}
-- Magical spells with a primary Mnd mod
blue_magic_maps.MagicalMnd = S{
'Acrid Stream','Evryone. Grudge','Magic Hammer','Mind Blast'
}
-- Magical spells with a primary Chr mod
blue_magic_maps.MagicalChr = S{
'Eyes On Me','Mysterious Light'
}
-- Magical spells with a Vit stat mod (on top of Int)
blue_magic_maps.MagicalVit = S{
'Thermal Pulse'
}
-- Magical spells with a Dex stat mod (on top of Int)
blue_magic_maps.MagicalDex = S{
'Charged Whisker','Gates of Hades'
}
-- Magical spells (generally debuffs) that we want to focus on magic accuracy over damage.
-- Add Int for damage where available, though.
blue_magic_maps.MagicAccuracy = S{
'1000 Needles','Absolute Terror','Actinic Burst','Auroral Drape','Awful Eye',
'Blank Gaze','Blistering Roar','Blood Drain','Blood Saber','Chaotic Eye',
'Cimicine Discharge','Cold Wave','Corrosive Ooze','Demoralizing Roar','Digest',
'Dream Flower','Enervation','Feather Tickle','Filamented Hold','Frightful Roar',
'Geist Wall','Hecatomb Wave','Infrasonics','Jettatura','Light of Penance',
'Lowing','Mind Blast','Mortal Ray','MP Drainkiss','Osmosis','Reaving Wind',
'Sandspin','Sandspray','Sheep Song','Soporific','Sound Blast','Stinking Gas',
'Sub-zero Smash','Venom Shell','Voracious Trunk','Yawn'
}
-- Breath-based spells
blue_magic_maps.Breath = S{
'Bad Breath','Flying Hip Press','Frost Breath','Heat Breath',
'Hecatomb Wave','Magnetite Cloud','Poison Breath','Radiant Breath','Self-Destruct',
'Thunder Breath','Vapor Spray','Wind Breath'
}
-- Stun spells
blue_magic_maps.Stun = S{
'Blitzstrahl','Frypan','Head Butt','Sudden Lunge','Tail slap','Temporal Shift',
'Thunderbolt','Whirl of Rage'
}
-- Healing spells
blue_magic_maps.Healing = S{
'Healing Breeze','Magic Fruit','Plenilune Embrace','Pollen','Restoral','White Wind',
'Wild Carrot'
}
-- Buffs that depend on blue magic skill
blue_magic_maps.SkillBasedBuff = S{
'Barrier Tusk','Diamondhide','Magic Barrier','Metallic Body','Plasma Charge',
'Pyric Bulwark','Reactor Cool',
}
-- Other general buffs
blue_magic_maps.Buff = S{
'Amplification','Animating Wail','Battery Charge','Carcharian Verve','Cocoon',
'Erratic Flutter','Exuviation','Fantod','Feather Barrier','Harden Shell',
'Memento Mori','Nat. Meditation','Occultation','Orcish Counterstance','Refueling',
'Regeneration','Saline Coat','Triumphant Roar','Warm-Up','Winds of Promyvion',
'Zephyr Mantle'
}
-- Spells that require Unbridled Learning to cast.
unbridled_spells = S{
'Absolute Terror','Bilgestorm','Blistering Roar','Bloodrake','Carcharian Verve',
'Crashing Thunder','Droning Whirlwind','Gates of Hades','Harden Shell','Polar Roar',
'Pyric Bulwark','Thunderbolt','Tourbillion','Uproot'
}
end
-------------------------------------------------------------------------------------------------------------------
-- User setup functions for this job. Recommend that these be overridden in a sidecar file.
-------------------------------------------------------------------------------------------------------------------
-- Setup vars that are user-dependent. Can override this function in a sidecar file.
function user_setup()
state.OffenseMode:options('Normal', 'Acc', 'Refresh', 'Learning')
state.WeaponskillMode:options('Normal', 'Acc')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'PDT', 'Learning')
gear.macc_hagondes = {name="Hagondes Cuffs", augments={'Phys. dmg. taken -3%','Mag. Acc.+29'}}
-- Additional local binds
send_command('bind ^` input /ja "Chain Affinity" <me>')
send_command('bind !` input /ja "Efflux" <me>')
send_command('bind @` input /ja "Burst Affinity" <me>')
update_combat_form()
select_default_macro_book()
end
-- Called when this job file is unloaded (eg: job change)
function user_unload()
send_command('unbind ^`')
send_command('unbind !`')
send_command('unbind @`')
end
-- Set up gear sets.
function init_gear_sets()
--------------------------------------
-- Start defining the sets
--------------------------------------
sets.buff['Burst Affinity'] = {feet="Mavi Basmak +2"}
sets.buff['Chain Affinity'] = {head="Mavi Kavuk +2", feet="Assimilator's Charuqs"}
sets.buff.Convergence = {head="Luhlaza Keffiyeh"}
sets.buff.Diffusion = {feet="Luhlaza Charuqs"}
sets.buff.Enchainment = {body="Luhlaza Jubbah"}
sets.buff.Efflux = {legs="Mavi Tayt +2"}
-- Precast Sets
-- Precast sets to enhance JAs
sets.precast.JA['Azure Lore'] = {hands="Mirage Bazubands +2"}
-- Waltz set (chr and vit)
sets.precast.Waltz = {ammo="Sonia's Plectrum",
head="Uk'uxkaj Cap",
body="Vanir Cotehardie",hands="Buremte Gloves",ring1="Spiral Ring",
back="Iximulew Cape",waist="Caudata Belt",legs="Hagondes Pants",feet="Iuitl Gaiters +1"}
-- Don't need any special gear for Healing Waltz.
sets.precast.Waltz['Healing Waltz'] = {}
-- Fast cast sets for spells
sets.precast.FC = {ammo="Impatiens",
head="Haruspex Hat",ear2="Loquacious Earring",
body="Luhlaza Jubbah",hands="Thaumas Gloves",ring1="Prolix Ring",
back="Swith Cape +1",waist="Witful Belt",legs="Enif Cosciales",feet="Chelona Boots +1"}
sets.precast.FC['Blue Magic'] = set_combine(sets.precast.FC, {body="Mavi Mintan +2"})
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {
head="Whirlpool Mask",neck=gear.ElementalGorget,ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Qaaxo Harness",hands="Assimilator's Bazubands +1",ring1="Rajas Ring",ring2="Epona's Ring",
back="Atheling Mantle",waist=gear.ElementalBelt,legs="Manibozho Brais",feet="Iuitl Gaiters +1"}
sets.precast.WS.acc = set_combine(sets.precast.WS, {hands="Buremte Gloves"})
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS['Requiescat'] = set_combine(sets.precast.WS, {ring1="Aquasoul Ring",feet="Luhlaza Charuqs"})
sets.precast.WS['Sanguine Blade'] = {
head="Hagondes Hat",neck="Eddy Necklace",ear1="Friomisi Earring",ear2="Hecate's Earring",
body="Hagondes Coat",hands="Mavi Bazubands +2",ring1="Acumen Ring",ring2="Strendu Ring",
back="Toro Cape",legs="Hagondes Pants",feet="Iuitl Gaiters +1"}
-- Midcast Sets
sets.midcast.FastRecast = {
head="Haruspex Hat",ear2="Loquacious Earring",
body="Luhlaza Jubbah",hands="Mavi Bazubands +2",ring1="Prolix Ring",
back="Swith Cape +1",waist="Hurch'lan Sash",legs="Enif Cosciales",feet="Iuitl Gaiters +1"}
sets.midcast['Blue Magic'] = {}
-- Physical Spells --
sets.midcast['Blue Magic'].Physical = {ammo="Mavi Tathlum",
head="Whirlpool Mask",neck="Ej Necklace",ear1="Heartseeker Earring",ear2="Steelflash Earring",
body="Vanir Cotehardie",hands="Buremte Gloves",ring1="Rajas Ring",ring2="Spiral Ring",
back="Cornflower Cape",waist="Caudata Belt",legs="Nahtirah Trousers",feet="Qaaxo Leggings"}
sets.midcast['Blue Magic'].PhysicalAcc = {ammo="Jukukik Feather",
head="Whirlpool Mask",neck="Ej Necklace",ear1="Heartseeker Earring",ear2="Steelflash Earring",
body="Luhlaza Jubbah",hands="Buremte Gloves",ring1="Rajas Ring",ring2="Patricius Ring",
back="Letalis Mantle",waist="Hurch'lan Sash",legs="Manibozho Brais",feet="Qaaxo Leggings"}
sets.midcast['Blue Magic'].PhysicalStr = set_combine(sets.midcast['Blue Magic'].Physical,
{body="Iuitl Vest",hands="Assimilator's Bazubands +1"})
sets.midcast['Blue Magic'].PhysicalDex = set_combine(sets.midcast['Blue Magic'].Physical,
{ammo="Jukukik Feather",body="Iuitl Vest",hands="Assimilator's Bazubands +1",
waist="Chaac Belt",legs="Manibozho Brais"})
sets.midcast['Blue Magic'].PhysicalVit = set_combine(sets.midcast['Blue Magic'].Physical,
{body="Vanir Cotehardie",hands="Assimilator's Bazubands +1",back="Iximulew Cape"})
sets.midcast['Blue Magic'].PhysicalAgi = set_combine(sets.midcast['Blue Magic'].Physical,
{body="Vanir Cotehardie",hands="Iuitl Wristbands",ring2="Stormsoul Ring",
waist="Chaac Belt",feet="Iuitl Gaiters +1"})
sets.midcast['Blue Magic'].PhysicalInt = set_combine(sets.midcast['Blue Magic'].Physical,
{ear1="Psystorm Earring",body="Vanir Cotehardie",hands="Assimilator's Bazubands +1",
ring2="Icesoul Ring",back="Toro Cape",feet="Hagondes Sabots"})
sets.midcast['Blue Magic'].PhysicalMnd = set_combine(sets.midcast['Blue Magic'].Physical,
{ear1="Lifestorm Earring",body="Vanir Cotehardie",hands="Assimilator's Bazubands +1",
ring2="Aquasoul Ring",back="Refraction Cape"})
sets.midcast['Blue Magic'].PhysicalChr = set_combine(sets.midcast['Blue Magic'].Physical,
{body="Vanir Cotehardie",hands="Assimilator's Bazubands +1",back="Refraction Cape",
waist="Chaac Belt"})
sets.midcast['Blue Magic'].PhysicalHP = set_combine(sets.midcast['Blue Magic'].Physical)
-- Magical Spells --
sets.midcast['Blue Magic'].Magical = {ammo="Dosis Tathlum",
head="Hagondes Hat",neck="Eddy Necklace",ear1="Friomisi Earring",ear2="Hecate's Earring",
body="Hagondes Coat",hands="Mavi Bazubands +2",ring1="Icesoul Ring",ring2="Acumen Ring",
back="Cornflower Cape",waist="Caudata Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}
sets.midcast['Blue Magic'].Magical.Resistant = set_combine(sets.midcast['Blue Magic'].Magical,
{body="Vanir Cotehardie",ring1="Sangoma Ring",legs="Iuitl Tights",feet="Mavi Basmak +2"})
sets.midcast['Blue Magic'].MagicalMnd = set_combine(sets.midcast['Blue Magic'].Magical,
{ring1="Aquasoul Ring"})
sets.midcast['Blue Magic'].MagicalChr = set_combine(sets.midcast['Blue Magic'].Magical)
sets.midcast['Blue Magic'].MagicalVit = set_combine(sets.midcast['Blue Magic'].Magical,
{ring1="Spiral Ring"})
sets.midcast['Blue Magic'].MagicalDex = set_combine(sets.midcast['Blue Magic'].Magical)
sets.midcast['Blue Magic'].MagicAccuracy = {ammo="Mavi Tathlum",
head="Luhlaza Keffiyeh",neck="Ej Necklace",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Vanir Cotehardie",hands=gear.macc_hagondes,ring2="Sangoma Ring",
back="Cornflower Cape",legs="Iuitl Tights",feet="Iuitl Gaiters +1"}
-- Breath Spells --
sets.midcast['Blue Magic'].Breath = {ammo="Mavi Tathlum",
head="Luhlaza Keffiyeh",neck="Ej Necklace",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Vanir Cotehardie",hands="Assimilator's Bazubands +1",ring1="K'ayres Ring",ring2="Beeline Ring",
back="Refraction Cape",legs="Enif Cosciales",feet="Iuitl Gaiters +1"}
-- Other Types --
sets.midcast['Blue Magic'].Stun = set_combine(sets.midcast['Blue Magic'].MagicAccuracy,
{waist="Chaac Belt"})
sets.midcast['Blue Magic']['White Wind'] = {
head="Whirlpool Mask",neck="Lavalier +1",ear1="Bloodgem Earring",ear2="Loquacious Earring",
body="Vanir Cotehardie",hands="Buremte Gloves",ring1="K'ayres Ring",ring2="Meridian Ring",
back="Fravashi Mantle",waist="Hurch'lan Sash",legs="Enif Cosciales",feet="Hagondes Sabots"}
sets.midcast['Blue Magic'].Healing = {
head="Uk'uxkaj Cap",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Vanir Cotehardie",hands="Buremte Gloves",ring1="Aquasoul Ring",ring2="Sirona's Ring",
back="Pahtli Cape",legs="Hagondes Pants",feet="Hagondes Sabots"}
sets.midcast['Blue Magic'].SkillBasedBuff = {ammo="Mavi Tathlum",
head="Luhlaza Keffiyeh",
body="Assimilator's Jubbah",
back="Cornflower Cape",legs="Mavi Tayt +2",feet="Luhlaza Charuqs"}
sets.midcast['Blue Magic'].Buff = {}
sets.midcast.Protect = {ring1="Sheltered Ring"}
sets.midcast.Protectra = {ring1="Sheltered Ring"}
sets.midcast.Shell = {ring1="Sheltered Ring"}
sets.midcast.Shellra = {ring1="Sheltered Ring"}
-- Sets to return to when not performing an action.
-- Gear for learning spells: +skill and AF hands.
sets.Learning = {ammo="Mavi Tathlum",hands="Assimilator's Bazubands +1"}
--head="Luhlaza Keffiyeh",
--body="Assimilator's Jubbah",hands="Assimilator's Bazubands +1",
--back="Cornflower Cape",legs="Mavi Tayt +2",feet="Luhlaza Charuqs"}
sets.latent_refresh = {waist="Fucho-no-obi"}
-- Resting sets
sets.resting = {
head="Ocelomeh Headpiece +1",neck="Wiglen Gorget",
body="Hagondes Coat",hands="Serpentes Cuffs",ring1="Sheltered Ring",ring2="Paguroidea Ring",
waist="Austerity Belt",feet="Chelona Boots +1"}
-- Idle sets
sets.idle = {ammo="Impatiens",
head="Whirlpool Mask",neck="Wiglen Gorget",ear1="Bloodgem Earring",ear2="Loquacious Earring",
body="Hagondes Coat",hands="Serpentes Cuffs",ring1="Defending Ring",ring2="Paguroidea Ring",
back="Shadow Mantle",waist="Flume Belt",legs="Crimson Cuisses",feet="Serpentes Sabots"}
sets.idle.PDT = {ammo="Impatiens",
head="Whirlpool Mask",neck="Wiglen Gorget",ear1="Bloodgem Earring",ear2="Loquacious Earring",
body="Hagondes Coat",hands="Iuitl Wristbands",ring1="Defending Ring",ring2="Paguroidea Ring",
back="Shadow Mantle",waist="Flume Belt",legs="Crimson Cuisses",feet="Iuitl Gaiters +1"}
sets.idle.Town = {main="Buramenk'ah",ammo="Impatiens",
head="Mavi Kavuk +2",neck="Wiglen Gorget",ear1="Bloodgem Earring",ear2="Loquacious Earring",
body="Luhlaza Jubbah",hands="Assimilator's Bazubands +1",ring1="Sheltered Ring",ring2="Paguroidea Ring",
back="Atheling Mantle",waist="Flume Belt",legs="Crimson Cuisses",feet="Luhlaza Charuqs"}
sets.idle.Learning = set_combine(sets.idle, sets.Learning)
-- Defense sets
sets.defense.PDT = {ammo="Iron Gobbet",
head="Whirlpool Mask",neck="Wiglen Gorget",ear1="Bloodgem Earring",
body="Iuitl Vest",hands="Iuitl Wristbands",ring1="Defending Ring",ring2=gear.DarkRing.physical,
back="Shadow Mantle",waist="Flume Belt",legs="Nahtirah Trousers",feet="Iuitl Gaiters +1"}
sets.defense.MDT = {ammo="Demonry Stone",
head="Whirlpool Mask",neck="Twilight Torque",ear1="Bloodgem Earring",
body="Hagondes Coat",hands="Iuitl Wristbands",ring1="Defending Ring",ring2="Shadow Ring",
back="Engulfer Cape",waist="Flume Belt",legs="Nahtirah Trousers",feet="Iuitl Gaiters +1"}
sets.Kiting = {legs="Crimson Cuisses"}
-- 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="Jukukik Feather",
head="Whirlpool Mask",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Luhlaza Jubbah",hands="Assimilator's Bazubands +1",ring1="Rajas Ring",ring2="Epona's Ring",
back="Atheling Mantle",waist="Windbuffet Belt",legs="Manibozho Brais",feet="Iuitl Gaiters +1"}
sets.engaged.Acc = {ammo="Jukukik Feather",
head="Whirlpool Mask",neck="Ej Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Luhlaza Jubbah",hands="Buremte Gloves",ring1="Rajas Ring",ring2="Epona's Ring",
back="Letalis Mantle",waist="Hurch'lan Sash",legs="Manibozho Brais",feet="Qaaxo Leggings"}
sets.engaged.Refresh = {ammo="Jukukik Feather",
head="Whirlpool Mask",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Luhlaza Jubbah",hands="Assimilator's Bazubands +1",ring1="Rajas Ring",ring2="Epona's Ring",
back="Atheling Mantle",waist="Windbuffet Belt",legs="Manibozho Brais",feet="Qaaxo Leggings"}
sets.engaged.DW = {ammo="Jukukik Feather",
head="Whirlpool Mask",neck="Asperity Necklace",ear1="Heartseeker Earring",ear2="Dudgeon Earring",
body="Luhlaza Jubbah",hands="Assimilator's Bazubands +1",ring1="Rajas Ring",ring2="Epona's Ring",
back="Atheling Mantle",waist="Windbuffet Belt",legs="Manibozho Brais",feet="Iuitl Gaiters +1"}
sets.engaged.DW.Acc = {ammo="Jukukik Feather",
head="Whirlpool Mask",neck="Ej Necklace",ear1="Heartseeker Earring",ear2="Dudgeon Earring",
body="Luhlaza Jubbah",hands="Buremte Gloves",ring1="Rajas Ring",ring2="Epona's Ring",
back="Letalis Mantle",waist="Hurch'lan Sash",legs="Manibozho Brais",feet="Qaaxo Leggings"}
sets.engaged.DW.Refresh = {ammo="Jukukik Feather",
head="Whirlpool Mask",neck="Asperity Necklace",ear1="Heartseeker Earring",ear2="Dudgeon Earring",
body="Luhlaza Jubbah",hands="Assimilator's Bazubands +1",ring1="Rajas Ring",ring2="Epona's Ring",
back="Letalis Mantle",waist="Windbuffet Belt",legs="Manibozho Brais",feet="Qaaxo Leggings"}
sets.engaged.Learning = set_combine(sets.engaged, sets.Learning)
sets.engaged.DW.Learning = set_combine(sets.engaged.DW, sets.Learning)
sets.self_healing = {ring1="Kunaji Ring",ring2="Asklepian Ring"}
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 unbridled_spells:contains(spell.english) and not state.Buff['Unbridled Learning'] then
eventArgs.cancel = true
windower.send_command('@input /ja "Unbridled Learning" <me>; wait 1.5; input /ma "'..spell.name..'" '..spell.target.name)
end
end
-- Run after the default midcast() is done.
-- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
function job_post_midcast(spell, action, spellMap, eventArgs)
-- Add enhancement gear for Chain Affinity, etc.
if spell.skill == 'Blue Magic' then
for buff,active in pairs(state.Buff) do
if active and sets.buff[buff] then
equip(sets.buff[buff])
end
end
if spellMap == 'Healing' and spell.target.type == 'SELF' and sets.self_healing then
equip(sets.self_healing)
end
end
-- If in learning mode, keep on gear intended to help with that, regardless of action.
if state.OffenseMode.value == 'Learning' then
equip(sets.Learning)
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 state.Buff[buff] ~= nil then
state.Buff[buff] = gain
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- Custom spell mapping.
-- Return custom spellMap value that can override the default spell mapping.
-- Don't return anything to allow default spell mapping to be used.
function job_get_spell_map(spell, default_spell_map)
if spell.skill == 'Blue Magic' then
for category,spell_list in pairs(blue_magic_maps) do
if spell_list:contains(spell.english) then
return category
end
end
end
end
-- Modify the default idle set after it was constructed.
function customize_idle_set(idleSet)
if player.mpp < 51 then
set_combine(idleSet, sets.latent_refresh)
end
return idleSet
end
-- Called by the 'update' self-command, for common needs.
-- Set eventArgs.handled to true if we don't want automatic equipping of gear.
function job_update(cmdParams, eventArgs)
update_combat_form()
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function update_combat_form()
-- Check for H2H or single-wielding
if player.equipment.sub == "Genbu's Shield" or player.equipment.sub == 'empty' then
state.CombatForm:reset()
else
state.CombatForm:set('DW')
end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
-- Default macro set/book
if player.sub_job == 'DNC' then
set_macro_page(2, 7)
else
set_macro_page(1, 7)
end
end
サーバ: Shiva
Game: FFXI
Posts: 1052
By Shiva.Arislan 2016-10-27 07:52:40
Quote: Currently have a BLU gs that doesn't auto-switch macro books/pages...
Just use your old lua, and in function user_setup() add this line:
Code select_default_macro_book()
And at the end of your lua, paste this function:
Code function select_default_macro_book()
-- Default macro set/book
if player.sub_job == 'WAR' then
set_macro_page(1, 10)
elseif player.sub_job == 'RDM' then
set_macro_page(2, 10)
else
set_macro_page(1, 10)
end
end
Change the macro book #'s to whatever you're currently using, and add/subtract subjob conditionals if needed.
サーバ: Shiva
Game: FFXI
Posts: 357
By Shiva.Berzerk 2016-10-27 09:21:37
Quote: Currently have a BLU gs that doesn't auto-switch macro books/pages...
Just use your old lua, and in function user_setup() add this line:
Code select_default_macro_book()
And at the end of your lua, paste this function:
Code function select_default_macro_book()
-- Default macro set/book
if player.sub_job == 'WAR' then
set_macro_page(1, 10)
elseif player.sub_job == 'RDM' then
set_macro_page(2, 10)
else
set_macro_page(1, 10)
end
end
Change the macro book #'s to whatever you're currently using, and add/subtract subjob conditionals if needed.
For some reason the current BLU lua I'm using doesn't have a user_setup, hence when i copy the macro stuff over it doesn't want to work :/ Will post the code of the current BLU lua w/o the macro pages that CAN swap gear properly when engaging. I've tried adding it in the get_sets() function, creating a user_setup() function with a call to the macro-setting function but just getting errors. Will try playing on a bigger resolution so i can see the full error message.
Code
function get_sets()
send_command('bind f9 gs c toggle TP set')
send_command('bind f10 gs c toggle Idle set')
send_command('bind f11 gs c toggle CDC set')
send_command('bind f12 gs c toggle Req set')
send_command('bind !f12 gs c toggle Rea set')
send_command('bind ^` gs c toggle MB set')
function file_unload()
send_command('unbind ^f9')
send_command('unbind ^f10')
send_command('unbind ^f11')
send_command('unbind ^f12')
send_command('unbind ^`')
send_command('unbind !f9')
send_command('unbind !f10')
send_command('unbind !f11')
send_command('unbind !f12')
send_command('unbind f9')
send_command('unbind f10')
send_command('unbind f11')
send_command('unbind f12')
end
--Idle Sets--
sets.Idle = {}
sets.Idle.index = {'Standard','DT'}
Idle_ind = 1
sets.Idle.Standard = {ammo="Ginsen",
head="Rawhide Mask",neck="Sanctity Necklace", ear1="Dignitary's earring", ear2="Suppanomimi",
body="Jhakri robe +1",hands="Serpentes cuffs",ring1="Shneddick ring",ring2="Defending ring",
back="Rosmerta's cape",waist="Windbuffet belt",legs="Rawhide trousers",feet="Serpentes sabots"}
sets.Idle.DT = {ammo="Iron Gobbet",
head="Hagondes Hat +1",neck="Twilight Torque", ear1="Etiolation earring", ear2="Cryptic Earring",
body="Emet Harness +1",hands="Herculean gloves",ring1="Defending ring",ring2="Gelatinous ring +1",
back="Cheviot Cape",waist="Flume belt",legs="Carmine Cuisses",feet="Hippomenes socks +1"}
--TP Sets--
sets.TP = {}
sets.TP.index = {'Standard', 'aftermath', 'Safe'}
--1=Standard, 2=Solo, 3=Marches, 4=AccuracyLite, 5=AccuracyFull, 6=DT, 7=DTAccuracy--
TP_ind = 1
sets.TP.Standard = {ammo="Ginsen",
head="Dampening tam",
body="Adhemar jacket",
hands="Adhemar Wristbands",
legs="Samnuha tights",
feet="Herculean Boots",
neck="Lissome Necklace",
waist="Windbuffet Belt",
left_ear="Dignitary's Earring",
right_ear="Suppanomimi",
left_ring="Rajas Ring",
right_ring="Epona's Ring",
back={ name="Rosmerta's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10',}},
}
sets.TP.Accuracy = {ammo="Ginsen",
head="Dampening tam",
body="Adhemar jacket",
hands="Adhemar Wristbands",
legs="Carmine cuisses +1",
feet="Herculean Boots",
neck="Lissome Necklace",
waist="Hurch'lan sash",
left_ear="Dignitary's Earring",
right_ear="Suppanomimi",
left_ring="Rajas Ring",
right_ring="Epona's Ring",
back={ name="Rosmerta's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Store TP"+10',}},
}
sets.TP.Safe = {ammo="Ginsen",
head="Herculean helm",
body="Herculean vest",
hands="Herculean gloves",
legs="Herculean trousers",
feet="Herculean Boots",
neck="Twilight torque",
waist="Flume belt",
left_ear="Dignitary's Earring",
right_ear="Suppanomimi",
left_ring="Gelatinous Ring +1",
right_ring="Defending Ring",
back="Xucau mantle",
}
--Weaponskill Sets--
sets.WS = {}
sets.Requiescat = {}
sets.Requiescat.index = {'Attack','Accuracy'}
Requiescat_ind = 1
sets.Requiescat.Attack = {ammo="Hydrocera",
head="Dampening Tam",
body="Thaumas Coat",
hands={ name="Herculean Gloves", augments={'Accuracy+20','"Triple Atk."+4','DEX+1','Attack+7',}},
legs="Samnuha Tights",
feet={ name="Herculean Boots", augments={'Accuracy+29','"Triple Atk."+4','STR+10',}},
neck="Fotia Gorget",
waist="Fotia Belt",
left_ear="Brutal Earring",
right_ear="Moonshade Earring",
left_ring="Epona's Ring",
right_ring="Rufescent Ring",
back="Bleating Mantle",
}
sets.Requiescat.Accuracy = {ammo="Falcon Eye",
head="Whirlpool mask",neck="Fotia gorget",ear1="Brutal earring",ear2="Moonshade earring",
body="Luhlaza jubbah +1",hands="Qaaxo mitaines",ring1="Epona's ring",ring2="Levia. ring",
back="Letalis mantle",waist="Fotia belt",legs="Quiahuiz trousers",feet="Assim. charuqs +1"}
sets.ChantDuCygne = {}
sets.ChantDuCygne.index = {'Attack','Accuracy','HighAcc'}
ChantDuCygne_ind = 1
sets.ChantDuCygne.Attack = {ammo="Yetshila",
head="Adhemar bonnet",
body="Herculean vest",
hands="Jhakri cuffs",
legs="Carmine cuisses +1",
feet="Thereoid greaves",
neck="Fotia Gorget",
waist="Fotia Belt",
left_ear="Bladeborn Earring",
right_ear="Steelflash Earring",
left_ring="Rajas Ring",
right_ring="Epona's Ring",
back={ name="Rosmerta's Cape", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','Crit.hit rate+10',}},
}
sets.ChantDuCygne.Accuracy = {ammo="Yetshila",
head="Adhemar bonnet",
body="Adhemar jacket",
hands="Jhakri cuffs",
legs="Carmine cuisses +1",
feet="Herculean boots",
neck="Fotia Gorget",
waist="Fotia Belt",
left_ear="Bladeborn Earring",
right_ear="Steelflash Earring",
left_ring="Rajas Ring",
right_ring="Epona's Ring",
back={ name="Rosmerta's Cape", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','Crit.hit rate+10',}},
}
sets.ChantDuCygne.HighAcc = {ammo="Yetshila",
head="Adhemar bonnet",
body="Adhemar jacket",
hands="Jhakri cuffs",
legs="Herculean trousers",
feet="Herculean boots",
neck="Fotia Gorget",
waist="Fotia Belt",
left_ear="Bladeborn Earring",
right_ear="Steelflash Earring",
left_ring="Rajas Ring",
right_ring="Epona's Ring",
back={ name="Rosmerta's Cape", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','Crit.hit rate+10',}},
}
sets.WS.SanguineBlade = {}
sets.WS.SanguineBlade = {ammo="Ghastly Tathlum",
head="Pixie Hairpin +1",
body="Amalric Doublet",
hands="Amalric Gages",
legs="Amalric Slops",
feet="Amalric Nails",
neck="Sanctity Necklace",
waist="Yamabuki-no-Obi",
left_ear="Crematio Earring",
right_ear="Friomisi Earring",
left_ring="Archon Ring",
right_ring="Shiva Ring",
back="Cornflower Cape",
}
sets.WS.CircleBlade = {}
sets.WS.CircleBlade = {ammo="Mantoptera Eye",
head="Lilitu Headpiece",neck="Caro Necklace",ear1="Ishvara earring",ear2="Moonshade earring",
body="Thaumas Coat",hands="Adhemar Wristbands",ring1="Epona's ring",ring2="Rufescent ring",
back="Buquwik Cape",waist="Prosilio Belt",legs="Samnuha Tights",feet={ name="Herculean Boots", augments={'Accuracy+29','"Triple Atk."+4','STR+10',}},}
sets.WS.Expiacion = {}
sets.WS.Expiacion = {ammo="Mantoptera Eye",
head="Lilitu Headpiece",neck="Caro Necklace",ear1="Ishvara earring",ear2="Moonshade earring",
body="Thaumas Coat",hands="Adhemar Wristbands",ring1="Epona's ring",ring2="Rufescent ring",
back="Buquwik Cape",waist="Prosilio Belt",legs="Samnuha Tights",feet={ name="Herculean Boots", augments={'Accuracy+29','"Triple Atk."+4','STR+10',}},}
sets.WS.VorpalBlade = {}
sets.WS.VorpalBlade = {ammo="Mantoptera Eye",
head="Lilitu Headpiece",neck="Fotia Gorget",ear1="Brutal earring",ear2="Moonshade earring",
body="Abnoba Kaftan",hands="Adhemar Wristbands",ring1="Epona's ring",ring2="Rufescent ring",
back="Rosmerta's Cape",waist="Fotia Belt",legs="Samnuha Tights",feet="Thereoid Greaves"}
sets.Realmrazer = {}
sets.Realmrazer.index = {'Attack','Accuracy'}
Realmrazer_ind = 1
sets.Realmrazer.Attack = {ammo="Hydrocera",
head="Dampening Tam",neck="Fotia gorget",ear1="Bladeborn earring",ear2="Steelflash Earring",
body="Thaumas Coat",hands="Adhemar Wristbands",ring1="Rajas ring",ring2="Rufescent ring",
back="Buquwik Cape",waist="Fotia belt",legs="Telchine Braconi",feet={ name="Herculean Boots", augments={'Accuracy+29','"Triple Atk."+4','STR+10',}},}
sets.Realmrazer.Accuracy = {ammo="Falcon Eye",
head="Whirlpool mask",neck="Fotia gorget",ear1="Bladeborn earring",ear2="Steelflash earring",
body="Luhlaza jubbah +1",hands="Luh. Bazubands +1",ring1="Levia. ring",ring2="Aquasoul ring",
back="Letalis mantle",waist="Fotia belt",legs="Quiahuiz trousers",feet="Assim. charuqs +1"}
sets.WS.FlashNova = {}
sets.WS.FlashNova = {ammo="Ghastly Tathlum",
head={ name="Herculean Helm", augments={'Mag. Acc.+12 "Mag.Atk.Bns."+12','Mag. Acc.+13','"Mag.Atk.Bns."+12',}},
body="Amalric Doublet",
hands="Amalric Gages",
legs="Amalric Slops",
feet="Hashishin Basmak +1",
neck="Sanctity Necklace",
waist="Yamabuki-no-Obi",
left_ear="Crematio Earring",
right_ear="Friomisi Earring",
left_ring="Shiva Ring +1",
right_ring="Shiva Ring +1",
back="Cornflower cape",
}
--Magic Burst Sets--
sets.Burst = {}
sets.Burst.index = {'BA', 'MB'}
Burst_ind = 1
--Blue Magic Sets--
sets.BlueMagic = {}
sets.BlueMagic.STR = {ammo="Mantoptera Eye",
head={ name="Taeon Chapeau", augments={'Accuracy+16 Attack+16','"Triple Atk."+2','DEX+10',}},
body="Thaumas Coat",
hands="Adhemar Wristbands",
legs={ name="Taeon Tights", augments={'Accuracy+18 Attack+18','"Triple Atk."+2','STR+7 DEX+7',}},
feet={ name="Rawhide Boots", augments={'STR+10','Attack+15','"Store TP"+5',}},
neck="Caro Necklace",
waist="Prosilio Belt",
left_ear="Bladeborn Earring",
right_ear="Dudgeon Earring",
left_ring="Ifrit Ring +1",
right_ring="Rajas Ring",
back="Cornflower cape",
}
sets.BlueMagic.STRDEX = {ammo="Mantoptera Eye",
head={ name="Taeon Chapeau", augments={'Accuracy+16 Attack+16','"Triple Atk."+2','DEX+10',}},
body="Thaumas Coat",
hands="Adhemar Wristbands",
legs={ name="Taeon Tights", augments={'Accuracy+18 Attack+18','"Triple Atk."+2','STR+7 DEX+7',}},
feet={ name="Rawhide Boots", augments={'STR+10','Attack+15','"Store TP"+5',}},
neck="Caro Necklace",
waist="Prosilio Belt",
left_ear="Bladeborn Earring",
right_ear="Dudgeon Earring",
left_ring="Ifrit Ring +1",
right_ring="Rajas Ring",
back="Cornflower cape",
}
sets.BlueMagic.STRVIT = {ammo="Mantoptera Eye",
head={ name="Taeon Chapeau", augments={'Accuracy+16 Attack+16','"Triple Atk."+2','DEX+10',}},
body="Thaumas Coat",
hands="Adhemar Wristbands",
legs={ name="Taeon Tights", augments={'Accuracy+18 Attack+18','"Triple Atk."+2','STR+7 DEX+7',}},
feet={ name="Rawhide Boots", augments={'STR+10','Attack+15','"Store TP"+5',}},
neck="Caro Necklace",
waist="Prosilio Belt",
left_ear="Bladeborn Earring",
right_ear="Dudgeon Earring",
left_ring="Ifrit Ring +1",
right_ring="Rajas Ring",
back="Cornflower cape",
}
sets.BlueMagic.STRMND = {ammo="Mantoptera Eye",
head={ name="Taeon Chapeau", augments={'Accuracy+16 Attack+16','"Triple Atk."+2','DEX+10',}},
body="Thaumas Coat",
hands="Adhemar Wristbands",
legs={ name="Taeon Tights", augments={'Accuracy+18 Attack+18','"Triple Atk."+2','STR+7 DEX+7',}},
feet={ name="Rawhide Boots", augments={'STR+10','Attack+15','"Store TP"+5',}},
neck="Caro Necklace",
waist="Prosilio Belt",
left_ear="Bladeborn Earring",
right_ear="Dudgeon Earring",
left_ring="Ifrit Ring +1",
right_ring="Rajas Ring",
back="Cornflower cape",
}
sets.BlueMagic.AGI = {ammo="Mantoptera Eye",
head={ name="Taeon Chapeau", augments={'Accuracy+16 Attack+16','"Triple Atk."+2','DEX+10',}},
body="Adhemar jacket",
hands="Adhemar Wristbands",
legs={ name="Taeon Tights", augments={'Accuracy+18 Attack+18','"Triple Atk."+2','STR+7 DEX+7',}},
feet={ name="Rawhide Boots", augments={'STR+10','Attack+15','"Store TP"+5',}},
neck="Subtlety Spec.",
waist="Prosilio Belt",
left_ear="Bladeborn Earring",
right_ear="Dudgeon Earring",
left_ring="Ifrit Ring +1",
right_ring="Rajas Ring",
back="Cornflower cape",
}
sets.BlueMagic.INT = {ammo="Pemphredo tathlum",
head="Jhakri coronal +1",
body="Jhakri robe +1",
hands="Jhakri cuffs +1",
legs="Jhakri slops +1",
feet="Jhakri pigaches +1",
neck="Sanctity Necklace",
waist="Yamabuki-no-obi",
left_ear="Friomisi Earring",
right_ear="Novio Earring",
left_ring="Strendu ring",
right_ring="Omega ring",
back="Cornflower cape",
}
sets.BlueMagic.Dark = {ammo="Ghastly Tathlum +1",
head="Pixie Hairpin +1",
body="Amalric Doublet",
hands="Amalric Gages",
legs="Amalric Slops",
feet="Amalric Nails",
neck="Sanctity Necklace",
waist="Chaac Belt",
left_ear="Crematio Earring",
right_ear="Friomisi Earring",
left_ring="Archon Ring",
right_ring="Shiva Ring +1",
back="Cornflower cape",
}
sets.BlueMagic.Cures = {ammo="Hydrocera",
head="Telchine Cap",
body="Vrikodara Jupon",
hands="Telchine Gloves",
legs="Gyve Trousers",
feet="Medium's Sabots",
neck="Phalaina Locket",
waist="Pythia Sash",
left_ear="Mendi. Earring",
right_ear="Lifestorm Earring",
left_ring="Levia. Ring",
right_ring="Levia. Ring",
back="Solemnity Cape",
}
sets.BlueMagic.SelfCures = {ammo="Hydrocera",
head="Telchine Cap",
body="Vrikodara Jupon",
hands="Telchine Gloves",
legs="Telchine Braconi",
feet="Telchine pigaches",
neck="Phalaina Locket",
waist="Gishdubar Sash",
left_ear="Mendi. Earring",
right_ear="Lifestorm Earring",
left_ring="Asklepian Ring",
right_ring="Kunaji Ring",
back="Solemnity Cape",
}
sets.BlueMagic.Stun = {ammo="Falcon Eye",
head="Dampening Tam",
body="Samnuha Coat",
hands="adhemar wristbands",
legs="Miasmic Pants",
feet={ name="Herculean Boots", augments={'Accuracy+25 Attack+25','DEX+1','Accuracy+12','Attack+14',}},
neck="Sanctity Necklace",
waist="Eschan Stone",
left_ear="Gwati Earring",
right_ear="Steelflash Earring",
left_ring="Vertigo Ring",
right_ring="Sangoma Ring",
back="Cornflower cape",
}
sets.BlueMagic.HeavyStrike = {ammo="Mantoptera Eye",
head={ name="Taeon Chapeau", augments={'Accuracy+16 Attack+16','"Triple Atk."+2','DEX+10',}},
body="Rawhide Vest",
hands={ name="Herculean Gloves", augments={'Accuracy+24 Attack+24','Crit.hit rate+1','DEX+10','Accuracy+11',}},
legs={ name="Taeon Tights", augments={'Accuracy+18 Attack+18','"Triple Atk."+2','STR+7 DEX+7',}},
feet={ name="Herculean Boots", augments={'Accuracy+25 Attack+25','DEX+1','Accuracy+12','Attack+14',}},
neck="Subtlety Spec.",
waist="Chuq'aba Belt",
left_ear="Heartseeker Earring",
right_ear="Steelflash Earring",
left_ring={ name="Dark Ring", augments={'Magic dmg. taken -4%','Phys. dmg. taken -4%','Breath dmg. taken -3%',}},
right_ring="Rajas Ring",
back="Cornflower cape",
}
sets.BlueMagic.ChargedWhisker = {ammo="Ghastly Tathlum",
head={ name="Herculean Helm", augments={'Mag. Acc.+12 "Mag.Atk.Bns."+12','Mag. Acc.+13','"Mag.Atk.Bns."+12',}},
body="Amalric Doublet",
hands="Amalric Gages",
legs="Amalric Slops",
feet="Hashishin Basmak +1",
neck="Sanctity Necklace",
waist="Yamabuki-no-Obi",
left_ear="Crematio Earring",
right_ear="Friomisi Earring",
left_ring="Shiva Ring +1",
right_ring="Shiva Ring +1",
back="Cornflower cape",
}
sets.BlueMagic.WhiteWind = {ammo="Egoist's Tathlum",
head="Telchine Cap",
body="Vrikodara Jupon",
hands="Telchine Gloves",
legs="Gyve Trousers",
feet="Medium's Sabots",
neck="Dualism Collar +1",
waist="Gishdubar Sash",
left_ear="Mendi. Earring",
right_ear="Etiolation Earring",
left_ring="Lebeche Ring",
right_ring="Kunaji Ring",
back="Aenotherus Mantle +1",
}
sets.BlueMagic.MagicAccuracy = {ammo="Hydrocera",
head="Herculean Helm",
body="Amalric Doublet",
hands="Amalric Gages",
legs="Psycloth Lappas",
feet="Amalric Nails",
neck="Sanctity Necklace",
waist="Eschan Stone",
left_ear="Lifestorm Earring",
right_ear="Psystorm Earring",
left_ring="Shiva Ring +1",
right_ring="Sangoma Ring",
back="Cornflower cape",
}
sets.BlueMagic.Enmity = {ammo="Sapience Orb",
head="Rabid Visor",
body="Emet Harness +1",
hands="Leyline Gloves",
legs="Obatala Subligar",
feet="Dux Greaves",
neck="Warder's Charm",
waist="Goading Belt",
left_ear="Friomisi Earring",
right_ear="Cryptic Earring",
left_ring="Vexer Ring +1",
right_ring="Petrov Ring",
back="Mubvumbamiri Mantle",
}
sets.BlueMagic.ConserveMP = {ammo="Sapience Orb",
head="Telchine Cap",
body="Amalric Doublet",
hands="Leyline Gloves",
legs="Miasmic Pants",
feet="Taeon Boots",
neck="Deviant Necklace",
waist="Pythia Sash",
left_ear="Gwati Earring",
right_ear="Mendi. Earring",
left_ring="Prolix Ring",
right_ring="Lebeche Ring",
back="Swith Cape",
}
sets.BlueMagic.Refresh = {ammo="Sapience Orb",
head="Telchine Cap",
body="Telchine Chasuble",
hands="Leyline Gloves",
legs="Miasmic Pants",
feet="Taeon Boots",
neck="Deviant Necklace",
waist="Gishdubar Sash",
left_ear="Gwati Earring",
right_ear="Mendi. Earring",
left_ring="Prolix Ring",
right_ring="Lebeche Ring",
back="Grapevine Cape",
}
sets.BlueMagic.Skill = {ammo="Mavi Tathlum",
head={ name="Herculean Helm", augments={'Mag. Acc.+20 "Mag.Atk.Bns."+20','"Fast Cast"+4','Mag. Acc.+4',}},
body="Taeon Tabard",
hands="adhemar wristbands",
legs="Psycloth Lappas",
feet="Luhlaza Charuqs",
neck="Deceiver's Torque",
waist="Witful Belt",
left_ear="Enchntr. Earring +1",
right_ear="Loquac. Earring",
left_ring="Prolix Ring",
right_ring="Lebeche Ring",
back="Cornflower Cape",
}
sets.BlueMagic.SkillRecast = {ammo="Mavi Tathlum",
head={ name="Herculean Helm", augments={'Mag. Acc.+20 "Mag.Atk.Bns."+20','"Fast Cast"+4','Mag. Acc.+4',}},
body="Taeon Tabard",
hands="adhemar wristbands",
legs="Psycloth Lappas",
feet="Luhlaza Charuqs",
neck="Deceiver's Torque",
waist="Witful Belt",
left_ear="Enchntr. Earring +1",
right_ear="Loquac. Earring",
left_ring="Prolix Ring",
right_ring="Lebeche Ring",
back="Cornflower Cape",
}
--Utility Sets--
sets.Utility = {}
sets.Utility.Weather = {waist="Hachirin-no-obi",back="Twilight Cape"}
sets.Utility.MB = {head="Helios Band",body="Samnuha Coat",ear1="Static Earring",ring1="Locus Ring",ring2="Mujin Band"}
sets.Utility.Stoneskin = {head="Haruspex hat",neck="Stone Gorget",ear1="Loquac. earring",ear2="Earthcry earring",
body="Assim. jubbah +1",hands="Stone Mufflers",ring1="Prolix ring",
back="Swith cape",waist="Siegel sash",legs="Haven hose",feet="Iuitl gaiters"}
sets.Utility.Phalanx = {head="Haruspex hat",neck="Colossus's torque",ear1="Loquac. earring",ear2="Augment. earring",
body="Assim. jubbah +1",hands="Ayao's gages",ring1="Prolix ring",
back="Swith cape",waist="Pythia sash +1",legs="Portent pants",feet="Iuitl gaiters"}
sets.Utility.Steps = {ammo="Falcon Eye",
head="Dampening Tam",
body="Thaumas Coat",
hands="adhemar wristbands",
legs={ name="Taeon Tights", augments={'Accuracy+18 Attack+18','"Triple Atk."+2','STR+7 DEX+7',}},
feet={ name="Taeon Boots", augments={'Accuracy+18 Attack+18','"Triple Atk."+2','DEX+10',}},
neck="Subtlety Spec.",
waist="Chaac Belt",
left_ear="Heartseeker Earring",
right_ear="Steelflash Earring",
left_ring="Yacuruna Ring",
right_ring="Rajas Ring",
back="Grounded Mantle",
}
sets.Utility.PDT = {head="Whirlpool mask",neck="Twilight torque",ear1="Ethereal earring",
body="Iuitl vest",hands="Umuthi gloves",ring1="Dark ring",ring2="Dark ring",
back="Mollusca mantle",waist="Flume belt",legs="Iuitl Tights +1",feet="Iuitl gaiters"}
sets.Utility.MDT = {head="Whirlpool mask",neck="Twilight torque",
body="Assim. jubbah +1",hands="Umuthi gloves",ring1="Dark ring",ring2="Dark ring",
back="Mollusca mantle",legs="Quiahuiz trousers",feet="Luhlaza charuqs"}
--Job Ability Sets--
sets.JA = {}
sets.JA.ChainAffinity = {feet="Assim. charuqs +1"}
sets.JA.BurstAffinity = {feet="Hashishin Basmak +1"}
sets.JA.Efflux = {legs="Mavi tayt +2"}
sets.JA.AzureLore = {hands="Luh. bazubands +1"}
sets.JA.Diffusion = {feet="Mirage Charuqs +2"}
--Precast Sets--
sets.precast = {}
sets.precast.FC = {}
sets.precast.FC.Standard = {ammo="Sapience Orb",
head="Herculean Helm",
body="Taeon Tabard",
hands="Leyline Gloves",
legs="Psycloth Lappas",
feet="Amalric Nails",
neck="Orunmila's Torque",
waist="Witful Belt",
left_ear="Enchntr. Earring +1",
right_ear="Loquac. Earring",
left_ring="Prolix Ring",
right_ring="Weatherspoon ring",
back="Swith Cape",
}
sets.precast.FC.Blue = {ammo="Sapience Orb",
head="Herculean Helm",
body="Hashishin Mintan +1",
hands="Leyline Gloves",
legs="Psycloth Lappas",
feet="Amalric Nails",
neck="Orunmila's Torque",
waist="Witful Belt",
left_ear="Enchntr. Earring +1",
right_ear="Loquac. Earring",
left_ring="Prolix Ring",
right_ring="Weatherspoon Ring",
back="Swith Cape",
}
end
function precast(spell)
if spell.action_type == 'Magic' then
equip(sets.precast.FC.Standard)
if spell.skill == 'Blue Magic' then
equip(sets.precast.FC.Blue)
end
end
if spell.english == 'Azure Lore' then
equip(sets.JA.AzureLore)
end
if spell.english == 'Requiescat' then
equip(sets.Requiescat[sets.Requiescat.index[Requiescat_ind]])
end
if spell.english == 'Chant du Cygne' then
equip(sets.ChantDuCygne[sets.ChantDuCygne.index[ChantDuCygne_ind]])
end
if spell.english == 'Circle Blade' or spell.english == 'Savage Blade' then
equip(sets.WS.CircleBlade)
end
if spell.english == 'Expiacion' then
equip(sets.WS.Expiacion)
end
if spell.english == 'Vorpal Blade' then
equip(sets.WS.VorpalBlade)
end
if spell.english == 'Sanguine Blade' then
equip(sets.WS.SanguineBlade)
if spell.element == world.day_element or spell.element == world.weather_element then
equip(sets.Utility.Weather)
end
end
if spell.english == 'Box Step' then
equip(sets.Utility.Steps)
end
if spell.english == 'Realmrazer' then
equip(sets.Realmrazer[sets.Realmrazer.index[Realmrazer_ind]])
end
if spell.english == 'Flash Nova' then
equip(sets.WS.FlashNova)
if spell.element == world.day_element or spell.element == world.weather_element then
equip(sets.Utility.Weather)
end
end
end
function midcast(spell,act)
if spell.english == 'Vertical Cleave' or spell.english == 'Death Scissors' or spell.english == 'Empty Thrash' or spell.english == 'Dimensional Death' or spell.english == 'Quadrastrike' or spell.english == 'Bloodrake' then
equip(sets.BlueMagic.STR)
if buffactive['Chain Affinity'] then
equip(sets.JA.ChainAffinity)
end
if buffactive['Efflux'] then
equip(sets.JA.Efflux)
end
end
if spell.english == 'Disseverment' or spell.english == 'Hysteric Barrage' or spell.english == 'Frenetic Rip' or spell.english == 'Seedspray' or spell.english == 'Vanity Dive' or spell.english == 'Goblin Rush' or spell.english == 'Paralyzing Triad' or spell.english == 'Thrashing Assault' then
equip(sets.BlueMagic.STRDEX)
if buffactive['Chain Affinity'] then
equip(sets.JA.ChainAffinity)
end
if buffactive['Efflux'] then
equip(sets.JA.Efflux)
end
end
if spell.english == 'Quad. Continuum' or spell.english == 'Delta Thrust' or spell.english == 'Cannonball' or spell.english == 'Glutinous Dart' then
equip(sets.BlueMagic.STRVIT)
if buffactive['Chain Affinity'] then
equip(sets.JA.ChainAffinity)
end
if buffactive['Efflux'] then
equip(sets.JA.Efflux)
end
end
if spell.english == 'Whirl of Rage' then
equip(sets.BlueMagic.STRMND)
if buffactive['Chain Affinity'] then
equip(sets.JA.ChainAffinity)
end
if buffactive['Efflux'] then
equip(sets.JA.Efflux)
end
end
if spell.english == 'Benthic Typhoon' or spell.english == 'Final Sting' or spell.english == 'Spiral Spin' then
equip(sets.BlueMagic.AGI)
if buffactive['Chain Affinity'] then
equip(sets.JA.ChainAffinity)
end
if buffactive['Efflux'] then
equip(sets.JA.Efflux)
end
end
if spell.english == 'Gates of Hades' or spell.english == 'Lunge' or spell.english == 'Swipe' or spell.english == 'Leafstorm' or spell.english == 'Firespit' or spell.english == 'Acrid Stream' or spell.english == 'Regurgitation' or spell.english == 'Corrosive Ooze' or spell.english == 'Thermal Pulse' or spell.english == 'Magic Hammer'
or spell.english == 'Evryone. Grudge' or spell.english == 'Water Bomb' or spell.english == 'Dark Orb' or spell.english == 'Thunderbolt' or spell.english == 'Tem. Upheaval' or spell.english == 'Embalming Earth' or spell.english == 'Foul Waters' or spell.english == 'Rending Deluge'
or spell.english == 'Droning Whirlwind' or spell.english == 'Subduction' or spell.english == 'Anvil Lightning' or spell.english == 'Blinding Fulgor' or spell.english == 'Entomb' or spell.english == 'Palling Salvo' or spell.english == 'Scouring Spate'
or spell.english == 'Searing Tempest' or spell.english == 'Silent Storm' or spell.english == 'Diffusion Ray' or spell.english == 'Spectral Floe' then
equip(sets.BlueMagic.INT)
if spell.element == world.day_element or spell.element == world.weather_element then
equip(sets.Utility.Weather)
end
if buffactive['Burst Affinity'] then
if Burst_ind == 1 then
equip(sets.JA.BurstAffinity)
elseif Burst_ind == 2 then
equip(sets.Utility.MB)
end
end
end
if spell.english == 'Tenebral Crush' or spell.english == 'Palling Salvo' then
equip(sets.BlueMagic.Dark)
if spell.element == world.day_element or spell.element == world.weather_element then
equip(sets.Utility.Weather)
end
if buffactive['Burst Affinity'] then
if Burst_ind == 1 then
equip(sets.JA.BurstAffinity)
elseif Burst_ind == 2 then
equip(sets.Utility.MB)
end
end
end
if spell.english == 'Magic Fruit' or spell.english == 'Plenilune Embrace' or spell.english == 'Wild Carrot' or spell.english == 'Pollen' or spell.english == 'Cure III' or spell.english == 'Cure IV' then
equip(sets.BlueMagic.Cures)
if spell.target.name == player.name and string.find(spell.english, 'Magic Fruit') or string.find(spell.english, 'Plenilune Embrace') or string.find(spell.english, 'Wild Carrot') or string.find(spell.english, 'Cure III') or string.find(spell.english, 'Cure IV') then
equip(sets.BlueMagic.SelfCures)
end
end
if spell.english == 'White Wind' then
equip(sets.BlueMagic.WhiteWind)
end
if spell.english == 'Head Butt' or spell.english == 'Sudden Lunge' or spell.english == 'Tourbillion' or spell.english == 'Saurian Slide' or spell.english == 'Sweeping Gouge' or spell.english == 'Frypan' then
equip(sets.BlueMagic.Stun)
end
if spell.english == 'Heavy Strike' then
equip(sets.BlueMagic.HeavyStrike)
end
if spell.english == 'Charged Whisker' then
equip(sets.BlueMagic.ChargedWhisker)
if buffactive['Burst Affinity'] then
equip(sets.JA.BurstAffinity)
end
end
if spell.english == 'Frightful Roar' or spell.english == 'Infrasonics' or spell.english == 'Chaotic Eye' or spell.english == 'Auroral Drape' or spell.english == 'Sheep Song' or spell.english == 'Barbed Crescent'
or spell.english == 'Tourbillion' or spell.english == 'Cimicine Discharge' or spell.english == 'Sub-zero smash' or spell.english == 'Filamented Hold' or spell.english == 'Mind Blast' or spell.english == 'Sandspin'
or spell.english == 'Hecatomb Wave' or spell.english == 'Blank Gaze' or spell.english == 'Cold Wave' or spell.english == 'Terror Touch' or spell.english == 'Retinal Glare' or spell.english == 'Dream Flower'
or spell.english == 'Geist Wall' or spell.english == 'Absolute Terror' or spell.english == 'Blistering Roar' then
equip(sets.BlueMagic.MagicAccuracy)
end
if spell.english == 'MP Drainkiss' or spell.english == 'Mighty Guard' or spell.english == 'Digest' or spell.english == 'Blood Saber' or spell.english == 'Blood Drain' or spell.english == 'Osmosis' or spell.english == 'Occultation' or spell.english == 'Magic Barrier' or spell.english == 'Diamondhide' or spell.english == 'Metallic Body' then
equip(sets.BlueMagic.SkillRecast)
if buffactive['Diffusion'] then
equip(sets.JA.Diffusion)
end
end
if spell.english == 'Fantod' or spell.english =='Jettatura' or spell.english =='Wind Breath' or spell.english =='Exuviation' then
equip(sets.BlueMagic.Enmity)
end
if spell.english == 'Mighty Guard' or spell.english == 'Erratic Flutter' or spell.english == 'Nat. Meditation' or spell.english == 'Uproot' or spell.english == 'Saline Coat' or spell.english == 'Barrier Tusk' then
equip(sets.BlueMagic.ConserveMP)
end
if spell.english == 'Battery Charge' or spell.engligh == 'Refresh' then
equip(sets.BlueMagic.Refresh)
end
if spell.english == 'Cocoon' or spell.english == 'Mighty Guard' or spell.english == 'Harden Shell' or spell.english == 'Animating Wail' or spell.english == 'Battery Charge' or spell.english == 'Nat. Meditation' or spell.english == 'Carcharian Verve' or spell.english == 'O. Counterstance' or spell.english == 'Barrier Tusk' or spell.english == 'Saline Coat' or spell.english == 'Regeneration' or spell.english == 'Erratic Flutter' then
if buffactive['Diffusion'] then
equip(sets.JA.Diffusion)
end
end
end
function aftercast(spell)
if player.status == 'Engaged' then
equip(sets.TP[sets.TP.index[TP_ind]])
else
equip(sets.Idle[sets.Idle.index[Idle_ind]])
end
if spell.action_type == 'Weaponskill' then
add_to_chat(158,'TP Return: ['..tostring(player.tp)..']')
end
end
function status_change(new,old)
if new == 'Engaged' then
equip(sets.TP[sets.TP.index[TP_ind]])
else
equip(sets.Idle[sets.Idle.index[Idle_ind]])
end
end
function self_command(command)
if command == 'toggle TP set' then
TP_ind = TP_ind +1
if TP_ind > #sets.TP.index then TP_ind = 1 end
send_command('@input /echo <----- TP Set changed to '..sets.TP.index[TP_ind]..' ----->')
equip(sets.TP[sets.TP.index[TP_ind]])
elseif command == 'toggle Idle set' then
Idle_ind = Idle_ind +1
if Idle_ind > #sets.Idle.index then Idle_ind = 1 end
send_command('@input /echo <----- Idle Set changed to '..sets.Idle.index[Idle_ind]..' ----->')
equip(sets.Idle[sets.Idle.index[Idle_ind]])
elseif command == 'toggle Req set' then
Requiescat_ind = Requiescat_ind +1
if Requiescat_ind > #sets.Requiescat.index then Requiescat_ind = 1 end
send_command('@input /echo <----- Requiescat Set changed to '..sets.Requiescat.index[Requiescat_ind]..' ----->')
elseif command == 'toggle CDC set' then
ChantDuCygne_ind = ChantDuCygne_ind +1
if ChantDuCygne_ind > #sets.ChantDuCygne.index then ChantDuCygne_ind = 1 end
send_command('@input /echo <----- Chant du Cygne Set changed to '..sets.ChantDuCygne.index[ChantDuCygne_ind]..' ----->')
elseif command == 'toggle Rea set' then
Realmrazer_ind = Realmrazer_ind +1
if Realmrazer_ind > #sets.Realmrazer.index then Realmrazer_ind = 1 end
send_command('@input /echo <----- Realmrazer Set changed to '..sets.Realmrazer.index[Realmrazer_ind]..' ----->')
elseif command == 'toggle MB set' then
Burst_ind = Burst_ind +1
if Burst_ind > #sets.Burst.index then Burst_ind = 1 end
send_command('@input /echo [MB Set changed to '..sets.Burst.index[Burst_ind]..']')
elseif command == 'equip TP set' then
equip(sets.TP[sets.TP.index[TP_ind]])
elseif command == 'equip Idle set' then
equip(sets.Idle[sets.Idle.index[Idle_ind]])
end
end
Odin.Lygre
サーバ: Odin
Game: FFXI
Posts: 89
By Odin.Lygre 2016-10-27 10:03:22
Ok, I am back with more questions....
I managed to add/define sets based of the amount of magical haste I have. So now if I have no haste it equips one set of gear, if I get haste 1 or haste 2 it equips based on value of haste all the way up to capped haste.
What I would like additionally is for it to auto equip the single wield gearset in the event I don't have a dual wield subjob, furthermore I would like a way to add in additional sets if I am using /dnc instead of my normal /nin, because the native DW traits are different I would need to add a whole bunch of rules and sets, the problem is I have NO FRIGGIN' IDEA how to do any of that. I literally stole all my haste defined rules from a thf lua and spent like 3 hours til I got it to work.
Edit: Ideally I would like to do this same thing for my terribly designed cor lua, that way I don't have to cycle through 14 sets
It most definitely does work. You just have all of the sets defined recursively, so debugmode doesn't show it swapping to the appropriate haste value. Eliminate the recursions and it works, I promise.
Here is the current version I can confirm works. 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()
determine_haste_group()
update_combat_form()
LowNukes = S{'Stone' , 'Aero' , 'Blizzard' , 'Fire' , 'Water' , 'Thunder' ,
'Stone II' , 'Aero II' , 'Blizzard II' , 'Fire II' , 'Water II' , 'Thunder II',
'Stonega' , 'Aeroga' , 'Blizzaga' , 'Firaga' , 'Waterga' , 'Thundaga',
'Stonega II' , 'Aeroga II' , 'Blizzaga II' , 'Firaga II' , 'Waterga II' , 'Thundaga II'}
MndEnfeebles = S{'Slow' , 'Silence' , 'Paralyze' , 'Addle' , 'Slow II' , 'Paralyze II' , 'Addle II'}
IntEnfeebles = S{'Bind' , 'Break' , 'Gravity' , 'Poison' , 'Sleep' , 'Gravity II' , 'Poison II' , 'Sleep II'}
state.Buff.Saboteur = buffactive.saboteur or false
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', 'Mid', 'Acc')
state.HybridMode:options('Normal', 'PDT', 'Evasion')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'PDT', 'MDT')
select_default_macro_book()
gear.CureStaff = {name=""}
gear.CureFeet = {name=""}
state.MagicBurst = M(false, 'Magic Burst')
state.CureHate = M(false, 'Cure Hate')
send_command('bind !` gs c toggle MagicBurst')
send_command('bind ^` gs c toggle CureHate')
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['Chainspell'] = {body="Vitivation Tabard +1"}
-- Waltz set (chr and vit)
sets.precast.Waltz = {}
-- Don't need any special gear for Healing Waltz.
sets.precast.Waltz['Healing Waltz'] = {}
-- Fast cast sets for spells
-- 80% Fast Cast (including trait) for all spells, plus 5% quick cast
-- No other FC sets necessary.
sets.precast.FC = {}
sets.precast.FC.Impact = set_combine(sets.precast.FC, {head=empty,body="Twilight Cloak"})
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {}
sets.precast.WS['Circle Blade'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Sanguine Blade'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Requiescat'] = {}
sets.precast.WS['Aeolian Edge'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Savage Blade'] = {}
sets.precast.WS['Chant du Cygne'] = {}
sets.precast.WS['True Strike'] = {}
sets.precast.WS['Exenterator'] = {}
sets.precast.WS['Evisceration'] = {}
sets.precast.WS['Death Blossom'] = {}
-- Midcast Sets
sets.midcast.Cure = {}
sets.midcast.Curaga = sets.midcast.Cure
sets.midcast.CureWeather = {}
sets.midcast.CureSelf = {}
sets.midcast.CureMelee = {}
sets.midcast['Enhancing Magic'] = {}
sets.midcast['Enhancing Magic'].Temper = {}
sets.midcast['Enhancing Magic'].RegenSelf = {}
sets.midcast['Enhancing Magic'].RefreshSelf = {}
sets.midcast['Enhancing Magic'].HasteSelf = {}
sets.midcast['Enhancing Magic'].EnSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.midcast['Enhancing Magic'].GainSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.midcast['Enhancing Magic'].BarSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.buff.ComposureOther = {head="Lethargy Chappel +1",body="Lethargy Sayon +1",
legs="Lethargy Fuseau +1",feet="Lethargy Houseaux +1"}
sets.midcast.Protect = {}
sets.midcast.Shell = sets.midcast.Protect
sets.midcast['Enhancing Magic'].Phalanx = {}
sets.midcast.Cursna = {}
sets.midcast.Stoneskin = {}
sets.midcast['Enfeebling Magic'] = {}
sets.midcast.MndEnfeebles = {}
sets.midcast.IntEnfeebles = {}
sets.midcast.Blind = {}
sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
sets.midcast.Distract = {}
sets.midcast.Frazzle = {}
sets.midcast['Distract II'] = sets.midcast.Distract
sets.midcast['Distract III'] = sets.midcast.Distract
sets.midcast['Frazzle II'] = {}
sets.midcast['Frazzle III'] = sets.midcast.Frazzle
sets.midcast['Dia III'] = set_combine(sets.midcast['Enfeebling Magic'], {head="Vitivation Chapeau +1"})
sets.midcast['Slow II'] = set_combine(sets.midcast['Enfeebling Magic'], {head="Vitivation Chapeau +1"})
sets.Lunge = {}
sets.Convert = {main="Murgleis"}
sets.midcast['Elemental Magic'] ={}
sets.midcast['Elemental Magic']['Low'] = {}
sets.midcast.Impact = set_combine(sets.midcast['Elemental Magic'], {head=empty,body="Twilight Cloak"})
sets.midcast['Stun'] = {}
sets.midcast.Drain = {}
sets.midcast.Aspir = sets.midcast.Drain
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {}
-- Idle sets
sets.idle = {}
sets.idle.Town = {}
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.Mid = {}
sets.engaged.Acc = {}
sets.engaged.Evasion = sets.engaged
sets.engaged.Mid.Evasion = sets.engaged.Mid
sets.engaged.Acc.Evasion = sets.engaged.Acc
sets.engaged.PDT = sets.defense.PDT
sets.engaged.Mid.PDT = sets.defense.MDT
sets.engaged.Acc.PDT = sets.defense.PDT
-- Haste 43%
sets.engaged.Haste_43 = set_combine(sets.engaged, {})
sets.engaged.Mid.Haste_43 = sets.engaged.Mid
sets.engaged.Acc.Haste_43 = sets.engaged.Acc
sets.engaged.Evasion.Haste_43 = sets.engaged.Haste_43
sets.engaged.PDT.Haste_43 = sets.defense.PDT
-- 40
sets.engaged.Haste_40 = set_combine(sets.engaged.Haste_43, {})
sets.engaged.Mid.Haste_40 = sets.engaged.Mid
sets.engaged.Acc.Haste_40 = sets.engaged.Acc
sets.engaged.Evasion.Haste_40 = sets.engaged.Haste_40
sets.engaged.PDT.Haste_40 = sets.defense.PDT
-- 30
sets.engaged.Haste_30 = sets.engaged
sets.engaged.Mid.Haste_30 = sets.engaged.Mid
sets.engaged.Acc.Haste_30 = sets.engaged.Acc
sets.engaged.Evasion.Haste_30 = sets.engaged
sets.engaged.PDT.Haste_30 = sets.defense.PDT
-- 25
sets.engaged.Haste_25 = set_combine(sets.engaged.Haste_30, {})
sets.engaged.Acc.Haste_25 = sets.engaged.Acc
sets.engaged.Mid.Haste_25 = sets.engaged.Mid
sets.engaged.Evasion.Haste_25 = sets.engaged
sets.engaged.PDT.Haste_25 = sets.defense.PDT
-- DW nin sub melee group
sets.engaged.DW_nin = {}
sets.engaged.DW_nin.Mid = {}
sets.engaged.DW_nin.Acc = {}
sets.engaged.DW_nin.Evasion = sets.engaged.DW_nin
sets.engaged.DW_nin.Mid.Evasion = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Acc.Evasion = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.PDT = sets.defense.PDT
sets.engaged.DW_nin.Mid.PDT = sets.defense.MDT
sets.engaged.DW_nin.Acc.PDT = sets.defense.PDT
-- Haste 43%
sets.engaged.DW_nin.Haste_43 = set_combine(sets.engaged.DW_nin, {})
sets.engaged.DW_nin.Mid.Haste_43 = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Acc.Haste_43 = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.Evasion.Haste_43 = sets.engaged.DW_nin.Haste_43
sets.engaged.DW_nin.PDT.Haste_43 = sets.defense.PDT
-- 40
sets.engaged.DW_nin.Haste_40 = set_combine(sets.engaged.DW_nin.Haste_43, {})
sets.engaged.DW_nin.Mid.Haste_40 = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Acc.Haste_40 = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.Evasion.Haste_40 = sets.engaged.DW_nin.Haste_40
sets.engaged.DW_nin.PDT.Haste_40 = sets.defense.PDT
-- 30
sets.engaged.DW_nin.Haste_30 = {}
sets.engaged.DW_nin.Mid.Haste_30 = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Acc.Haste_30 = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.Evasion.Haste_30 = sets.engaged.DW_nin
sets.engaged.DW_nin.PDT.Haste_30 = sets.defense.PDT
-- 25
sets.engaged.DW_nin.Haste_25 = set_combine(sets.engaged.DW_nin.Haste_30, {})
sets.engaged.DW_nin.Acc.Haste_25 = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.Mid.Haste_25 = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Evasion.Haste_25 = sets.engaged.DW_nin
sets.engaged.DW_nin.PDT.Haste_25 = sets.defense.PDT
-- DW dnc sub melee group
sets.engaged.DW_dnc = {}
sets.engaged.DW_dnc.Mid = {}
sets.engaged.DW_dnc.Acc = {}
sets.engaged.DW_dnc.Evasion = sets.engaged.DW_dnc
sets.engaged.DW_dnc.Mid.Evasion = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Acc.Evasion = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.PDT = sets.defense.PDT
sets.engaged.DW_dnc.Mid.PDT = sets.defense.MDT
sets.engaged.DW_dnc.Acc.PDT = sets.defense.PDT
-- Haste 43%
sets.engaged.DW_dnc.Haste_43 = set_combine(sets.engaged.DW_dnc, {})
sets.engaged.DW_dnc.Mid.Haste_43 = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Acc.Haste_43 = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.Evasion.Haste_43 = sets.engaged.DW_dnc.Haste_43
sets.engaged.DW_dnc.PDT.Haste_43 = sets.defense.PDT
-- 40
sets.engaged.DW_dnc.Haste_40 = set_combine(sets.engaged.DW_dnc.Haste_43, {})
sets.engaged.DW_dnc.Mid.Haste_40 = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Acc.Haste_40 = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.Evasion.Haste_40 = sets.engaged.DW_dnc.Haste_40
sets.engaged.DW_dnc.PDT.Haste_40 = sets.defense.PDT
-- 30
sets.engaged.DW_dnc.Haste_30 = sets.engaged.DW_dnc
sets.engaged.DW_dnc.Mid.Haste_30 = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Acc.Haste_30 = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.Evasion.Haste_30 = sets.engaged.DW_dnc
sets.engaged.DW_dnc.PDT.Haste_30 = sets.defense.PDT
-- 25
sets.engaged.DW_dnc.Haste_25 = set_combine(sets.engaged.DW_dnc.Haste_30, {})
sets.engaged.DW_dnc.Acc.Haste_25 = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.Mid.Haste_25 = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Evasion.Haste_25 = sets.engaged.DW_dnc
sets.engaged.DW_dnc.PDT.Haste_25 = sets.defense.PDT
sets.magic_burst = {}
sets.cure_hate = {}
sets.Enmity = {}
-- Sets for special buff conditions on spells.
sets.buff.Saboteur = {hands="Lethargy Gantherots +1"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
function job_precast(spell, action, spellMap, eventArgs)
if spell.skill == 'Healing Magic' and spellMap ~= 'StatusRemoval' then
gear.CureFeet.name = "Vanya Clogs"
if player.status == 'Engaged' then
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
if spell.target.type == 'SELF' then
gear.CureFeet.name = "Medium's Sabots"
else
gear.CureFeet.name = "Vanya Clogs"
end
else
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
end
if spell.target.type == 'SELF' then
gear.default.obi_waist = "Chuq'aba Belt"
else
gear.default.obi_waist = "Salire belt"
end
if world.weather_element == 'Light' then
gear.CureStaff.name = "Chatoyant Staff"
else
gear.CureStaff.name = "Serenity"
end
else
gear.default.obi_waist = "Salire belt"
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
end
if spell.name == 'Lunge' or spell.name == 'Swipe' then
equip(sets.Lunge)
end
if spell.name == 'Vallation' then
equip(sets.Enmity)
end
if spell.name == 'Pflug' then
equip(sets.Enmity)
end
if spell.name == 'Warcry'
or spell.name == 'Swordplay' or spell.name == 'Rayke' or spell.name == 'Meditate' or spell.name == 'Provoke' then
equip(sets.Enmity)
end
--prevents casting Utsusemi if you already have 3 or more shadows
if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) then
cancel_spell()
end
if buffactive['terror'] or buffactive['petrification'] or buffactive['stun'] or buffactive['sleep'] then
if TP_ind == 4 then
equip(sets.defense.MDT) else
equip(sets.defense.PDT)
end
end
if spell.name == 'Convert' then
equip(sets.Convert)
end
if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
cancel_spell()
send_command('input /item "Echo Drops" <me>')
end
end
-- Run after the default midcast() is done.
-- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.skill == 'Enfeebling Magic' and state.Buff.Saboteur then
equip(sets.buff.Saboteur)
elseif spell.skill == 'Enhancing Magic' and not spell.english == 'Stoneskin' then
equip(sets.midcast.EnhancingDuration)
if buffactive.composure and spell.target.type == 'PLAYER' then
equip(sets.buff.ComposureOther)
end
elseif spellMap == 'Cure' then
if spell.target.type == 'SELF' then
equip(sets.midcast.CureSelf)
end
if state.CureHate.value then
equip(sets.cure_hate)
end
if world.weather_element == 'Light' then
equip(sets.midcast.CureWeather)
end
elseif spell.skill == 'Elemental Magic' then
if state.MagicBurst.value then
equip(sets.magic_burst)
end
if spell.element == world.day_element or spell.element == world.weather_element then
equip({waist="Hachirin-no-Obi"})
end
elseif spell.skill == "Ninjutsu" then
equip(sets.midcast.Recast)
if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' then
if buffactive['Copy Image'] then
windower.ffxi.cancel_buff(66)
elseif buffactive['Copy Image (2)'] then
windower.ffxi.cancel_buff(444)
elseif buffactive['Copy Image (3)'] then
windower.ffxi.cancel_buff(445)
elseif buffactive['Copy Image (4+)'] then
windower.ffxi.cancel_buff(446)
end
elseif spell.name == 'Monomi: Ichi' and buffactive.Sneak and spell.target.type == 'SELF' then
windower.ffxi.cancel_buff(71)
end
end
if spell.name == 'Foil' or spell.name == 'Flash' or spell.name == 'Blank Gaze'
or spell.name == 'Geist Wall' or spell.name == 'Poison Breath' or spell.name == 'Jettatura'
or spell.name == 'Cocoon' or spell.name == 'Soporific' or spell.name == 'Sheep Song'
or spell.name == 'Refueling' then
equip(sets.Enmity)
end
end
function job_get_spell_map(spell, default_spell_map)
if spell.action_type == 'Magic' then
if spell.skill == 'Enhancing Magic' then
if spell.english:startswith('En') then
return 'EnSpells'
elseif spell.english:startswith('Gain') then
return 'GainSpells'
elseif spell.english:startswith('Phalanx') then
return 'Phalanx'
elseif spell.english:startswith('Bar') then
return 'Bar'
elseif spell.english:startswith('Temper') then
return 'Temper'
elseif spell.english:startswith('Haste') then
if spell.target.type == 'SELF' then
return 'HasteSelf'
end
elseif spell.english:startswith('Refresh') then
if spell.target.type == 'SELF' then
return 'RefreshSelf'
end
end
elseif default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
if player.status == 'Engaged' then
return "CureMelee"
end
end
if spell.action_type == 'Magic' then
if spell.skill == 'Enfeebling Magic' then
if spell.type == 'WhiteMagic' then
return 'MndEnfeebles'
else
return 'IntEnfeebles'
end
elseif spell.skill == 'Elemental Magic' then
if LowNukes:contains(spell.name) then
return 'Low'
else
return
end
end
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
determine_haste_group()
handle_equipping_gear(player.status)
end
-------------------------------------------------------------------------------------------------------------------
-- General hooks for change 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 we gain or lose any haste buffs, adjust which gear set we target.
if S{'haste','march', 'madrigal','embrava','haste samba','mighty guard'}:contains(buff:lower()) then
determine_haste_group()
handle_equipping_gear(player.status)
end
if state.Buff[buff] ~= nil then
state.Buff[buff] = gain
-- if not midaction() then
handle_equipping_gear(player.status)
-- end
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- 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 customize_melee_set(meleeSet)
-- if player.sub_job == 'DNC' or player.sub_job == 'NIN' then
-- meleeSet = set_combine(meleeSet, sets.engaged.DW)
-- end
-- return meleeSet
-- end
function update_combat_form()
-- Check for H2H or single-wielding
if player.equipment.sub == 'empty' then
state.CombatForm:reset()
end
if S{'Culminus','Genmei Shield'}:contains(player.equipment.sub) then
state.CombatForm:reset()
elseif player.sub_job == 'NIN' then
state.CombatForm:set('DW_nin')
elseif player.sub_job == 'DNC' then
state.CombatForm:set('DW_dnc')
end
end
function job_update(cmdParams, eventArgs)
update_combat_form()
determine_haste_group()
end
-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
display_current_caster_state()
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function determine_haste_group()
classes.CustomMeleeGroups:clear()
-- assuming +4 for marches (ghorn has +5)
-- Haste (white magic) 15%
-- Haste Samba (Sub) 5%
-- Haste (Merited DNC) 10% (never account for this)
-- Victory March +0/+3/+4/+5 9.4/14%/15.6%/17.1% +0
-- Advancing March +0/+3/+4/+5 6.3/10.9%/12.5%/14% +0
-- Embrava 30% with 500 enhancing skill
-- Mighty Guard - 15%
-- buffactive[580] = geo haste
-- buffactive[33] = regular haste
-- buffactive[604] = mighty guard
-- state.HasteMode = toggle for when you know Haste II is being cast on you
-- Hi = Haste II is being cast. This is clunky to use when both haste II and haste I are being cast
if ( ( (buffactive[33] or buffactive[580] or buffactive.embrava) and (buffactive.march or buffactive[604]) ) or
( buffactive[33] and (buffactive[580] or buffactive.embrava) ) or
( buffactive.march == 2 and buffactive[604] ) ) then
add_to_chat(8, '-------------Haste 43%-------------')
classes.CustomMeleeGroups:append('Haste_43')
elseif buffactive.embrava and buffactive.haste then
add_to_chat(8, '-------------Haste 40%-------------')
classes.CustomMeleeGroups:append('Haste_40')
elseif ( (buffactive[33] or buffactive.march == 2 or buffactive[580]) and buffactive['haste samba'] ) then
add_to_chat(8, '-------------Haste 35%-------------')
classes.CustomMeleeGroups:append('Haste_35')
elseif ( ( buffactive[580] or buffactive[33] or buffactive.march == 2 ) or
( buffactive.march == 1 and buffactive[604] ) ) then
add_to_chat(8, '-------------Haste 30%-------------')
classes.CustomMeleeGroups:append('Haste_30')
elseif ( buffactive.march == 1 or buffactive[604] ) then
add_to_chat(8, '-------------Haste 15%-------------')
classes.CustomMeleeGroups:append('Haste_15')
elseif ( buffactive[580] and ( buffactive.march or buffactive[33] or buffactive.embrava or buffactive[604]) ) or -- geo haste + anything
( buffactive.embrava and (buffactive.march or buffactive[33] or buffactive[604]) ) or -- embrava + anything
( buffactive.march == 2 and (buffactive[33] or buffactive[604]) ) or -- two marches + anything
( buffactive[33] and buffactive[604] and buffactive.march ) then -- haste + mighty guard + any marches
add_to_chat(8, '-------------Max Haste Mode Enabled--------------')
classes.CustomMeleeGroups:append('Haste_43')
elseif ( (buffactive[604] or buffactive[33]) and buffactive['haste samba'] and buffactive.march == 1) or -- MG or haste + samba with 1 march
( buffactive.march == 2 and buffactive['haste samba'] ) or
( buffactive[580] and buffactive['haste samba'] ) then
add_to_chat(8, '-------------Haste 35%-------------')
classes.CustomMeleeGroups:append('Haste_35')
elseif ( buffactive.march == 2 ) or -- two marches from ghorn
( (buffactive[33] or buffactive[604]) and buffactive.march == 1 ) or -- MG or haste + 1 march
( buffactive[580] ) or -- geo haste
( buffactive[33] and buffactive[604] ) then -- haste with MG
add_to_chat(8, '-------------Haste 30%-------------')
classes.CustomMeleeGroups:append('Haste_30')
elseif buffactive[33] or buffactive[604] or buffactive.march == 1 then
add_to_chat(8, '-------------Haste 15%-------------')
classes.CustomMeleeGroups:append('Haste_15')
end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
-- Default macro set/book
if player.sub_job == 'DNC' then
set_macro_page(2, 4)
elseif player.sub_job == 'WHM' then
set_macro_page(3, 4)
elseif player.sub_job == 'NIN' then
set_macro_page(10, 4)
elseif player.sub_job == 'THF' then
set_macro_page(4, 4)
elseif player.sub_job == 'BLM' then
set_macro_page(5, 4)
else
set_macro_page(1, 4)
end
end
サーバ: Asura
Game: FFXI
Posts: 115
By Asura.Pintseyes 2016-10-27 17:08:09
I just started playing SCH again and downloaded Kinematics lua and silverseans lue (Were basically the same lua) The issue is with both that elemental magic does not swap, no precast or midcast happens on anything over tier2. So mid tier and high tier dont swap at all. Anyone else had this problem or can maybe look over the lua and explain why showswaps doesnt show mid or high tier nukes swapping? Thanks for your time an effort.
Note: To attempt to fix the issue I added the same set to all the ele magic rules.
-------------------------------------------------------------------------------------------------------------------
-- 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()
-- Begin Kuvo code.
arts = {}
arts.Light = {}
arts.Light.Types = {'Divine Magic','Healing Magic','Enhancing Magic','Enfeebling Magic'}
arts.Dark = {}
arts.Dark.Types = {'Elemental Magic','Dark Magic','Enfeebling Magic'}
-- End Kuvo code.
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', 'Burst', 'Enfeebling')
state.IdleMode:options('Normal', 'PDT')
info.low_nukes = S{"Stone", "Water", "Aero", "Fire", "Blizzard", "Thunder"}
info.mid_nukes = S{"Stone II", "Water II", "Aero II", "Fire II", "Blizzard II", "Thunder II",
"Stone III", "Water III", "Aero III", "Fire III", "Blizzard III", "Thunder III",
"Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",}
info.high_nukes = S{"Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
send_command('bind ^` input /ma Stun <t>')
select_default_macro_book()
end
function user_unload()
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['Tabula Rasa'] = {legs="Pedagogy Pants +1"}
sets.precast.JA['Parsimony'] = {legs="Arbatel Pants +1"}
sets.precast.JA['Penury'] = {legs="Arbatel Pants +1"}
sets.precast.JA['Perpetuance'] = {hands="Arbatel Bracers +1"}
sets.precast.JA['Rapture'] = {head="Arbatel Bonnet +1"}
sets.precast.JA['Ebullience'] = {head="Arbatel Bonnet +1"}
-- Fast cast sets for spells
sets.precast.FC = {
main="Keranous",
sub="Niobid Strap",
ammo="Sapience Orb",
head={ name="Merlinic Hood", augments={'Mag. Acc.+15','"Fast Cast"+5','INT+4','"Mag.Atk.Bns."+8',}},
neck="Voltsurge Torque",
ear1="Moonshade Earring",
ear2="Loquacious Earring",
body={ name="Helios Jacket", augments={'"Mag.Atk.Bns."+24','"Fast Cast"+5','Magic burst mdg.+10%',}},
hands="Merlinic Dastanas",
back="Ogapepo Cape",
ring1="Adoulin Ring",
ring2="Prolix Ring",
waist="Witful Belt",
legs="Psycloth Lappas",
feet="Regal Pumps +1"}
sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {ear1="Barkarole earring"})
sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
sets.precast.FC['Healing Magic'] = set_combine(sets.precast.FC, {head="Vanya Hood",ear2="Mendicant's Earring",legs="Doyen pants",back="Pahtli Cape"})
sets.precast.FC['Stoneskin'] = set_combine(sets.precast.FC, {ear1="Mendicant's Earring",hands="Carapacho Cuffs",legs="Doyen pants",waist="Siegel Sash",back="Pahtli Cape"})
sets.precast.Klimaform = {feet="Arbatel Loafers +1"}
sets.precast.FC.Impact = {
ammo="Seraphic Ampulla",
head=empty,
body="Twilight Cloak",
legs="Jhakri Slops",
hands="Telchine Gloves",
neck="Asperity Necklace",
waist="Oneiros Rope",
ear1="Bladeborn Earring",
ear2="Steelflash Earring",
ring1="Hoard Ring",
ring2="Rajas Ring"}
sets.midcast.Cure = {
neck="Nodens Gorget",
body="Telchine Chas.",
hands="Revealer's Mitts",
legs="Telchine Braconi",
feet="Telchine Pigaches",
ring1="Stikini Ring",
ring2="Stikini Ring",
ear1="Roundel Earring",
back="Medala Cape"}
sets.midcast.CureWithLightWeather = {
neck="Nodens Gorget",
body="Telchine Chas.",
hands="Revealer's Mitts",
legs="Telchine Braconi",
waist="Hachirin-no-Obi",
feet="Telchine Pigaches",
ring1="Stikini Ring",
ring2="Stikini Ring",
ear1="Roundel Earring",
back="Medala Cape"}
sets.midcast.Curaga = sets.midcast.Cure
sets.midcast.Regen = set_combine(sets.midcast['Enhancing Magic'], {head="Arbatel Bonnet +1",body="Telchine Chas.",back="Bookworm's Cape"})
sets.midcast.Cursna = {
neck="Malison Medallion",
hands="Hieros Mittens",ring1="Ephedra Ring",
feet="Gendewitha Galoshes"}
sets.midcast['Enhancing Magic'] = {
head="Telchine Cap",
neck="Melic Torque",
body="Telchine Chas.",
waist="Siegel Sash",
hands="Telchine Gloves",
ring1="Stikini Ring",
ring2="Stikini Ring",
legs="Telchine Braconi",
feet="Telchine Pigaches"}
sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {neck="Nodens Gorget"})
sets.midcast.Shell = sets.midcast.Protect
sets.midcast.Protect = set_combine(sets.midcast['Enhancing Magic'],{ear1="Brachyura Earring",
ring1="Sheltered Ring"})
sets.midcast.Refresh = set_combine(sets.midcast['Enhancing Magic'],{back="Grapevine Cape"})
sets.midcast.Storm = set_combine(sets.midcast['Enhancing Magic'], {feet="Pedagogy Loafers +1"})
sets.midcast.Protectra = sets.midcast.Protect
sets.midcast.Shellra = sets.midcast.Shell
-- Custom spell classes
sets.midcast.MndEnfeebles = {ammo="Pemphredo Tathlum",
head="Befouled Crown",
body="Vanya Robe",
hands={ name="Hagondes Cuffs +1", augments={'Phys. dmg. taken -2%','Mag. Acc.+21',}},
legs="Psycloth Lappas",
feet="Jhakri Pigaches +1",
neck="Weike Torque",
back="Bookworm's Cape",
ring1="Stikini Ring",
ring2="Stikini Ring",
waist="Eschan Stone",
ear1="Barkaro. Earring",
ear2="Gwati Earring"}
sets.midcast.IntEnfeebles = {ammo="Pemphredo Tathlum",
head="Befouled Crown",
body="Vanya Robe",
hands={ name="Hagondes Cuffs +1", augments={'Phys. dmg. taken -2%','Mag. Acc.+21',}},
legs="Psycloth Lappas",
feet="Jhakri Pigaches +1",
neck="Weike Torque",
back="Bookworm's Cape",
ring1="Stikini Ring",
ring2="Stikini Ring",
waist="Channeler's Stone",
ear1="Barkaro. Earring",
ear2="Gwati Earring"}
sets.midcast['Dark Magic'] = {
ammo="Pemphredo Tathlum",
head="Pixie Hairpin +1",
body={ name="Helios Jacket", augments={'Mag. Acc.+23','"Drain" and "Aspir" potency +10','MP+50',}},
hands="Hagondes Cuffs +1",
legs="Merlinic Shalwar",
feet="Jhakri Pigaches +1",
neck="Deceiver's Torque",
waist="Channeler's Stone",
ear1="Barkaro. Earring",
ear2="Gwati Earring",
ring1="Stikini Ring",
ring2="Stikini Ring",
back="Bookworm's Cape"}
sets.midcast.Aspir = set_combine(sets.midcast['Dark Magic'],{legs={ name="Helios Spats", augments={'Mag. Acc.+25','"Drain" and "Aspir" potency +10','MP+24',}},feet="Merlinic Crackows",ring1="Evanescence Ring",waist="Fucho-no-Obi"})
sets.midcast.Drain = sets.midcast.Aspir
sets.midcast['Aspir III'] = sets.midcast.Aspir
sets.midcast.ElementalEnfeeble = {
ammo="Pemphredo Tathlum",
head={ name="Merlinic Hood", augments={'Mag. Acc.+25 "Mag.Atk.Bns."+25','"Occult Acumen"+5','INT+8','Mag. Acc.+15','"Mag.Atk.Bns."+6',}},
hands={ name="Amalric Gages", augments={'INT+10','Mag. Acc.+15','"Mag.Atk.Bns."+15',}},
legs={ name="Merlinic Shalwar", augments={'"Mag.Atk.Bns."+29','Magic burst mdg.+10%','INT+3','Mag. Acc.+15',}},
feet="Merlinic Crackows",
waist="Channeler's Stone",
ear2="Gwati Earring",
ear1="Barkaro. Earring",
ring1="Stikini Ring",
ring2="Stikini Ring",
back="Bookworm's Cape"}
sets.midcast.Kaustra = {main="Keranous",sub="Wizzan Grip",ammo="Witchstone",
head="Hagondes Hat",neck="Eddy Necklace",ear1="Hecate's Earring",ear2="Friomisi Earring",
body="Hagondes Coat",hands="Yaoyotl Gloves",ring1="Icesoul Ring",ring2="Strendu Ring",
back="Toro Cape",waist="Cognition Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}
sets.midcast.Stun = {main="Apamajas II",sub="Mephitis Grip",ammo="Incantor Stone",
head="Nahtirah Hat",neck="Aesir Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Vanir Cotehardie",hands="Gendewitha Gages",ring1="Prolix Ring",ring2="Sangoma Ring",
back="Refraction Cape",waist="Witful Belt",legs="Pedagogy Pants +1",feet="Academic's Loafers"}
-- Elemental Magic sets are default for handling low-tier nukes.
sets.midcast['Elemental Magic'] = {
ammo="Pemphredo Tathlum",
head={ name="Merlinic Hood", augments={'Mag. Acc.+25 "Mag.Atk.Bns."+25','"Occult Acumen"+5','INT+8','Mag. Acc.+15','"Mag.Atk.Bns."+6',}},
body="Hagondes Coat +1",
hands="Amalric Gages",
legs="Merlinic Shalwar",
feet="Merlinic Crackows",
ring2="Shiva Ring +1",
neck="Eddy Necklace",
waist="Refoccilation Stone",
ear2="Friomisi Earring",
back="Bookworm's Cape"}
sets.midcast['Elemental Magic'].Resistant = {ammo="Pemphredo Tathlum",
head={ name="Merlinic Hood", augments={'Mag. Acc.+25 "Mag.Atk.Bns."+25','"Occult Acumen"+5','INT+8','Mag. Acc.+15','"Mag.Atk.Bns."+6',}},
body="Hagondes Coat +1",
hands="Amalric Gages",
legs="Merlinic Shalwar",
feet="Merlinic Crackows",
ring2="Shiva Ring +1",
neck="Eddy Necklace",
waist="Refoccilation Stone",
ear2="Friomisi Earring",
back="Bookworm's Cape"}
sets.midcast['Elemental Magic'].HighTierNuke = {ammo="Pemphredo Tathlum",
head={ name="Merlinic Hood", augments={'Mag. Acc.+25 "Mag.Atk.Bns."+25','"Occult Acumen"+5','INT+8','Mag. Acc.+15','"Mag.Atk.Bns."+6',}},
body="Hagondes Coat +1",
hands="Amalric Gages",
legs="Merlinic Shalwar",
feet="Merlinic Crackows",
ring2="Shiva Ring +1",
neck="Eddy Necklace",
waist="Refoccilation Stone",
ear2="Friomisi Earring",
back="Bookworm's Cape"}
sets.midcast['Elemental Magic'].HighTierNuke.Resistant = {ammo="Pemphredo Tathlum",
head={ name="Merlinic Hood", augments={'Mag. Acc.+25 "Mag.Atk.Bns."+25','"Occult Acumen"+5','INT+8','Mag. Acc.+15','"Mag.Atk.Bns."+6',}},
body="Hagondes Coat +1",
hands="Amalric Gages",
legs="Merlinic Shalwar",
feet="Merlinic Crackows",
ring2="Shiva Ring +1",
neck="Eddy Necklace",
waist="Refoccilation Stone",
ear2="Friomisi Earring",
back="Bookworm's Cape"}
sets.midcast.Impact = {
ammo="Seraphic Ampulla",
head=empty,
body="Twilight Cloak",
legs="Jhakri Slops",
hands="Telchine Gloves",
neck="Asperity Necklace",
waist="Oneiros Rope",
ear1="Bladeborn Earring",
ear2="Steelflash Earring",
ring1="Hoard Ring",
ring2="Rajas Ring"}
sets.resting = {
head="Befouled Crown",
neck="Eidolon Pendant",
ear2="Relaxing Earring",
body="Hagondes Coat +1",
hands="Tethyan Cuffs +1",
legs="Nares Trews",
feet="Chelona Boots",
ring1="Angha Ring",
ring2="Shiva Ring +1",
back="Vita Cape",
waist="Fucho-no-obi"}
sets.idle = {
ammo="Pemphredo Tathlum",
neck="Weike Torque",
head="Befouled Crown",
ear1="Moonshade Earring",
ear2="Loquac. Earring",
body="Hagondes Coat +1",
hands="Amalric Gages",
ring1="Adoulin Ring",
ring2="Sangoma Ring",
waist="Shinjutsu-no-Obi",
legs="Tatsu. Sitagoromo",
feet="Herald's Gaiters",
back="Bookworm's Cape"}
sets.Obi = {waist="Hachirin-no-Obi",back='Twilight Cape',ring2='Zodiac Ring'}
sets.Kiting = {ammo="Staunch Tathlum",legs="Tatsu. Sitagoromo",feet="Herald's Gaiters"}
sets.latent_refresh = {head="Befouled Crown",body="Hagondes Coat +1",legs="Assid. Pants +1",waist="Fucho-no-obi"}
sets.Reive = {main="Homestead Staff"}
sets.magic_burst = {
head={ name="Merlinic Hood", augments={'"Mag.Atk.Bns."+27','Magic burst mdg.+10%','MND+4','Mag. Acc.+9',}},
neck="Mizukage-no-Kubikazari",ring1="Mujin Band"}
sets.engaged = {
ammo="Staunch Tathlum",
neck="Twilight Torque",
head="Hagondes Cap +1",
body="Jhakri Robe",
hands="Jhakri Cuffs +1",
legs="Jhakri Slops",
feet="Jhakri Pigaches +1",
ear1="Steelflash Earring",
ear2="Bladeborn Earring",
ring1="Gelatinous Ring +1",
back="Cheviot Cape",
ring2="Rajas Ring"}
-- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
sets.buff['Ebullience'] = {head="Arbatel Bonnet +1"}
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="Pedagogy Loafers +1"}
sets.buff['Alacrity'] = {feet="Pedagogy Loafers +1"}
sets.buff['Klimaform'] = {feet="Arbatel Loafers +1"}
sets.buff.FullSublimation = {head="Academic's Mortarboard +1",body="Pedagogy Gown +1",ear1="Savant's Earring"}
sets.buff.PDTSublimation = {head="Academic's Mortarboard +1",body="Pedagogy Gown +1",ear1="Savant's Earring"}
--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)
-- Begin Kuvo code.
if spell.action_type == 'Magic' then
local activeArt = getActiveArt()
-- Warn if magic type is not valid for active art.
if activeArt ~= 'None' and T(arts[activeArt].Types):contains(spell.skill) == false then
add_to_chat(8,'--------- Wrong Art Active ---------')
end
end
-- End Kuvo code.
if spell.action_type == 'Magic' then
apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
end
if spell.skill == 'Elemental Magic' and spell.element == world.day_element or spell.element == world.weather_element then
equip(sets.midcast['Elemental Magic'], sets.Obi)
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 == '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, 17)
end
-- Kuvo Code
function getActiveArt()
if buffactive['Light Arts'] or buffactive['Addendum: White'] then
return "Light"
elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
return "Dark"
else
return "None"
end
end
サーバ: Odin
Game: FFXI
Posts: 42
By Odin.Psycooo 2016-10-27 22:30:21
Ok, I am back with more questions....
I managed to add/define sets based of the amount of magical haste I have. So now if I have no haste it equips one set of gear, if I get haste 1 or haste 2 it equips based on value of haste all the way up to capped haste.
What I would like additionally is for it to auto equip the single wield gearset in the event I don't have a dual wield subjob, furthermore I would like a way to add in additional sets if I am using /dnc instead of my normal /nin, because the native DW traits are different I would need to add a whole bunch of rules and sets, the problem is I have NO FRIGGIN' IDEA how to do any of that. I literally stole all my haste defined rules from a thf lua and spent like 3 hours til I got it to work.
Edit: Ideally I would like to do this same thing for my terribly designed cor lua, that way I don't have to cycle through 14 sets
It most definitely does work. You just have all of the sets defined recursively, so debugmode doesn't show it swapping to the appropriate haste value. Eliminate the recursions and it works, I promise.
Here is the current version I can confirm works. 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()
determine_haste_group()
update_combat_form()
LowNukes = S{'Stone' , 'Aero' , 'Blizzard' , 'Fire' , 'Water' , 'Thunder' ,
'Stone II' , 'Aero II' , 'Blizzard II' , 'Fire II' , 'Water II' , 'Thunder II',
'Stonega' , 'Aeroga' , 'Blizzaga' , 'Firaga' , 'Waterga' , 'Thundaga',
'Stonega II' , 'Aeroga II' , 'Blizzaga II' , 'Firaga II' , 'Waterga II' , 'Thundaga II'}
MndEnfeebles = S{'Slow' , 'Silence' , 'Paralyze' , 'Addle' , 'Slow II' , 'Paralyze II' , 'Addle II'}
IntEnfeebles = S{'Bind' , 'Break' , 'Gravity' , 'Poison' , 'Sleep' , 'Gravity II' , 'Poison II' , 'Sleep II'}
state.Buff.Saboteur = buffactive.saboteur or false
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', 'Mid', 'Acc')
state.HybridMode:options('Normal', 'PDT', 'Evasion')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'PDT', 'MDT')
select_default_macro_book()
gear.CureStaff = {name=""}
gear.CureFeet = {name=""}
state.MagicBurst = M(false, 'Magic Burst')
state.CureHate = M(false, 'Cure Hate')
send_command('bind !` gs c toggle MagicBurst')
send_command('bind ^` gs c toggle CureHate')
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['Chainspell'] = {body="Vitivation Tabard +1"}
-- Waltz set (chr and vit)
sets.precast.Waltz = {}
-- Don't need any special gear for Healing Waltz.
sets.precast.Waltz['Healing Waltz'] = {}
-- Fast cast sets for spells
-- 80% Fast Cast (including trait) for all spells, plus 5% quick cast
-- No other FC sets necessary.
sets.precast.FC = {}
sets.precast.FC.Impact = set_combine(sets.precast.FC, {head=empty,body="Twilight Cloak"})
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {}
sets.precast.WS['Circle Blade'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Sanguine Blade'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Requiescat'] = {}
sets.precast.WS['Aeolian Edge'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Savage Blade'] = {}
sets.precast.WS['Chant du Cygne'] = {}
sets.precast.WS['True Strike'] = {}
sets.precast.WS['Exenterator'] = {}
sets.precast.WS['Evisceration'] = {}
sets.precast.WS['Death Blossom'] = {}
-- Midcast Sets
sets.midcast.Cure = {}
sets.midcast.Curaga = sets.midcast.Cure
sets.midcast.CureWeather = {}
sets.midcast.CureSelf = {}
sets.midcast.CureMelee = {}
sets.midcast['Enhancing Magic'] = {}
sets.midcast['Enhancing Magic'].Temper = {}
sets.midcast['Enhancing Magic'].RegenSelf = {}
sets.midcast['Enhancing Magic'].RefreshSelf = {}
sets.midcast['Enhancing Magic'].HasteSelf = {}
sets.midcast['Enhancing Magic'].EnSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.midcast['Enhancing Magic'].GainSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.midcast['Enhancing Magic'].BarSpells = set_combine(sets.midcast['Enhancing Magic'],{})
sets.buff.ComposureOther = {head="Lethargy Chappel +1",body="Lethargy Sayon +1",
legs="Lethargy Fuseau +1",feet="Lethargy Houseaux +1"}
sets.midcast.Protect = {}
sets.midcast.Shell = sets.midcast.Protect
sets.midcast['Enhancing Magic'].Phalanx = {}
sets.midcast.Cursna = {}
sets.midcast.Stoneskin = {}
sets.midcast['Enfeebling Magic'] = {}
sets.midcast.MndEnfeebles = {}
sets.midcast.IntEnfeebles = {}
sets.midcast.Blind = {}
sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
sets.midcast.Distract = {}
sets.midcast.Frazzle = {}
sets.midcast['Distract II'] = sets.midcast.Distract
sets.midcast['Distract III'] = sets.midcast.Distract
sets.midcast['Frazzle II'] = {}
sets.midcast['Frazzle III'] = sets.midcast.Frazzle
sets.midcast['Dia III'] = set_combine(sets.midcast['Enfeebling Magic'], {head="Vitivation Chapeau +1"})
sets.midcast['Slow II'] = set_combine(sets.midcast['Enfeebling Magic'], {head="Vitivation Chapeau +1"})
sets.Lunge = {}
sets.Convert = {main="Murgleis"}
sets.midcast['Elemental Magic'] ={}
sets.midcast['Elemental Magic']['Low'] = {}
sets.midcast.Impact = set_combine(sets.midcast['Elemental Magic'], {head=empty,body="Twilight Cloak"})
sets.midcast['Stun'] = {}
sets.midcast.Drain = {}
sets.midcast.Aspir = sets.midcast.Drain
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {}
-- Idle sets
sets.idle = {}
sets.idle.Town = {}
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.Mid = {}
sets.engaged.Acc = {}
sets.engaged.Evasion = sets.engaged
sets.engaged.Mid.Evasion = sets.engaged.Mid
sets.engaged.Acc.Evasion = sets.engaged.Acc
sets.engaged.PDT = sets.defense.PDT
sets.engaged.Mid.PDT = sets.defense.MDT
sets.engaged.Acc.PDT = sets.defense.PDT
-- Haste 43%
sets.engaged.Haste_43 = set_combine(sets.engaged, {})
sets.engaged.Mid.Haste_43 = sets.engaged.Mid
sets.engaged.Acc.Haste_43 = sets.engaged.Acc
sets.engaged.Evasion.Haste_43 = sets.engaged.Haste_43
sets.engaged.PDT.Haste_43 = sets.defense.PDT
-- 40
sets.engaged.Haste_40 = set_combine(sets.engaged.Haste_43, {})
sets.engaged.Mid.Haste_40 = sets.engaged.Mid
sets.engaged.Acc.Haste_40 = sets.engaged.Acc
sets.engaged.Evasion.Haste_40 = sets.engaged.Haste_40
sets.engaged.PDT.Haste_40 = sets.defense.PDT
-- 30
sets.engaged.Haste_30 = sets.engaged
sets.engaged.Mid.Haste_30 = sets.engaged.Mid
sets.engaged.Acc.Haste_30 = sets.engaged.Acc
sets.engaged.Evasion.Haste_30 = sets.engaged
sets.engaged.PDT.Haste_30 = sets.defense.PDT
-- 25
sets.engaged.Haste_25 = set_combine(sets.engaged.Haste_30, {})
sets.engaged.Acc.Haste_25 = sets.engaged.Acc
sets.engaged.Mid.Haste_25 = sets.engaged.Mid
sets.engaged.Evasion.Haste_25 = sets.engaged
sets.engaged.PDT.Haste_25 = sets.defense.PDT
-- DW nin sub melee group
sets.engaged.DW_nin = {}
sets.engaged.DW_nin.Mid = {}
sets.engaged.DW_nin.Acc = {}
sets.engaged.DW_nin.Evasion = sets.engaged.DW_nin
sets.engaged.DW_nin.Mid.Evasion = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Acc.Evasion = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.PDT = sets.defense.PDT
sets.engaged.DW_nin.Mid.PDT = sets.defense.MDT
sets.engaged.DW_nin.Acc.PDT = sets.defense.PDT
-- Haste 43%
sets.engaged.DW_nin.Haste_43 = set_combine(sets.engaged.DW_nin, {})
sets.engaged.DW_nin.Mid.Haste_43 = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Acc.Haste_43 = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.Evasion.Haste_43 = sets.engaged.DW_nin.Haste_43
sets.engaged.DW_nin.PDT.Haste_43 = sets.defense.PDT
-- 40
sets.engaged.DW_nin.Haste_40 = set_combine(sets.engaged.DW_nin.Haste_43, {})
sets.engaged.DW_nin.Mid.Haste_40 = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Acc.Haste_40 = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.Evasion.Haste_40 = sets.engaged.DW_nin.Haste_40
sets.engaged.DW_nin.PDT.Haste_40 = sets.defense.PDT
-- 30
sets.engaged.DW_nin.Haste_30 = {}
sets.engaged.DW_nin.Mid.Haste_30 = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Acc.Haste_30 = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.Evasion.Haste_30 = sets.engaged.DW_nin
sets.engaged.DW_nin.PDT.Haste_30 = sets.defense.PDT
-- 25
sets.engaged.DW_nin.Haste_25 = set_combine(sets.engaged.DW_nin.Haste_30, {})
sets.engaged.DW_nin.Acc.Haste_25 = sets.engaged.DW_nin.Acc
sets.engaged.DW_nin.Mid.Haste_25 = sets.engaged.DW_nin.Mid
sets.engaged.DW_nin.Evasion.Haste_25 = sets.engaged.DW_nin
sets.engaged.DW_nin.PDT.Haste_25 = sets.defense.PDT
-- DW dnc sub melee group
sets.engaged.DW_dnc = {}
sets.engaged.DW_dnc.Mid = {}
sets.engaged.DW_dnc.Acc = {}
sets.engaged.DW_dnc.Evasion = sets.engaged.DW_dnc
sets.engaged.DW_dnc.Mid.Evasion = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Acc.Evasion = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.PDT = sets.defense.PDT
sets.engaged.DW_dnc.Mid.PDT = sets.defense.MDT
sets.engaged.DW_dnc.Acc.PDT = sets.defense.PDT
-- Haste 43%
sets.engaged.DW_dnc.Haste_43 = set_combine(sets.engaged.DW_dnc, {})
sets.engaged.DW_dnc.Mid.Haste_43 = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Acc.Haste_43 = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.Evasion.Haste_43 = sets.engaged.DW_dnc.Haste_43
sets.engaged.DW_dnc.PDT.Haste_43 = sets.defense.PDT
-- 40
sets.engaged.DW_dnc.Haste_40 = set_combine(sets.engaged.DW_dnc.Haste_43, {})
sets.engaged.DW_dnc.Mid.Haste_40 = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Acc.Haste_40 = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.Evasion.Haste_40 = sets.engaged.DW_dnc.Haste_40
sets.engaged.DW_dnc.PDT.Haste_40 = sets.defense.PDT
-- 30
sets.engaged.DW_dnc.Haste_30 = sets.engaged.DW_dnc
sets.engaged.DW_dnc.Mid.Haste_30 = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Acc.Haste_30 = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.Evasion.Haste_30 = sets.engaged.DW_dnc
sets.engaged.DW_dnc.PDT.Haste_30 = sets.defense.PDT
-- 25
sets.engaged.DW_dnc.Haste_25 = set_combine(sets.engaged.DW_dnc.Haste_30, {})
sets.engaged.DW_dnc.Acc.Haste_25 = sets.engaged.DW_dnc.Acc
sets.engaged.DW_dnc.Mid.Haste_25 = sets.engaged.DW_dnc.Mid
sets.engaged.DW_dnc.Evasion.Haste_25 = sets.engaged.DW_dnc
sets.engaged.DW_dnc.PDT.Haste_25 = sets.defense.PDT
sets.magic_burst = {}
sets.cure_hate = {}
sets.Enmity = {}
-- Sets for special buff conditions on spells.
sets.buff.Saboteur = {hands="Lethargy Gantherots +1"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
function job_precast(spell, action, spellMap, eventArgs)
if spell.skill == 'Healing Magic' and spellMap ~= 'StatusRemoval' then
gear.CureFeet.name = "Vanya Clogs"
if player.status == 'Engaged' then
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
if spell.target.type == 'SELF' then
gear.CureFeet.name = "Medium's Sabots"
else
gear.CureFeet.name = "Vanya Clogs"
end
else
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
end
if spell.target.type == 'SELF' then
gear.default.obi_waist = "Chuq'aba Belt"
else
gear.default.obi_waist = "Salire belt"
end
if world.weather_element == 'Light' then
gear.CureStaff.name = "Chatoyant Staff"
else
gear.CureStaff.name = "Serenity"
end
else
gear.default.obi_waist = "Salire belt"
gear.default.obi_back = { name="Sucellos's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','Mag. Acc.+10','"Cure" potency +10%',}}
end
if spell.name == 'Lunge' or spell.name == 'Swipe' then
equip(sets.Lunge)
end
if spell.name == 'Vallation' then
equip(sets.Enmity)
end
if spell.name == 'Pflug' then
equip(sets.Enmity)
end
if spell.name == 'Warcry'
or spell.name == 'Swordplay' or spell.name == 'Rayke' or spell.name == 'Meditate' or spell.name == 'Provoke' then
equip(sets.Enmity)
end
--prevents casting Utsusemi if you already have 3 or more shadows
if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) then
cancel_spell()
end
if buffactive['terror'] or buffactive['petrification'] or buffactive['stun'] or buffactive['sleep'] then
if TP_ind == 4 then
equip(sets.defense.MDT) else
equip(sets.defense.PDT)
end
end
if spell.name == 'Convert' then
equip(sets.Convert)
end
if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
cancel_spell()
send_command('input /item "Echo Drops" <me>')
end
end
-- Run after the default midcast() is done.
-- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.skill == 'Enfeebling Magic' and state.Buff.Saboteur then
equip(sets.buff.Saboteur)
elseif spell.skill == 'Enhancing Magic' and not spell.english == 'Stoneskin' then
equip(sets.midcast.EnhancingDuration)
if buffactive.composure and spell.target.type == 'PLAYER' then
equip(sets.buff.ComposureOther)
end
elseif spellMap == 'Cure' then
if spell.target.type == 'SELF' then
equip(sets.midcast.CureSelf)
end
if state.CureHate.value then
equip(sets.cure_hate)
end
if world.weather_element == 'Light' then
equip(sets.midcast.CureWeather)
end
elseif spell.skill == 'Elemental Magic' then
if state.MagicBurst.value then
equip(sets.magic_burst)
end
if spell.element == world.day_element or spell.element == world.weather_element then
equip({waist="Hachirin-no-Obi"})
end
elseif spell.skill == "Ninjutsu" then
equip(sets.midcast.Recast)
if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' then
if buffactive['Copy Image'] then
windower.ffxi.cancel_buff(66)
elseif buffactive['Copy Image (2)'] then
windower.ffxi.cancel_buff(444)
elseif buffactive['Copy Image (3)'] then
windower.ffxi.cancel_buff(445)
elseif buffactive['Copy Image (4+)'] then
windower.ffxi.cancel_buff(446)
end
elseif spell.name == 'Monomi: Ichi' and buffactive.Sneak and spell.target.type == 'SELF' then
windower.ffxi.cancel_buff(71)
end
end
if spell.name == 'Foil' or spell.name == 'Flash' or spell.name == 'Blank Gaze'
or spell.name == 'Geist Wall' or spell.name == 'Poison Breath' or spell.name == 'Jettatura'
or spell.name == 'Cocoon' or spell.name == 'Soporific' or spell.name == 'Sheep Song'
or spell.name == 'Refueling' then
equip(sets.Enmity)
end
end
function job_get_spell_map(spell, default_spell_map)
if spell.action_type == 'Magic' then
if spell.skill == 'Enhancing Magic' then
if spell.english:startswith('En') then
return 'EnSpells'
elseif spell.english:startswith('Gain') then
return 'GainSpells'
elseif spell.english:startswith('Phalanx') then
return 'Phalanx'
elseif spell.english:startswith('Bar') then
return 'Bar'
elseif spell.english:startswith('Temper') then
return 'Temper'
elseif spell.english:startswith('Haste') then
if spell.target.type == 'SELF' then
return 'HasteSelf'
end
elseif spell.english:startswith('Refresh') then
if spell.target.type == 'SELF' then
return 'RefreshSelf'
end
end
elseif default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
if player.status == 'Engaged' then
return "CureMelee"
end
end
if spell.action_type == 'Magic' then
if spell.skill == 'Enfeebling Magic' then
if spell.type == 'WhiteMagic' then
return 'MndEnfeebles'
else
return 'IntEnfeebles'
end
elseif spell.skill == 'Elemental Magic' then
if LowNukes:contains(spell.name) then
return 'Low'
else
return
end
end
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
determine_haste_group()
handle_equipping_gear(player.status)
end
-------------------------------------------------------------------------------------------------------------------
-- General hooks for change 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 we gain or lose any haste buffs, adjust which gear set we target.
if S{'haste','march', 'madrigal','embrava','haste samba','mighty guard'}:contains(buff:lower()) then
determine_haste_group()
handle_equipping_gear(player.status)
end
if state.Buff[buff] ~= nil then
state.Buff[buff] = gain
-- if not midaction() then
handle_equipping_gear(player.status)
-- end
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- 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 customize_melee_set(meleeSet)
-- if player.sub_job == 'DNC' or player.sub_job == 'NIN' then
-- meleeSet = set_combine(meleeSet, sets.engaged.DW)
-- end
-- return meleeSet
-- end
function update_combat_form()
-- Check for H2H or single-wielding
if player.equipment.sub == 'empty' then
state.CombatForm:reset()
end
if S{'Culminus','Genmei Shield'}:contains(player.equipment.sub) then
state.CombatForm:reset()
elseif player.sub_job == 'NIN' then
state.CombatForm:set('DW_nin')
elseif player.sub_job == 'DNC' then
state.CombatForm:set('DW_dnc')
end
end
function job_update(cmdParams, eventArgs)
update_combat_form()
determine_haste_group()
end
-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
display_current_caster_state()
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function determine_haste_group()
classes.CustomMeleeGroups:clear()
-- assuming +4 for marches (ghorn has +5)
-- Haste (white magic) 15%
-- Haste Samba (Sub) 5%
-- Haste (Merited DNC) 10% (never account for this)
-- Victory March +0/+3/+4/+5 9.4/14%/15.6%/17.1% +0
-- Advancing March +0/+3/+4/+5 6.3/10.9%/12.5%/14% +0
-- Embrava 30% with 500 enhancing skill
-- Mighty Guard - 15%
-- buffactive[580] = geo haste
-- buffactive[33] = regular haste
-- buffactive[604] = mighty guard
-- state.HasteMode = toggle for when you know Haste II is being cast on you
-- Hi = Haste II is being cast. This is clunky to use when both haste II and haste I are being cast
if ( ( (buffactive[33] or buffactive[580] or buffactive.embrava) and (buffactive.march or buffactive[604]) ) or
( buffactive[33] and (buffactive[580] or buffactive.embrava) ) or
( buffactive.march == 2 and buffactive[604] ) ) then
add_to_chat(8, '-------------Haste 43%-------------')
classes.CustomMeleeGroups:append('Haste_43')
elseif buffactive.embrava and buffactive.haste then
add_to_chat(8, '-------------Haste 40%-------------')
classes.CustomMeleeGroups:append('Haste_40')
elseif ( (buffactive[33] or buffactive.march == 2 or buffactive[580]) and buffactive['haste samba'] ) then
add_to_chat(8, '-------------Haste 35%-------------')
classes.CustomMeleeGroups:append('Haste_35')
elseif ( ( buffactive[580] or buffactive[33] or buffactive.march == 2 ) or
( buffactive.march == 1 and buffactive[604] ) ) then
add_to_chat(8, '-------------Haste 30%-------------')
classes.CustomMeleeGroups:append('Haste_30')
elseif ( buffactive.march == 1 or buffactive[604] ) then
add_to_chat(8, '-------------Haste 15%-------------')
classes.CustomMeleeGroups:append('Haste_15')
elseif ( buffactive[580] and ( buffactive.march or buffactive[33] or buffactive.embrava or buffactive[604]) ) or -- geo haste + anything
( buffactive.embrava and (buffactive.march or buffactive[33] or buffactive[604]) ) or -- embrava + anything
( buffactive.march == 2 and (buffactive[33] or buffactive[604]) ) or -- two marches + anything
( buffactive[33] and buffactive[604] and buffactive.march ) then -- haste + mighty guard + any marches
add_to_chat(8, '-------------Max Haste Mode Enabled--------------')
classes.CustomMeleeGroups:append('Haste_43')
elseif ( (buffactive[604] or buffactive[33]) and buffactive['haste samba'] and buffactive.march == 1) or -- MG or haste + samba with 1 march
( buffactive.march == 2 and buffactive['haste samba'] ) or
( buffactive[580] and buffactive['haste samba'] ) then
add_to_chat(8, '-------------Haste 35%-------------')
classes.CustomMeleeGroups:append('Haste_35')
elseif ( buffactive.march == 2 ) or -- two marches from ghorn
( (buffactive[33] or buffactive[604]) and buffactive.march == 1 ) or -- MG or haste + 1 march
( buffactive[580] ) or -- geo haste
( buffactive[33] and buffactive[604] ) then -- haste with MG
add_to_chat(8, '-------------Haste 30%-------------')
classes.CustomMeleeGroups:append('Haste_30')
elseif buffactive[33] or buffactive[604] or buffactive.march == 1 then
add_to_chat(8, '-------------Haste 15%-------------')
classes.CustomMeleeGroups:append('Haste_15')
end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
-- Default macro set/book
if player.sub_job == 'DNC' then
set_macro_page(2, 4)
elseif player.sub_job == 'WHM' then
set_macro_page(3, 4)
elseif player.sub_job == 'NIN' then
set_macro_page(10, 4)
elseif player.sub_job == 'THF' then
set_macro_page(4, 4)
elseif player.sub_job == 'BLM' then
set_macro_page(5, 4)
else
set_macro_page(1, 4)
end
end
Plugged in all the gear, engaged cast haste 1 received the "----haste 30%----" did not change gear. Cast haste 2 did not receive a new message mentioning haste, did not change gear.
Also not 100% certain on what you mean about sets being defined recursively nor what recursions to eliminate.
Odin.Lygre
サーバ: Odin
Game: FFXI
Posts: 89
By Odin.Lygre 2016-10-27 23:11:48
There is no way for gearswap to differentiate between Haste and Haste II on its own that I'm aware of. I tested haste, marches, MG, geomancy haste and it was all gucci. To deal with this, on jobs that can provide themselves with Haste II, I design the function under the assumption that buffactive[33] being true equates to 30% magical haste. For jobs this isn't true for, I have a state variable I switch between which determines if the function's logic treats Haste as 15% or 30%
Code -- Haste 43%
Ln 273: sets.engaged.DW_nin.Haste_43 = set_combine(sets.engaged.DW_nin, {})
Until I added in a piece of gear instead of an empty set, debugmode wouldn't identify it actually changing to this set, since I guess it's technically the same set or something. As soon as I added one piece inside the brackets it immediately began showing the changes as expected.
By Nyruul 2016-10-28 20:11:49
I'm having a problem where Ioskeha belt will not swap in to my TP set. I've tried adding it to other sets and used showswaps and it certainly does not get swapped in (yes i spelled it correctly.) Anyone know the reason why this belt is not registering?
By Dyrandal 2016-10-28 21:44:34
Quote: I'm having a problem where Ioskeha belt will not swap in to my TP set. I've tried adding it to other sets and used showswaps and it certainly does not get swapped in (yes i spelled it correctly.) Anyone know the reason why this belt is not registering?
Just to make sure, you used the export function of gearswap, right?
By Ineeedmoney 2016-10-29 03:35:01
Trying to Figure out what I am doing wrong here with my Precast for Cor it wont flash in my Beaters mantle then flash back to normal range Acc
And I know it is something I am doing wrong it is my third GS that I have tried to work with Code --[[
gs c toggle LuzafRing -- Toggles use of Luzaf Ring on and off
Offense mode is melee or ranged. Used ranged offense mode if you are engaged
for ranged weaponskills, but not actually meleeing.
Weaponskill mode, if set to 'Normal', is handled separately for melee and ranged weaponskills.
--]]
-- 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()
-- Whether to use Luzaf's Ring
state.LuzafRing = M(false, "Luzaf's Ring")
-- Whether a warning has been given for low ammo
state.warned = M(false)
define_roll_values()
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('Ranged', 'Melee', 'Acc')
state.RangedMode:options('Normal', 'Acc')
state.WeaponskillMode:options('Normal', 'Acc', 'Att', 'Mod')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'PDT', 'Refresh')
gear.RAbullet = "Bullet"
gear.WSbullet = "Bullet"
gear.MAbullet = "Bullet"
gear.QDbullet = "Bullet"
options.ammo_warning_limit = 15
-- Additional local binds
send_command('bind ^` input /ja "Double-up" <me>')
send_command('bind !` input /ja "Bolter\'s Roll" <me>')
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['Triple Shot'] = {body="Navarch's Frac +2"}
sets.precast.JA['Snake Eye'] = {legs="Lanun Culottes"}
sets.precast.JA['Wild Card'] = {feet="Lanun Bottes"}
sets.precast.JA['Random Deal'] = {body="Lanun Frac"}
sets.precast.CorsairRoll = {head="Lanun Tricorne",hands="Navarch's Gants +2"}
sets.precast.CorsairRoll["Caster's Roll"] = set_combine(sets.precast.CorsairRoll, {legs="Navarch's Culottes +2"})
sets.precast.CorsairRoll["Courser's Roll"] = set_combine(sets.precast.CorsairRoll, {feet="Navarch's Bottes +2"})
sets.precast.CorsairRoll["Blitzer's Roll"] = set_combine(sets.precast.CorsairRoll, {head="Navarch's Tricorne +2"})
sets.precast.CorsairRoll["Tactician's Roll"] = set_combine(sets.precast.CorsairRoll, {body="Navarch's Frac +2"})
sets.precast.CorsairRoll["Allies' Roll"] = set_combine(sets.precast.CorsairRoll, {hands="Navarch's Gants +2"})
sets.precast.LuzafRing = {ring2="Luzaf's Ring"}
sets.precast.FoldDoubleBust = {hands="Lanun Gants"}
sets.precast.CorsairShot = {head="Blood Mask"}
-- Waltz set (chr and vit)
sets.precast.Waltz = {
head="Whirlpool Mask",
body="Iuitl Vest",hands="Iuitl Wristbands",
legs="Nahtirah Trousers",feet="Iuitl Gaiters +1"}
-- Don't need any special gear for Healing Waltz.
sets.precast.Waltz['Healing Waltz'] = {}
-- Fast cast sets for spells
sets.precast.FC = {head="Haruspex Hat",ear2="Loquacious Earring",hands="Thaumas Gloves",ring1="Prolix Ring"}
sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {neck="Magoraga Beads"})
sets.precast.RA = {ammo=gear.RAbullet,
head="",
body="",hands="",
back="Beater's Mantle",waist="",legs="",feet=""}
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {
main="Archer's Knife",
sub="Beater's Aspis",
range="Mars's Hexagun +1",
head="Mrc.Cpt. Headgear",
body="Noct Doublet +1",
hands="Gigas Bracelets",
legs="Republic Subligar",
feet="Mtt. Leggings +1",
neck="Spike Necklace",
waist="Gun Belt",
left_ear="Cassie Earring",
right_ear="Beater's Earring",
left_ring="Courage Ring +1",
right_ring="Courage Ring +1",
back="Nomad's Mantle +1",}
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS['Evisceration'] = sets.precast.WS
sets.precast.WS['Exenterator'] = set_combine(sets.precast.WS, {legs="Nahtirah Trousers"})
sets.precast.WS['Requiescat'] = set_combine(sets.precast.WS, {legs="Nahtirah Trousers"})
sets.precast.WS['Last Stand'] = {ammo=gear.WSbullet,
head="Whirlpool Mask",neck=gear.ElementalGorget,ear1="Clearview Earring",ear2="Moonshade Earring",
body="Laksamana's Frac",hands="Iuitl Wristbands",ring1="Rajas Ring",ring2="Stormsoul Ring",
back="Terebellum Mantle",waist=gear.ElementalBelt,legs="Nahtirah Trousers",feet="Iuitl Gaiters +1"}
sets.precast.WS['Last Stand'].Acc = {ammo=gear.WSbullet,
head="Laksamana's Hat",neck=gear.ElementalGorget,ear1="Clearview Earring",ear2="Moonshade Earring",
body="Laksamana's Frac",hands="Buremte Gloves",ring1="Hajduk Ring",ring2="Stormsoul Ring",
back="Libeccio Mantle",waist=gear.ElementalBelt,legs="Thurandaut Tights +1",feet="Laksamana's Bottes"}
sets.precast.WS['Wildfire'] = {ammo=gear.MAbullet,
head="Wayfarer Circlet",neck="Stoicheion Medal",ear1="Friomisi Earring",ear2="Hecate's Earring",
body="Manibozho Jerkin",hands="Iuitl Wristbands",ring1="Stormsoul Ring",ring2="Demon's Ring",
back="Toro Cape",waist=gear.ElementalBelt,legs="Iuitl Tights",feet="Iuitl Gaiters +1"}
sets.precast.WS['Wildfire'].Brew = {ammo=gear.MAbullet,
head="Wayfarer Circlet",neck="Stoicheion Medal",ear1="Friomisi Earring",ear2="Hecate's Earring",
body="Manibozho Jerkin",hands="Iuitl Wristbands",ring1="Stormsoul Ring",ring2="Demon's Ring",
back="Toro Cape",waist=gear.ElementalBelt,legs="Iuitl Tights",feet="Iuitl Gaiters +1"}
sets.precast.WS['Leaden Salute'] = sets.precast.WS['Wildfire']
-- Midcast Sets
sets.midcast.FastRecast = {
head="Whirlpool Mask",
body="Iuitl Vest",hands="Iuitl Wristbands",
legs="Manibozho Brais",feet="Iuitl Gaiters +1"}
-- Specific spells
sets.midcast.Utsusemi = sets.midcast.FastRecast
sets.midcast.CorsairShot = {ammo=gear.QDbullet,
head="Blood Mask",neck="Stoicheion Medal",ear1="Friomisi Earring",ear2="Hecate's Earring",
body="Lanun Frac",hands="Schutzen Mittens",ring1="Hajduk Ring",ring2="Demon's Ring",
back="Toro Cape",waist="Aquiline Belt",legs="Iuitl Tights",feet="Lanun Bottes"}
sets.midcast.CorsairShot.Acc = {ammo=gear.QDbullet,
head="Laksamana's Hat",neck="Stoicheion Medal",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Lanun Frac",hands="Schutzen Mittens",ring1="Stormsoul Ring",ring2="Sangoma Ring",
back="Navarch's Mantle",waist="Aquiline Belt",legs="Iuitl Tights",feet="Iuitl Gaiters +1"}
sets.midcast.CorsairShot['Light Shot'] = {ammo=gear.QDbullet,
head="Laksamana's Hat",neck="Stoicheion Medal",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Lanun Frac",hands="Schutzen Mittens",ring1="Stormsoul Ring",ring2="Sangoma Ring",
back="Navarch's Mantle",waist="Aquiline Belt",legs="Iuitl Tights",feet="Iuitl Gaiters +1"}
sets.midcast.CorsairShot['Dark Shot'] = sets.midcast.CorsairShot['Light Shot']
-- Ranged gear
sets.midcast.RA = {ammo=gear.RAbullet,
main="Archer's Knife",
sub="Beater's Aspis",
range="Mars's Hexagun +1",
head="Empress Hairpin",
body="Noct Doublet +1",
hands="Noct Gloves +1",
legs="Noct Brais +1",
feet="Winged Boots +1",
neck="Feather Collar +1",
waist="Gun Belt",
left_ear="Cassie Earring",
right_ear="Beater's Earring",
left_ring="Bowyer Ring",
right_ring="Beetle Ring +1",
back="Nomad's Mantle +1",}
sets.midcast.RA.Acc = {ammo=gear.RAbullet,
main="Archer's Knife",
sub="Beater's Aspis",
range="Mars's Hexagun +1",
head="Empress Hairpin",
body="Noct Doublet +1",
hands="Noct Gloves +1",
legs="Noct Brais +1",
feet="Winged Boots +1",
neck="Feather Collar +1",
waist="Gun Belt",
left_ear="Cassie Earring",
right_ear="Beater's Earring",
left_ring="Bowyer Ring",
right_ring="Beetle Ring +1",
back="Nomad's Mantle +1",}
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {neck="Wiglen Gorget",ring1="Sheltered Ring",ring2="Paguroidea Ring"}
-- Idle sets
sets.idle = {ammo=gear.RAbullet,
head="Whirlpool Mask",neck="Wiglen Gorget",ear1="Clearview Earring",ear2="Volley Earring",
body="Iuitl Vest",hands="Iuitl Wristbands",ring1="Sheltered Ring",ring2="Paguroidea Ring",
back="Shadow Mantle",waist="Flume Belt",legs="Nahtirah Trousers",feet="Skadi's Jambeaux +1"}
sets.idle.Town = {main="Surcouf's Jambiya",range="Eminent Gun",ammo=gear.RAbullet,
head="Laksamana's Hat",neck="Wiglen Gorget",ear1="Clearview Earring",ear2="Volley Earring",
body="Laksamana's Frac",hands="Iuitl Wristbands",ring1="Sheltered Ring",ring2="Paguroidea Ring",
back="Shadow Mantle",waist="Flume Belt",legs="Nahtirah Trousers",feet="Skadi's Jambeaux +1"}
-- Defense sets
sets.defense.PDT = {
head="Whirlpool Mask",neck="Twilight Torque",ear1="Clearview Earring",ear2="Volley Earring",
body="Iuitl Vest",hands="Iuitl Wristbands",ring1="Defending Ring",ring2=gear.DarkRing.physical,
back="Shadow Mantle",waist="Flume Belt",legs="Nahtirah Trousers",feet="Iuitl Gaiters +1"}
sets.defense.MDT = {
head="Whirlpool Mask",neck="Twilight Torque",ear1="Clearview Earring",ear2="Volley Earring",
body="Iuitl Vest",hands="Iuitl Wristbands",ring1="Defending Ring",ring2="Shadow Ring",
back="Engulfer Cape",waist="Flume Belt",legs="Nahtirah Trousers",feet="Iuitl Gaiters +1"}
sets.Kiting = {feet="Skadi's Jambeaux +1"}
-- Engaged sets
-- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
-- sets if more refined versions aren't defined.
-- If you create a set with both offense and defense modes, the offense mode should be first.
-- EG: sets.engaged.Dagger.Accuracy.Evasion
-- Normal melee group
sets.engaged.Melee = {ammo=gear.RAbullet,
head="Whirlpool Mask",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Iuitl Vest",hands="Iuitl Wristbands",ring1="Rajas Ring",ring2="Epona's Ring",
back="Atheling Mantle",waist="Windbuffet Belt",legs="Manibozho Brais",feet="Iuitl Gaiters +1"}
sets.engaged.Acc = {ammo=gear.RAbullet,
head="Whirlpool Mask",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Iuitl Vest",hands="Iuitl Wristbands",ring1="Rajas Ring",ring2="Epona's Ring",
back="Atheling Mantle",waist="Hurch'lan Sash",legs="Manibozho Brais",feet="Iuitl Gaiters +1"}
sets.engaged.Melee.DW = {ammo=gear.RAbullet,
head="Whirlpool Mask",neck="Asperity Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
body="Iuitl Vest",hands="Iuitl Wristbands",ring1="Rajas Ring",ring2="Epona's Ring",
back="Atheling Mantle",waist="Windbuffet Belt",legs="Manibozho Brais",feet="Iuitl Gaiters +1"}
sets.engaged.Acc.DW = {ammo=gear.RAbullet,
head="Whirlpool Mask",neck="Asperity Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
body="Iuitl Vest",hands="Iuitl Wristbands",ring1="Rajas Ring",ring2="Epona's Ring",
back="Atheling Mantle",waist="Hurch'lan Sash",legs="Manibozho Brais",feet="Iuitl Gaiters +1"}
sets.engaged.Ranged = {ammo=gear.RAbullet,
head="Whirlpool Mask",neck="Twilight Torque",ear1="Clearview Earring",ear2="Volley Earring",
body="Iuitl Vest",hands="Iuitl Wristbands",ring1="Defending Ring",ring2=gear.DarkRing.physical,
back="Shadow Mantle",waist="Flume Belt",legs="Nahtirah Trousers",feet="Iuitl Gaiters +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)
-- Check that proper ammo is available if we're using ranged attacks or similar.
if spell.action_type == 'Ranged Attack' or spell.type == 'WeaponSkill' or spell.type == 'CorsairShot' then
do_bullet_checks(spell, spellMap, eventArgs)
end
-- gear sets
if (spell.type == 'CorsairRoll' or spell.english == "Double-Up") and state.LuzafRing.value then
equip(sets.precast.LuzafRing)
elseif spell.type == 'CorsairShot' and state.CastingMode.value == 'Resistant' then
classes.CustomClass = 'Acc'
elseif spell.english == 'Fold' and buffactive['Bust'] == 2 then
if sets.precast.FoldDoubleBust then
equip(sets.precast.FoldDoubleBust)
eventArgs.handled = true
end
end
end
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
function job_aftercast(spell, action, spellMap, eventArgs)
if spell.type == 'CorsairRoll' and not spell.interrupted then
display_roll_info(spell)
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- Return a customized weaponskill mode to use for weaponskill sets.
-- Don't return anything if you're not overriding the default value.
function get_custom_wsmode(spell, spellMap, default_wsmode)
if buffactive['Transcendancy'] then
return 'Brew'
end
end
-- Called by the 'update' self-command, for common needs.
-- Set eventArgs.handled to true if we don't want automatic equipping of gear.
function job_update(cmdParams, eventArgs)
if newStatus == 'Engaged' and player.equipment.main == 'Chatoyant Staff' then
state.OffenseMode:set('Ranged')
end
end
-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
local msg = ''
msg = msg .. 'Off.: '..state.OffenseMode.current
msg = msg .. ', Rng.: '..state.RangedMode.current
msg = msg .. ', WS.: '..state.WeaponskillMode.current
msg = msg .. ', QD.: '..state.CastingMode.current
if state.DefenseMode.value ~= 'None' then
local defMode = state[state.DefenseMode.value ..'DefenseMode'].current
msg = msg .. ', Defense: '..state.DefenseMode.value..' '..defMode
end
if state.Kiting.value then
msg = msg .. ', Kiting'
end
if state.PCTargetMode.value ~= 'default' then
msg = msg .. ', Target PC: '..state.PCTargetMode.value
end
if state.SelectNPCTargets.value then
msg = msg .. ', Target NPCs'
end
msg = msg .. ', Roll Size: ' .. ((state.LuzafRing.value and 'Large') or 'Small')
add_to_chat(122, msg)
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function define_roll_values()
rolls = {
["Corsair's Roll"] = {lucky=5, unlucky=9, bonus="Experience Points"},
["Ninja Roll"] = {lucky=4, unlucky=8, bonus="Evasion"},
["Hunter's Roll"] = {lucky=4, unlucky=8, bonus="Accuracy"},
["Chaos Roll"] = {lucky=4, unlucky=8, bonus="Attack"},
["Magus's Roll"] = {lucky=2, unlucky=6, bonus="Magic Defense"},
["Healer's Roll"] = {lucky=3, unlucky=7, bonus="Cure Potency Received"},
["Puppet Roll"] = {lucky=4, unlucky=8, bonus="Pet Magic Accuracy/Attack"},
["Choral Roll"] = {lucky=2, unlucky=6, bonus="Spell Interruption Rate"},
["Monk's Roll"] = {lucky=3, unlucky=7, bonus="Subtle Blow"},
["Beast Roll"] = {lucky=4, unlucky=8, bonus="Pet Attack"},
["Samurai Roll"] = {lucky=2, unlucky=6, bonus="Store TP"},
["Evoker's Roll"] = {lucky=5, unlucky=9, bonus="Refresh"},
["Rogue's Roll"] = {lucky=5, unlucky=9, bonus="Critical Hit Rate"},
["Warlock's Roll"] = {lucky=4, unlucky=8, bonus="Magic Accuracy"},
["Fighter's Roll"] = {lucky=5, unlucky=9, bonus="Double Attack Rate"},
["Drachen Roll"] = {lucky=3, unlucky=7, bonus="Pet Accuracy"},
["Gallant's Roll"] = {lucky=3, unlucky=7, bonus="Defense"},
["Wizard's Roll"] = {lucky=5, unlucky=9, bonus="Magic Attack"},
["Dancer's Roll"] = {lucky=3, unlucky=7, bonus="Regen"},
["Scholar's Roll"] = {lucky=2, unlucky=6, bonus="Conserve MP"},
["Bolter's Roll"] = {lucky=3, unlucky=9, bonus="Movement Speed"},
["Caster's Roll"] = {lucky=2, unlucky=7, bonus="Fast Cast"},
["Courser's Roll"] = {lucky=3, unlucky=9, bonus="Snapshot"},
["Blitzer's Roll"] = {lucky=4, unlucky=9, bonus="Attack Delay"},
["Tactician's Roll"] = {lucky=5, unlucky=8, bonus="Regain"},
["Allies's Roll"] = {lucky=3, unlucky=10, bonus="Skillchain Damage"},
["Miser's Roll"] = {lucky=5, unlucky=7, bonus="Save TP"},
["Companion's Roll"] = {lucky=2, unlucky=10, bonus="Pet Regain and Regen"},
["Avenger's Roll"] = {lucky=4, unlucky=8, bonus="Counter Rate"},
}
end
function display_roll_info(spell)
rollinfo = rolls[spell.english]
local rollsize = (state.LuzafRing.value and 'Large') or 'Small'
if rollinfo then
add_to_chat(104, spell.english..' provides a bonus to '..rollinfo.bonus..'. Roll size: '..rollsize)
add_to_chat(104, 'Lucky roll is '..tostring(rollinfo.lucky)..', Unlucky roll is '..tostring(rollinfo.unlucky)..'.')
end
end
-- Determine whether we have sufficient ammo for the action being attempted.
function do_bullet_checks(spell, spellMap, eventArgs)
local bullet_name
local bullet_min_count = 1
if spell.type == 'WeaponSkill' then
if spell.skill == "Marksmanship" then
if spell.element == 'None' then
-- physical weaponskills
bullet_name = gear.WSbullet
else
-- magical weaponskills
bullet_name = gear.MAbullet
end
else
-- Ignore non-ranged weaponskills
return
end
elseif spell.type == 'CorsairShot' then
bullet_name = gear.QDbullet
elseif spell.action_type == 'Ranged Attack' then
bullet_name = gear.RAbullet
if buffactive['Triple Shot'] then
bullet_min_count = 3
end
end
local available_bullets = player.inventory[bullet_name] or player.wardrobe[bullet_name]
-- If no ammo is available, give appropriate warning and end.
if not available_bullets then
if spell.type == 'CorsairShot' and player.equipment.ammo ~= 'empty' then
add_to_chat(104, 'No Quick Draw ammo left. Using what\'s currently equipped ('..player.equipment.ammo..').')
return
elseif spell.type == 'WeaponSkill' and player.equipment.ammo == gear.RAbullet then
add_to_chat(104, 'No weaponskill ammo left. Using what\'s currently equipped (standard ranged bullets: '..player.equipment.ammo..').')
return
else
add_to_chat(104, 'No ammo ('..tostring(bullet_name)..') available for that action.')
eventArgs.cancel = true
return
end
end
-- Don't allow shooting or weaponskilling with ammo reserved for quick draw.
if spell.type ~= 'CorsairShot' and bullet_name == gear.QDbullet and available_bullets.count <= bullet_min_count then
add_to_chat(104, 'No ammo will be left for Quick Draw. Cancelling.')
eventArgs.cancel = true
return
end
-- Low ammo warning.
if spell.type ~= 'CorsairShot' and state.warned.value == false
and available_bullets.count > 1 and available_bullets.count <= options.ammo_warning_limit then
local msg = '***** LOW AMMO WARNING: '..bullet_name..' *****'
--local border = string.repeat("*", #msg)
local border = ""
for i = 1, #msg do
border = border .. "*"
end
add_to_chat(104, border)
add_to_chat(104, msg)
add_to_chat(104, border)
state.warned:set()
elseif available_bullets.count > options.ammo_warning_limit and state.warned then
state.warned:reset()
end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
set_macro_page(1, 19)
end
By Nyruul 2016-10-29 06:22:05
Quote: I'm having a problem where Ioskeha belt will not swap in to my TP set. I've tried adding it to other sets and used showswaps and it certainly does not get swapped in (yes i spelled it correctly.) Anyone know the reason why this belt is not registering?
Just to make sure, you used the export function of gearswap, right?
I'm not sure what the export function is tbh.
Bismarck.Mitchel
サーバ: Bismarck
Game: FFXI
Posts: 153
By Bismarck.Mitchel 2016-10-29 06:25:00
Is this what you are looking for? Added self-command and brief explanation where you have the others at the beginning of the file
Will give this a try, thanks for the response!
By Ineeedmoney 2016-10-29 10:33:56
Any information would be appreciated. I have used this same Cor.lua in the past and my precast.ra worked and now it isnt.
サーバ: Asura
Game: FFXI
Posts: 19
By Asura.Ragnarky 2016-10-30 10:39:53
Everytime I weaponskill as sch i get the following error ...
GearSwap: Lua runtime error: GearSwap/flow.lua:336:
...Windower4/addons/GearSwap/data/SCH.lua:327: attempt to compare number with nil
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')
include('organizer-lib')
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.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"}
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{"Stone III", "Water III", "Aero III", "Fire III", "Blizzard III", "Thunder III"}
info.high_nukes = 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"}
degrade_array = {
['Fire'] = {'Fire','Fire II','Fire III','Fire IV','Fire V','Fire VI'},
['Firega'] = {'Firaga','Firaga II','Firaga III'},
['Ice'] = {'Blizzard','Blizzard II','Blizzard III','Blizzard IV','Blizzard V','Blizzard VI'},
['Icega'] = {'Blizzaga','Blizzaga II','Blizzaga III'},
['Wind'] = {'Aero','Aero II','Aero III','Aero IV','Aero V','Aero VI'},
['Windga'] = {'Aeroga','Aeroga II','Aeroga III'},
['Earth'] = {'Stone','Stone II','Stone III','Stone IV','Stone V','Stone VI'},
['Earthga'] = {'Stonega','Stonega II','Stonega III'},
['Lightning'] = {'Thunder','Thunder II','Thunder III','Thunder IV','Thunder V','Thunder VI'},
['Lightningga'] = {'Thundaga','Thundaga II','Thundaga III'},
['Water'] = {'Water', 'Water II','Water III', 'Water IV','Water V','Water VI'},
['Waterga'] = {'Waterga','Waterga II','Waterga III'},
['Aspirs'] = {'Aspir','Aspir II','Aspir III'},
['Sleepgas'] = {'Sleepga','Sleepga II'}
}
send_command('bind ^` input /ma Stun <t>')
select_default_macro_book()
end
function user_unload()
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['Tabula Rasa'] = {legs="Pedagogy Pants +1"}
sets.precast.JA['Dark Arts'] = {body="Academic's Gown +1"}
sets.precast.JA['Light Arts'] = {legs="Academic's Pants +1"}
sets.precast.JA['Enlightenment'] = {body="Pedagogy Gown +1"}
sets.precast.JA['Stratagems'] = {head="Pedagogy Mortarboard +1",legs="Arbatel Pants +1",feet="Academic's Loafers +1"}
-- Fast cast sets for spells
sets.precast.FC = {ammo="Impatiens",
head="Nahtirah Hat",neck="Incanter's Torque",ear1="Dignitary's Earring",ear2="Loquacious Earring",
body="Vanir Cotehardie",ring1="Prolix Ring",
back="Swith Cape",waist="Witful Belt",legs="Merlinic Shalwar",feet="Chelona Boots"}
sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {body="Amalric Doublet"})
sets.precast.FC.Cure = set_combine(sets.precast.FC, {body="Amalric Doublet",legs="Assiduity Pants +1"})
sets.precast.FC.Curaga = sets.precast.FC.Cure
sets.precast.FC.Impact = set_combine(sets.precast.FC['Elemental Magic'], {head=empty,body="Twilight Cloak"})
sets.precast.FC.Storm ={ammo="Strobilus",
head="Merlinic Hood",neck="Baetyl Pendant",ear1="Dignitary's Earring",ear2="Loquacious Earring",
body="Amalric Doublet",hands="Amalric Gages",ring1="Stikini Ring",ring2="Stikini Ring",
back="Bookworm's Cape",waist="Cascade Belt",legs="Merlinic Shalwar",feet="Merlinic Crackows"}
-- Midcast Sets
sets.midcast.FastRecast = {ammo="Incantor Stone",
head="Nahtirah Hat",ear2="Loquacious Earring",
body="Vanir Cotehardie",ring1="Stikini Ring",ring2="Stikini Ring",
back="Swith Cape",waist="Witful belt",legs="",feet="Academic's Loafers +1"}
sets.midcast.Cure = {main="Bolelabunga",sub="Culminus",ammo="Incantor Stone",
head="Nahtirah Hat",neck="Nodens Gorget",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Heka's Kalasiris",hands="Bokwus Gloves",ring1="Stikini Ring",ring2="Stikini Ring",
back="Swith Cape",waist="Witful belt",legs="Orvail Pants +1",feet="Academic's Loafers +1"}
sets.midcast.CureWithLightWeather = {ammo="Incantor Stone",
head="Gendewitha Caubeen",neck="Nodens Gorget",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Heka's Kalasiris",hands="Bokwus Gloves",ring1="Stikini Ring",ring2="Stikini Ring",
back="Twilight Cape",waist="Witful belt",legs="Assiduity Pants +1",feet="Academic's Loafers +1"}
sets.midcast.Curaga = sets.midcast.Cure
sets.midcast.Regen = {
head="Arbatel Bonnet +1",neck="Incanter's Torque",
body="Telchine Chasuble",hands="Telchine Gloves",ring1="Stikini Ring",ring2="Stikini Ring",
back="Lugh's Cape",waist="Cascade belt",legs="Telchine Braconi",feet="Telchine Pigaches"}
sets.midcast.Cursna = {
neck="Malison Medallion",
hands="Hieros Mittens",ring1="Stikini Ring",ring2="Stikini Ring",
feet="Gendewitha Galoshes"}
sets.midcast['Enhancing Magic'] = {ammo="Savant's Treatise",
head="Telchine Cap",neck="Incanter's Torque",
body="Telchine Chasuble",hands="Arbatel Bracers +1",ring1="Stikini Ring",ring2="Stikini Ring",
waist="Cascade belt",legs="Telchine Braconi",feet="Telchine Pigaches"}
sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {neck="Nodens Gorget",waist="Siegel Sash"})
sets.midcast.Storm = set_combine(sets.midcast['Enhancing Magic'], {feet="Pedagogy Loafers +1"})
sets.midcast.Protect = {ring1="Sheltered Ring"}
sets.midcast.Protectra = sets.midcast.Protect
sets.midcast.Shell = {ring1="Sheltered Ring"}
sets.midcast.Shellra = sets.midcast.Shell
-- Custom spell classes
sets.midcast.MndEnfeebles = {ammo="Pemphredo Tathlum",
head="Merlinic Hood",neck="Incanter's Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Vanya Robe",hands="Pedagogy Bracers +1",ring1="Stikini Ring",ring2="Stikini Ring",
back="Refraction Cape",waist="Eschan Stone",legs="Arbatel Pants +1",feet="Jhakri Pigaches +1"}
sets.midcast.IntEnfeebles = {ammo="Pemphredo Tathlum",
head="Merlinic Hood",neck="Incanter's Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Vanya Robe",hands="Pedagogy Bracers +1",ring1="Stikini Ring",ring2="Stikini Ring",
back="Refraction Cape",waist="Eschan Stone",legs="Arbatel Pants +1",feet="Jhakri Pigaches +1"}
sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
sets.midcast['Dark Magic'] = {ammo="Pemphredo Tathlum",
head="Nahtirah Hat",neck="Mizukage-no-Kubikazari",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Amalric Doublet",hands="Amalric Gages",ring1="Locus Ring",ring2="Prolix ring",
back="Bookworm's Cape",waist="Eschan Stone",legs="Pedagogy Pants +1",feet="Jhakri Pigaches +1"}
sets.midcast.Kaustra = {ammo="Pemphredo Tathlum",
head="Nahtirah Hat",neck="Mizukage-no-Kubikazari",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Amalric Doublet",hands="Amalric Gages",ring1="Locus Ring",ring2="Prolix ring",
back="Bookworm's Cape",waist="Eschan Stone",legs="Merlinic Shalwar",feet="Merlinic Crackows"}
sets.midcast.Drain = {ammo="Pemphredo Tathlum",
head="Nahtirah Hat",neck="Mizukage-no-Kubikazari",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Amalric Doublet",hands="Amalric Gages",ring1="Locus Ring",ring2="Prolix ring",
back="Bookworm's Cape",waist="Austerity Belt +1",legs="Pedagogy Pants +1",feet="Merlinic Crackows"}
sets.midcast.Aspir = sets.midcast.Drain
sets.midcast.Stun = {ammo="Incantor Stone",
head="Nahtirah Hat",neck="Aesir Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
hands="Yaoyotl Gloves",ring1="Prolix Ring",ring2="Sangoma Ring",
back="Refraction Cape",waist="Witful Belt",legs="Pedagogy Pants +1",feet="Academic's Loafers +1"}
-- Elemental Magic sets are default for handling low-tier nukes.
sets.midcast['Elemental Magic'] = {ammo="Ghastly Tathlum",
head="Merlinic Hood",neck="Mizukage-no-Kubikazari",ear1="Barkarole earring",ear2="Hermetic Earring",
body="Amalric Doublet",hands="Amalric Gages",ring1="Locus Ring",ring2="Mujin Band",
back="Toro Cape",waist="Refoccilation Stone",legs="Merlinic Shalwar",feet="Jhakri Pigaches +1"}
sets.midcast['Elemental Magic'].Resistant = {ammo="Ghastly Tathlum",
head="Merlinic Hood",neck="Mizukage-no-Kubikazari",ear1="Barkarole earring",ear2="Hermetic Earring",
body="Amalric Doublet",hands="Amalric Gages",ring1="Locus Ring",ring2="Mujin Band",
back="Toro Cape",waist="Refoccilation Stone",legs="Merlinic Shalwar",feet="Jhakri Pigaches +1"}
-- Custom refinements for certain nuke tiers
sets.midcast['Elemental Magic'].HighTierNuke = set_combine(sets.midcast['Elemental Magic'], {sub="Wizzan Grip"})
sets.midcast['Elemental Magic'].HighTierNuke.Resistant = set_combine(sets.midcast['Elemental Magic'].Resistant, {sub="Wizzan Grip"})
sets.midcast.Impact = {head=empty,body="Twilight Cloak"}
sets.midcast.Helix={ammo="Ghastly Tathlum",
head="Amalric Coif",neck="Incanter's Torque",ear1="Barkarole earring",ear2="Dignitary's Earring",
body="Amalric Doublet",hands="Amalric Gages",ring1="Locus Ring",ring2="Mujin Band",
back="Bookworm's Cape",waist="Refoccilation Stone",legs="Merlinic Shalwar",feet="Merlinic Crackows"}
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="Boonwell Staff",
body="Chelona Blazer",neck="Grandiose chain",ring1="Sheltered Ring",ring2="Paguroidea Ring",
waist="Shinjutsu-no-Obi",legs="Assiduity Pants +1",feet="Chelona Boots"}
-- 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="Homiliary",
head="Amalric Coif",neck="Bathy Choker +1",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Arbatel Gown +1",hands="Arbatel Bracers +1",ring1="Sheltered Ring",ring2="Paguroidea Ring",
back="Kumbira Cape",waist="Witful Belt",legs="Assiduity Pants +1",feet="Herald's Gaiters"}
sets.idle.Field = {main="Akademos",sub="Niobid Strap",ammo="Homiliary",
head="Amalric Coif",neck="Bathy Choker +1",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Arbatel Gown +1",hands="Arbatel Bracers +1",ring1="Sheltered Ring",ring2="Paguroidea Ring",
back="Mecistopins Mantle",waist="Witful Belt",legs="Assiduity Pants +1",feet="Herald's Gaiters"}
sets.idle.Field.PDT = {main="Akademos",sub="Niobid Strap",ammo="Homiliary",
head="Amalric Coif",neck="Bathy Choker +1",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Arbatel Gown +1",hands="Arbatel Bracers +1",ring1="Sheltered Ring",ring2="Paguroidea Ring",
back="Cheviot Cape",waist="Hierarch Belt",legs="Assiduity Pants +1",feet="Herald's Gaiters"}
sets.idle.Weak = {main="Akademos",sub="Niobid Strap",ammo="Homiliary",
head="Amalric Coif",neck="Bathy Choker +1",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Arbatel Gown +1",hands="Arbatel Bracers +1",ring1="Sheltered Ring",ring2="Paguroidea Ring",
back="Kumbira Cape",waist="Witful Belt",legs="Assiduity Pants +1",feet="Herald's Gaiters"}
-- Defense sets
sets.defense.PDT = {main="Akademos",sub="Niobid Strap",ammo="Incantor Stone",
head="Nahtirah Hat",neck="Twilight Torque",ear1="Bloodgem Earring",ear2="Loquacious Earring",
body="Hagondes Coat",hands="Yaoyotl Gloves",ring1="Defending Ring",ring2="Dark ring",
back="Cheviot Cape",waist="Hierarch Belt",legs="Merlinic Shalwar",feet="Hagondes Sabots"}
sets.defense.MDT = {main="Akademos",sub="Niobid Strap",ammo="Incantor Stone",
head="Nahtirah Hat",neck="Twilight Torque",ear1="Bloodgem Earring",ear2="Loquacious Earring",
body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Defending Ring",ring2="Shadow Ring",
back="Tuilha Cape",waist="Hierarch Belt",legs="Bokwus Slops",feet="Hagondes Sabots"}
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 = {main="Akademos",sub="Niobid Strap",ammo="Homiliary",
head="Amalric Coif",neck="Twilight Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Arbatel Gown +1",hands="Arbatel Bracers +1",ring1="Defending Ring",ring2="Dark ring",
back="Cheviot Cape",waist="Witful Belt",legs="Assiduity Pants +1",feet="Merlinic Crackows"}
-- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
sets.buff['Ebullience'] = {head="Arbatel Bonnet +1"}
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="Pedagogy Loafers +1"}
sets.buff['Alacrity'] = {feet="Pedagogy Loafers +1"}
sets.buff['Klimaform'] = {feet="Arbatel Loafers +1"}
sets.buff.FullSublimation = {head="Academic's Mortarboard +1",ear1="Savant's Earring",body="Pedagogy Gown +1"}
sets.buff.PDTSublimation = {head="Academic's Mortarboard +1",ear1="Savant's Earring"}
--sets.buff['Sandstorm'] = {feet="Desert Boots"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
function refine_various_spells(spell, action, spellMap, eventArgs)
local aspirs = S{'Aspir','Aspir II'}
local sleeps = S{'Sleep','Sleep II'}
local newSpell = spell.english
local spell_recasts = windower.ffxi.get_spell_recasts()
local cancelling = 'All '..spell.english..' spells are on cooldown. Cancelling spell casting.'
local spell_index
if spell_recasts[spell.recast_id] > 0 then
if spell.skill == 'Elemental Magic' then
if table.find(degrade_array[ele],spell.name) then
spell_index = table.find(degrade_array[ele],spell.name)
if spell_index > 1 then
newSpell = degrade_array[ele][spell_index - 1]
add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..newSpell..' instead.')
send_command('@input /ma '..newSpell..' '..tostring(spell.target.raw))
eventArgs.cancel = true
end
else
spell_index = table.find(degrade_array[spell.element],spell.name)
if spell_index > 1 then
newSpell = degrade_array[spell.element][spell_index - 1]
add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..newSpell..' instead.')
send_command('@input /ma '..newSpell..' '..tostring(spell.target.raw))
eventArgs.cancel = true
end
end
elseif aspirs:contains(spell.name) then
spell_index = table.find(degrade_array['Aspirs'],spell.name)
if spell_index > 1 then
newSpell = degrade_array['Aspirs'][spell_index - 1]
add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..newSpell..' instead.')
send_command('@input /ma '..newSpell..' '..tostring(spell.target.raw))
eventArgs.cancel = true
end
end
end
end
function job_precast(spell, action, spellMap, eventArgs)
refine_various_spells(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
if spell.english == "Paralyna" and buffactive.Paralyzed then
-- no gear swaps if we're paralyzed, to avoid blinking while trying to remove it.
eventArgs.handled = true
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.skill == 'Elemental Magic' then
if state.MagicBurst.value then
equip(sets.magic_burst)
end
end
if spell.skill == 'Elemental Magic' and spell.element == world.day_element or spell.element == world.weather_element then
equip ({waist="Hachirin-no-Obi"})
end
end
function job_aftercast(spell, action, spellMap, eventArgs)
if spell.english == 'Sleep' then
send_command('@wait 50;input /echo ------- '..spell.english..' is wearing off in 10 seconds -------')
elseif spell.english == 'Sleep II' or spell.english == 'Sleepga II' then
send_command('@wait 80;input /echo ------- '..spell.english..' is wearing off in 10 seconds -------')
elseif spell.english == 'Break' or spell.english == 'Breakga' then
send_command('@wait 20;input /echo ------- '..spell.english..' is wearing off in 10 seconds -------')
end
if spell.english == 'Sleep II' then
send_command('timers c "Sleep II" 90 down spells/00259.png')
elseif spell.english == 'Sleep' then
send_command('timers c "Sleep" 60 down spells/00253.png')
elseif spell.english == 'Break' then
send_command('timers c "Break" 30 down spells/00255.png')
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' then --or spellMap ~= 'ElementalEnfeeble'
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.skill == "Elemental Magic" 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
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, 16)
elseif player.sub_job == 'BLM' then
set_macro_page(1, 16)
elseif player.sub_job == 'WHM' then
set_macro_page(1, 16)
end
end
Bismarck.Dunigs
サーバ: Bismarck
Game: FFXI
Posts: 83
By Bismarck.Dunigs 2016-10-30 10:52:56
You need to modify your refine_various_spell function to cancel, or have some kind of handling specifically for weapon skills, since they have no recast for the API to return. Alternatively you can add something to job_precast to avoid refine_various_spells when using a weapon skill.
few quick and dirty snippets : Code
function refine_various_spells(spell, action, spellMap, eventArgs)
if spell.type == 'WeaponSkill' then return end
local aspirs = S{'Aspir','Aspir II'}
local sleeps = S{'Sleep','Sleep II'}
local newSpell = spell.english
local spell_recasts = windower.ffxi.get_spell_recasts()
local cancelling = 'All '..spell.english..' spells are on cooldown. Cancelling spell casting.'
local spell_index
if spell_recasts[spell.recast_id] > 0 then
if spell.skill == 'Elemental Magic' then
if table.find(degrade_array[ele],spell.name) then
spell_index = table.find(degrade_array[ele],spell.name)
if spell_index > 1 then
newSpell = degrade_array[ele][spell_index - 1]
add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..newSpell..' instead.')
send_command('@input /ma '..newSpell..' '..tostring(spell.target.raw))
eventArgs.cancel = true
end
else
spell_index = table.find(degrade_array[spell.element],spell.name)
if spell_index > 1 then
newSpell = degrade_array[spell.element][spell_index - 1]
add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..newSpell..' instead.')
send_command('@input /ma '..newSpell..' '..tostring(spell.target.raw))
eventArgs.cancel = true
end
end
elseif aspirs:contains(spell.name) then
spell_index = table.find(degrade_array['Aspirs'],spell.name)
if spell_index > 1 then
newSpell = degrade_array['Aspirs'][spell_index - 1]
add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..newSpell..' instead.')
send_command('@input /ma '..newSpell..' '..tostring(spell.target.raw))
eventArgs.cancel = true
end
end
end
end
Or handling in precast(moved refine_various_spells) into your "Magic" check) : Code
function job_precast(spell, action, spellMap, eventArgs)
if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") then
refine_various_spells(spell, action, spellMap, eventArgs)
if buffactive.Silence then
cancel_spell()
send_command('input /item "Echo Drops" <me>')
end
end
if spell.english == "Paralyna" and buffactive.Paralyzed then
-- no gear swaps if we're paralyzed, to avoid blinking while trying to remove it.
eventArgs.handled = true
end
end
Just looking for someone to explain this addon a bit for me. It looks like it is an alternative to Spellcast.
Is it going to be replacing Spellcast? In which ways is it better or worse. I don't know any programming but I've slowly learned more and more about spellcast and the 'language' used in gearswap is confusing to me.
It says it uses packets so it potentially could be more detectable? but does that also eliminate any lag that spellcast may encounter?
I plan on redoing my PUP xml to include pet casting sets thanks to the new addon petschool. I'm just not sure if it's worth it to just wait until gearswap gets more popular or to go ahead and do it in spellcast.
If anyone could give me more info I'd greatly appreciate it.
|
|