|
COR gearswap help
Serveur: Asura
Game: FFXI
Posts: 79
By Asura.Iamarealgirl 2019-09-20 08:41:22
i'm using the cor.lua file that was on kinematics github.
the problem i'm having is its not changing to the correct set when i'm dualwielding.
i want it to change to melee.dw, but its equipping engaged.acc.dw for some reason.
also i added
function update_combat_form()
if DW == true then
state.CombatForm:set('DW')
elseif DW == false then
state.CombatForm:reset()
end
end
because it wasn't changing to dw at all before i added this.
Full lua:
-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
--[[
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('Melee', 'Acc', 'Ranged')
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 = "Adlivun Bullet"
gear.WSbullet = "decimating Bullet"
gear.MAbullet = "Bronze Bullet"
gear.QDbullet = "Adlivun 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>')
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 !`')
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="chasseur's frac"}
sets.precast.JA['Snake Eye'] = {legs="Lanun trews +1"}
sets.precast.JA['Wild Card'] = {feet="Lanun Bottes +1"}
sets.precast.JA['Random Deal'] = {body="Lanun Frac +1"}
sets.precast.CorsairRoll = {head="Lanun Tricorne +1",hands="chasseur's gants"}
sets.precast.CorsairRoll["Caster's Roll"] = set_combine(sets.precast.CorsairRoll, {legs="chasseur's Culottes"})
sets.precast.CorsairRoll["Courser's Roll"] = set_combine(sets.precast.CorsairRoll, {feet="chasseur's Bottes "})
sets.precast.CorsairRoll["Blitzer's Roll"] = set_combine(sets.precast.CorsairRoll, {head="chasseur's 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 +1"}
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="chasseur's Tricorne",
body="Laksamana's Frac",hands="Lanun Gants",
back="Navarch's Mantle",waist="Impulse Belt",legs="Nahtirah Trousers",feet="meghanada jambeaux +1"}
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {
head="lanun tricorne +1",neck="combatant's torque",ear1="ishvara earring",ear2="volley Earring",
body="laksamana's frac +1",hands="meghanada gloves +1",ring1="llabrat Ring",ring2="dumakulem's Ring",
back="gunslinger's cape",waist="kwahu kachina belt",legs="meghanada chausses +1 ",feet="meghanada jambeaux +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,
ring2="garuda Ring",back="ik cape"}
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="lanun tricorne +1",neck="Stoicheion Medal",ear1="Friomisi Earring",ear2="Hecate's Earring",
body="lanun frac +1",hands="meghanada gloves +1",ring1="llabrat Ring",ring2="acumen Ring",
back="gunslinger's Cape",waist="salire belt",legs="laksamana's trews +1",feet="adhemar gamashes"}
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 +1",hands="Schutzen Mittens",ring1="Hajduk Ring",ring2="Demon's Ring",
back="Toro Cape",waist="Aquiline Belt",legs="Iuitl Tights",feet="Lanun Bottes +1"}
sets.midcast.CorsairShot.Acc = {ammo=gear.QDbullet,
head="Laksamana's Hat +1",neck="Stoicheion Medal",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Lanun Frac +1",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 +1",neck="Stoicheion Medal",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Lanun Frac +1",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,
head="Lanun Tricorne +1",neck="Ocachi Gorget",ear1="Clearview Earring",ear2="Volley Earring",
body="Laksamana's Frac +1",hands="Iuitl Wristbands",ring1="Rajas Ring",ring2="Stormsoul Ring",
back="Terebellum Mantle",waist="Commodore Belt",legs="Nahtirah Trousers",feet="Iuitl Gaiters +1"}
sets.midcast.RA.Acc = {ammo=gear.RAbullet,
head="Laksamana's Hat +",neck="Huani Collar",ear1="Clearview Earring",ear2="Volley Earring",
body="Laksamana's Frac +",hands="Buremte Gloves",ring1="Hajduk Ring",ring2="Beeline Ring",
back="Libeccio Mantle",waist="Commodore Belt",legs="Thurandaut Tights +1",feet="Laksamana's Bottes +1"}
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {neck="Wiglen Gorget",ring1="Sheltered Ring",ringddddddd2="Paguroidea Ring"}
-- Idle sets
sets.idle = {ammo=gear.RAbullet,
head="meghanada visor +1",neck="orichi nodowa",ear1="vision earring",ear2="Volley Earring",
body="meghanada cuirie",hands="meghanada gloves +1",ring1="defending Ring",ring2="chirich Ring",
back="iximulew cape",waist="Flume Belt",legs="crimson cuisses",feet="meghanada jambeaux +1"}
sets.idle.Town = {legs="crimson cuisses"}
-- 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="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.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 = {main="kaja knife", sub="eletta sword", ammo=gear.RAbullet,
head="adhemar bonnet",neck="Asperity Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
body="meghanada cuirie",hands="meghanada gloves +1",ring1="petrov Ring",ring2="Epona's Ring",
back="bleating Mantle",waist="twilight Belt",legs="meghanada chausses +1",feet="meghanada jambeaux +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 update_combat_form()
if DW == true then
state.CombatForm:set('DW')
elseif DW == false then
state.CombatForm:reset()
end
end
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, 17)
end
Serveur: Asura
Game: FFXI
Posts: 79
By Asura.Iamarealgirl 2019-09-20 09:12:42
ok i was wrong the code i added didnt work either.
By Galkapryme 2019-09-29 23:59:53
Here's mine. You should only need to update gear based on what you have. ALSO NOTE: If you're dual-wielding Rostams, and have augmented one for DD and one for rolls, you'll need to create three vanilla (in-game) equipsets - one with DD Rostam in main, one with both weapon slots empty, and one with rolls Rostam in main. I'll show you my code first, and try to show you my equipsets in another reply (not sure how yet, but I'll try to figure it out). I use this code with no issues at all. Some of the codes don't work only because I don't have the gear and don't care about them, but for basic and advanced COR function, this works.
Code -------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
--[[
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 = "Divine Bullet"
gear.WSbullet = "Orichalcum Bullet"
gear.MAbullet = "Orichalcum Bullet"
gear.QDbullet = "Animikii 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'] = {head="Oshosi Mask +1",body="Chasseur's Frac +1",hands="Oshosi Gloves +1",legs="Oshosi Trousers +1",
feet="Oshosi Leggings +1"}
sets.precast.JA['Snake Eye'] = {legs="Lanun Trews +3"}
sets.precast.JA['Wild Card'] = {feet="Lanun Bottes +3"}
sets.precast.JA['Random Deal'] = {body="Lanun Frac +3"}
sets.precast.JA.CorsairRoll = {
main={name="Rostam", bag="Wardrobe 2", priority=1},
range="Compensator",
head="Lanun Tricorne +3",
hands="Chasseur's Gants +1",
neck="Regal Necklace",
ring1="Barataria Ring",
ring2="Luzaf's Ring",
}
sets.precast.JA.CorsairRoll["Caster's Roll"] = set_combine(sets.precast.CorsairRoll, {legs="Chasseur's Culottes +1"})
sets.precast.JA.CorsairRoll["Courser's Roll"] = set_combine(sets.precast.CorsairRoll, {feet="Chasseur's Bottes +1"})
sets.precast.JA.CorsairRoll["Blitzer's Roll"] = set_combine(sets.precast.CorsairRoll, {head="Chasseur's Tricorne +1"})
sets.precast.JA.CorsairRoll["Tactician's Roll"] = set_combine(sets.precast.CorsairRoll, {body="Chasseur's Frac +1"})
sets.precast.JA.CorsairRoll["Allies' Roll"] = set_combine(sets.precast.CorsairRoll, {hands="Chasseur's Gants +1"})
sets.precast.LuzafRing = {ring1="Barataria Ring",ring2="Luzaf's Ring"}
sets.precast.FoldDoubleBust = {hands="Lanun Gants +3"}
sets.precast.CorsairShot = {
ammo=gear.QDbullet,
head={ name="Herculean Helm", augments={'Dex+1','Mag. Acc.+20','"Mag. Atk. Bns."+20','Pet: "Mag. Atk. Bns."+19',}},
body={ name="Lanun Frac +3", augments={'Enhances "Loaded Deck" effect',}},
hands={ name="Carmine Fin. Ga. +1", augments={'Rng.Atk.+20','"Mag.Atk.Bns."+12','"Store TP"+6',}},
legs="Laksa. Trews +2",
feet={ name="Lanun Bottes +3", augments={'Enhances "Wild Card" effect',}},
neck="Comm. Charm +2",
left_ear="Friomisi Earring",
right_ear="Hecate's Earring",
left_ring="Fenrir Ring +1",
right_ring="Dingir Ring",
back={ name="Camulus's Mantle", augments={'AGI+20','Mag. Acc+20 /Mag. Dmg.+20','Rng.Acc.+10','"Mag.Atk.Bns."+10','Evasion+15',}}}
-- Waltz set (chr and vit)
sets.precast.Waltz = {
head="Mummu Bonnet +2",
body="Laksamana's Frac +3",
hands={ name="Buremte Gloves", augments={'Phys. dmg. taken -2%','Magic dmg. taken -2%','Rng.Atk.+10',}},
legs="Dashing Subligar",
feet="Rawhide Boots",
neck="Sanctity Necklace",
waist="Chuq'aba Belt",
left_ear="Oneiros Earring",
right_ear="Enchntr. Earring +1",
left_ring="Kunaji Ring",
right_ring="Titan Ring +1",
back={ name="Camulus's Mantle", augments={'AGI+20','Mag. Acc+20 /Mag. Dmg.+20','AGI+4','Weapon skill damage +10%',}}}
-- 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="Chass. Tricorne +1",
body="Laksamana's Frac +3",
hands={ name="Carmine Fin. Ga. +1", augments={'Rng.Atk.+20','"Mag.Atk.Bns."+12','"Store TP"+6',}},
legs={ name="Lanun Trews +3", augments={'Enhances "Snake Eye" effect',}},
feet="Meg. Jam. +2",
neck="Comm. Charm +2",
waist="Ponente Sash",
left_ear="Telos Earring",
right_ear="Volley Earring",
left_ring="Hajduk Ring +1",
right_ring="Dingir Ring",
back={ name="Camulus's Mantle", augments={'AGI+20','Mag. Acc+20 /Mag. Dmg.+20','Rng.Acc.+10','"Mag.Atk.Bns."+10','Evasion+15',}}}
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {
ammo="Orichalc. Bullet",
head="Pixie Hairpin +1",
body="Lanun Frac +3",
hands={ name="Carmine Fin. Ga. +1", augments={'Rng.Atk.+20','"Mag.Atk.Bns."+12','"Store TP"+6',}},
legs="Laksa. Trews +2",
feet={ name="Lanun Bottes +3", augments={'Enhances "Wild Card" effect',}},
neck="Comm. Charm +2",
waist="Fotia Belt",
left_ear="Hecate's Earring",
right_ear="Friomisi Earring",
left_ring="Fenrir Ring +1",
right_ring="Dingir Ring",
back={ name="Camulus's Mantle", augments={'AGI+20','Mag. Acc+20 /Mag. Dmg.+20','AGI+4','Weapon skill damage +10%',}}}
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS['Leaden Salute'] = sets.precast.WS
sets.precast.WS['Exenterator'] = set_combine(sets.precast.WS['Requiescat'], {right_ring="Chirich Ring +1"})
sets.precast.WS['Shining Blade'] = {
ammo="Orichalc. Bullet",
head="Laksa. Tricorne +3",
body={ name="Lanun Frac +3", augments={'Enhances "Loaded Deck" effect',}},
hands={ name="Lanun Gants +3", augments={'Enhances "Fold" effect',}},
legs={ name="Lanun Trews +3", augments={'Enhances "Snake Eye" effect',}},
feet={ name="Lanun Bottes +3", augments={'Enhances "Wild Card" effect',}},
neck="Comm. Charm +2",
waist="Fotia Belt",
left_ear="Hecate's Earring",
right_ear="Friomisi Earring",
left_ring="Fenrir Ring +1",
right_ring="Dingir Ring",
back={ name="Camulus's Mantle", augments={'AGI+20','Mag. Acc+20 /Mag. Dmg.+20','AGI+4','Weapon skill damage +10%',}}}
sets.precast.WS['Requiescat'] = {
ammo="Decimating Bullet",
head="Meghanada Visor +2",
body="Laksa. Frac +3",
hands="Meg. Gloves +2",
legs="Meg. Chausses +2",
feet="Meg. Jam. +2",
neck="Fotia Gorget",
waist="Fotia Belt",
left_ear="Ishvara Earring",
right_ear="Heartseeker Earring",
left_ring="Chirich Ring +1",
right_ring="Stikini Ring +1",
back={ name="Camulus's Mantle", augments={'AGI+20','Mag. Acc+20 /Mag. Dmg.+20','AGI+4','Weapon skill damage +10%',}},
}
sets.precast.WS['Last Stand'] = {
ammo=gear.RAbullet,
head={ name="Lanun Tricorne +3", augments={'Enhances "Winning Streak" effect',}},
body="Laksa. Frac +3",
hands="Meg. Gloves +2",
legs={ name="Lanun Trews +3", augments={'Enhances "Snake Eye" effect',}},
feet={ name="Lanun Bottes +3", augments={'Enhances "Wild Card" effect',}},
neck="Fotia Gorget",
waist="Fotia Belt",
left_ear="Ishvara Earring",
right_ear="Telos Earring",
left_ring="Hajduk Ring +1",
right_ring="Dingir Ring",
back={ name="Camulus's Mantle", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','STR+10','"Store TP"+10',}}}
sets.precast.WS['Savage Blade'] = {
ammo=gear.RAbullet,
head="Meghanada Visor +2",
body="Laksa. Frac +3",
hands="Meg. Gloves +2",
legs="Meg. Chausses +2",
feet={ name="Lanun Bottes +3", augments={'Enhances "Wild Card" effect',}},
neck="Comm. Charm +2",
waist="Prosililo Belt +1",
left_ear="Ishvara Earring",
right_ear="Telos Earring",
left_ring="Rufescent Ring",
right_ring="Ifrit Ring +1",
back={ name="Camulus's Mantle", augments={'STR+20','Accuracy+20 /Attack+20','STR+5','Weapon skill damage +10%',}}}
sets.precast.WS['Shining Blade'] = sets.precast.WS['Savage Blade']
sets.precast.WS['Wildfire'] = sets.precast.WS
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="Laksa. Tricorne +3",
body={ name="Lanun Frac +3", augments={'Enhances "Loaded Deck" effect',}},
hands={ name="Carmine Fin. Ga. +1", augments={'Rng.Atk.+20','"Mag.Atk.Bns."+12','"Store TP"+6',}},
legs="Laksa. Trews +2",
feet="Laksamana Boots +3",
neck="Comm. Charm +2",
waist="Kwahu Kachina Belt +1",
left_ear="Friomisi Earring",
right_ear="Hecate's Earring",
left_ring="Fenrir Ring +1",
right_ring="Dingir Ring",
back={ name="Camulus's Mantle", augments={'AGI+20','Mag. Acc+20 /Mag. Dmg.+20','Rng.Acc.+10','"Mag.Atk.Bns."+10','Evasion+15',}}}
sets.midcast.CorsairShot.Acc = {ammo=gear.QDbullet,
head="Laksa. Tricorne +3",
body="Oshosi Vest +1",
hands="Mummu Wrists +2",
legs={ name="Lanun Trews +3", augments={'Enhances "Snake Eye" effect',}},
feet="Laksamana Boots +3",
neck="Comm. Charm +2",
waist="Kwahu Kachina Belt +1",
left_ear="Hecate's Earring",
right_ear="Enchntr. Earring +1",
left_ring="Stikini Ring +1",
right_ring="Stikini Ring +1",
back={ name="Camulus's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','"Store TP"+10','Evasion+9',}}}
sets.midcast.CorsairShot['Light Shot'] = sets.midcast.CorsairShot.Acc
sets.midcast.CorsairShot['Dark Shot'] = sets.midcast.CorsairShot['Light Shot']
-- Ranged gear
sets.midcast.RA = {ammo=gear.RAbullet,
head="Meghanada Visor +2",
body="Laksa. Frac +3",
hands="Meg. Gloves +2",
legs={ name="Lanun Trews +3", augments={'Enhances "Snake Eye" effect',}},
feet="Meg. Jam. +2",
neck="Iskur Gorget",
waist="Kwahu Kachina Belt +1",
left_ear="Telos Earring",
right_ear="Volley Earring",
left_ring="Hajduk Ring +1",
right_ring="Dingir Ring",
back={ name="Camulus's Mantle", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','STR+10','"Store TP"+6',}}}
sets.midcast.RA.Acc = {ammo=gear.RAbullet,
head="Meghanada Visor +2",
body="Laksa. Frac +3",
hands="Meg. Gloves +2",
legs={ name="Lanun Trews +3", augments={'Enhances "Snake Eye" effect',}},
feet="Meg. Jam. +2",
neck="Iskur Gorget",
waist="Kwahu Kachina Belt +1",
left_ear="Telos Earring",
right_ear="Volley Earring",
left_ring="Hajduk Ring +1",
right_ring="Dingir Ring",
back={ name="Camulus's Mantle", augments={'AGI+20','Rng.Acc.+20 Rng.Atk.+20','STR+10','"Store TP"+6',}}}
-- 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 = {
head="Oshosi Mask +1",
body="Oshosi Vest +1",
hands="Oshosi Gloves",
legs="Carmine Cuisses",
feet="Oshosi Leggings +1",
neck="Sanctity Necklace",
waist="Kwahu Kachina Belt +1",
left_ear="Enchntr. Earring +1",
right_ear="Impreg. Earring",
left_ring="Sheltered Ring",
right_ring="Paguroidea Ring",
back={ name="Camulus's Mantle", augments={'AGI+20','Mag. Acc+20 /Mag. Dmg.+20','Rng.Acc.+10','"Mag.Atk.Bns."+10','Evasion+15',}}}
sets.idle.Town = {
head={ name="Lanun Tricorne +3", augments={'Enhances "Winning Streak" effect',}},
body={ name="Lanun Frac +3", augments={'Enhances "Loaded Deck" effect',}},
hands={ name="Lanun Gants +3", augments={'Enhances "Fold" effect',}},
legs="Carmine Cuisses",
feet={ name="Lanun Bottes +3", augments={'Enhances "Wild Card" effect',}},
neck="Wiglen Gorget",
waist="Kwahu Kachina Belt +1",
left_ear="Enchntr. Earring +1",
right_ear="Impreg. Earring",
left_ring="Sheltered Ring",
right_ring="Paguroidea Ring",
back={ name="Camulus's Mantle", augments={'AGI+20','Mag. Acc+20 /Mag. Dmg.+20','Rng.Acc.+10','"Mag.Atk.Bns."+10','Evasion+15',}}}
-- Defense sets
sets.defense.PDT = {
head={ name="Lanun Tricorne +3", augments={'Enhances "Winning Streak" effect',}},
body={ name="Lanun Frac +3", augments={'Enhances "Loaded Deck" effect',}},
hands={ name="Lanun Gants +3", augments={'Enhances "Fold" effect',}},
legs={ name="Lanun Trews +3", augments={'Enhances "Snake Eye" effect',}},
feet={ name="Lanun Bottes +3", augments={'Enhances "Wild Card" effect',}},
neck="Sanctity Necklace",
waist="Flume Belt +1",
left_ear="Thureous Earring",
right_ear="Impreg. Earring",
left_ring="Paguroidea Ring",
right_ring="Defending Ring",
back={ name="Camulus's Mantle", augments={'AGI+20','Mag. Acc+20 /Mag. Dmg.+20','Rng.Acc.+10','"Mag.Atk.Bns."+10','Evasion+15',}}}
sets.defense.MDT = {
head="Oshosi Mask +1",
body="Oshosi Vest +1",
hands="Oshosi Gloves",
legs="Oshosi Trousers",
feet="Oshosi Leggings +1",
neck="Sanctity Necklace",
waist="Kwahu Kachina Belt +1",
left_ear="Enchntr. Earring +1",
right_ear="Impreg. Earring",
left_ring="Paguroidea Ring",
right_ring="Defending Ring",
back={ name="Camulus's Mantle", augments={'AGI+20','Mag. Acc+20 /Mag. Dmg.+20','Rng.Acc.+10','"Mag.Atk.Bns."+10','Evasion+15',}}}
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 = {
main={name="Rostam", bag="Wardrobe", priority=1},
head={ name="Adhemar Bonnet +1", augments={'STR+12','DEX+12','Attack+20',}},
body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
legs="Meg. Chausses +2",
feet="Meg. Jam. +2",
neck="Sanctity Necklace",
waist="Chiner's Belt +1",
left_ear="Telos Earring",
right_ear="Cessance Earring",
left_ring="Chirich Ring +1",
right_ring="Chirich Ring +1",
back={ name="Camulus's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','"Store TP"+10','Evasion+12',}}}
sets.engaged.Acc = {
main={name="Rostam", bag="Wardrobe", priority=1},
ammo=gear.RAbullet,
head={ name="Adhemar Bonnet +1", augments={'STR+12','DEX+12','Attack+20',}},
body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
legs="Meg. Chausses +2",
feet="Meg. Jam. +2",
neck="Sanctity Necklace",
waist="Chiner's Belt +1",
left_ear="Telos Earring",
right_ear="Heartseeker Earring",
left_ring="Chirich Ring +1",
right_ring="Chirich Ring +1",
back={ name="Camulus's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','"Store TP"+10','Evasion+12',}}}
sets.engaged.Melee.DW = {
main={name="Rostam", bag="Wardrobe", priority=1},
range={ name="Deathlocke", augments={'Magic damage+30','"Mag.Atk.Bns."+10','AGI+10',}},
sub={name="Rostam", bag="Wardrobe 2", priority=2},
ammo=gear.RAbullet,
head={ name="Adhemar Bonnet +1", augments={'STR+12','DEX+12','Attack+20',}},
body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
legs="Meg. Chausses +2",
feet="Meg. Jam. +2",
neck="Sanctity Necklace",
waist="Chiner's Belt +1",
left_ear="Telos Earring",
right_ear="Cessance Earring",
left_ring="Chirich Ring +1",
right_ring="Chirich Ring +1",
back={ name="Camulus's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','"Store TP"+10','Evasion+12',}}}
sets.engaged.Acc.DW = {
main={name="Rostam", bag="Wardrobe", priority=1},
range={ name="Deathlocke", augments={'Magic damage+30','"Mag.Atk.Bns."+10','AGI+10',}},
sub={name="Rostam", bag="Wardrobe 2", priority=2},
ammo=gear.RAbullet,
head={ name="Adhemar Bonnet +1", augments={'STR+12','DEX+12','Attack+20',}},
body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
legs="Meg. Chausses +2",
feet="Meg. Jam. +2",
neck="Sanctity Necklace",
waist="Chiner's Belt +1",
left_ear="Telos Earring",
right_ear="Heartseeker Earring",
left_ring="Chirich Ring +1",
right_ring="Chirich Ring +1",
back={ name="Camulus's Mantle", augments={'STR+20','Accuracy+20 Attack+20','STR+10','"Store TP"+10','Evasion+12',}}}
sets.engaged.Ranged = {
main={name="Rostam", bag="Wardrobe", priority=1},
ammo=gear.RAbullet,
head={ name="Adhemar Bonnet +1", augments={'STR+12','DEX+12','Attack+20',}},
body={ name="Adhemar Jacket +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
hands={ name="Adhemar Wrist. +1", augments={'DEX+12','AGI+12','Accuracy+20',}},
legs="Meg. Chausses +2",
feet="Meg. Jam. +2",
neck="Sanctity Necklace",
waist="Kwahu Kachina Belt +1",
left_ear="Dudgeon Earring",
right_ear="Heartseeker Earring",
left_ring="Chirich Ring +1",
right_ring="Chirich Ring +1",
back={ name="Camulus's Mantle", augments={'STR+10','Rng. Acc.+20 Rng. Atk.+20','AGI+20','"Store TP"+10',}}}
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 idle_town_values ()
sets.idle.Town = S{
"Ru'Lude Gardens",
"Upper Jeuno",
"Lower Jeuno",
"Port Jeuno",
"Port Windurst",
"Windurst Waters",
"Windurst Woods",
"Windurst Walls",
"Heavens Tower",
"Port San d'Oria",
"Northern San d'Oria",
"Southern San d'Oria",
"Port Bastok",
"Bastok Markets",
"Bastok Mines",
"Metalworks",
"Aht Urhgan Whitegate",
"Al Zahbi",
"South Sandoria [S]",
"Bastok Markets [S]",
"Windurst Waters [S]",
"Tavnazian Safehold",
"Nashmau",
"Selbina",
"Mhaura",
"Rabao",
"Norg",
"Eastern Adoulin",
"Western Adoulin",
"Kazham"
}
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
if spell.action_type == 'Ranged Attack' and buffactive['Triple Shot']
then sets.precast.JA['Triple Shot'] = sets.midcast.RA
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(10, 17)
end
i'm using the cor.lua file that was on kinematics github.
the problem i'm having is its not changing to the correct set when i'm dualwielding.
i want it to change to melee.dw, but its equipping engaged.acc.dw for some reason.
also i added
function update_combat_form()
if DW == true then
state.CombatForm:set('DW')
elseif DW == false then
state.CombatForm:reset()
end
end
because it wasn't changing to dw at all before i added this.
Full lua:
-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
--[[
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('Melee', 'Acc', 'Ranged')
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 = "Adlivun Bullet"
gear.WSbullet = "decimating Bullet"
gear.MAbullet = "Bronze Bullet"
gear.QDbullet = "Adlivun 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>')
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 !`')
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="chasseur's frac"}
sets.precast.JA['Snake Eye'] = {legs="Lanun trews +1"}
sets.precast.JA['Wild Card'] = {feet="Lanun Bottes +1"}
sets.precast.JA['Random Deal'] = {body="Lanun Frac +1"}
sets.precast.CorsairRoll = {head="Lanun Tricorne +1",hands="chasseur's gants"}
sets.precast.CorsairRoll["Caster's Roll"] = set_combine(sets.precast.CorsairRoll, {legs="chasseur's Culottes"})
sets.precast.CorsairRoll["Courser's Roll"] = set_combine(sets.precast.CorsairRoll, {feet="chasseur's Bottes "})
sets.precast.CorsairRoll["Blitzer's Roll"] = set_combine(sets.precast.CorsairRoll, {head="chasseur's 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 +1"}
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="chasseur's Tricorne",
body="Laksamana's Frac",hands="Lanun Gants",
back="Navarch's Mantle",waist="Impulse Belt",legs="Nahtirah Trousers",feet="meghanada jambeaux +1"}
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {
head="lanun tricorne +1",neck="combatant's torque",ear1="ishvara earring",ear2="volley Earring",
body="laksamana's frac +1",hands="meghanada gloves +1",ring1="llabrat Ring",ring2="dumakulem's Ring",
back="gunslinger's cape",waist="kwahu kachina belt",legs="meghanada chausses +1 ",feet="meghanada jambeaux +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,
ring2="garuda Ring",back="ik cape"}
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="lanun tricorne +1",neck="Stoicheion Medal",ear1="Friomisi Earring",ear2="Hecate's Earring",
body="lanun frac +1",hands="meghanada gloves +1",ring1="llabrat Ring",ring2="acumen Ring",
back="gunslinger's Cape",waist="salire belt",legs="laksamana's trews +1",feet="adhemar gamashes"}
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 +1",hands="Schutzen Mittens",ring1="Hajduk Ring",ring2="Demon's Ring",
back="Toro Cape",waist="Aquiline Belt",legs="Iuitl Tights",feet="Lanun Bottes +1"}
sets.midcast.CorsairShot.Acc = {ammo=gear.QDbullet,
head="Laksamana's Hat +1",neck="Stoicheion Medal",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Lanun Frac +1",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 +1",neck="Stoicheion Medal",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Lanun Frac +1",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,
head="Lanun Tricorne +1",neck="Ocachi Gorget",ear1="Clearview Earring",ear2="Volley Earring",
body="Laksamana's Frac +1",hands="Iuitl Wristbands",ring1="Rajas Ring",ring2="Stormsoul Ring",
back="Terebellum Mantle",waist="Commodore Belt",legs="Nahtirah Trousers",feet="Iuitl Gaiters +1"}
sets.midcast.RA.Acc = {ammo=gear.RAbullet,
head="Laksamana's Hat +",neck="Huani Collar",ear1="Clearview Earring",ear2="Volley Earring",
body="Laksamana's Frac +",hands="Buremte Gloves",ring1="Hajduk Ring",ring2="Beeline Ring",
back="Libeccio Mantle",waist="Commodore Belt",legs="Thurandaut Tights +1",feet="Laksamana's Bottes +1"}
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {neck="Wiglen Gorget",ring1="Sheltered Ring",ringddddddd2="Paguroidea Ring"}
-- Idle sets
sets.idle = {ammo=gear.RAbullet,
head="meghanada visor +1",neck="orichi nodowa",ear1="vision earring",ear2="Volley Earring",
body="meghanada cuirie",hands="meghanada gloves +1",ring1="defending Ring",ring2="chirich Ring",
back="iximulew cape",waist="Flume Belt",legs="crimson cuisses",feet="meghanada jambeaux +1"}
sets.idle.Town = {legs="crimson cuisses"}
-- 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="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.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 = {main="kaja knife", sub="eletta sword", ammo=gear.RAbullet,
head="adhemar bonnet",neck="Asperity Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
body="meghanada cuirie",hands="meghanada gloves +1",ring1="petrov Ring",ring2="Epona's Ring",
back="bleating Mantle",waist="twilight Belt",legs="meghanada chausses +1",feet="meghanada jambeaux +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 update_combat_form()
if DW == true then
state.CombatForm:set('DW')
elseif DW == false then
state.CombatForm:reset()
end
end
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, 17)
end
|
|