|
Gearswap Support Thread
By aisukage 2021-12-29 09:24:45
Xurion is right, Without seeing the lua there could be complications but to answer you question this should work unless there are any complication. Now I just wrote this from the top of my head and haven't actually tested it so I'm not sure if I wrote it correctly but it should get you close to what you're after. I hope lol. If there are any errors I'm more than happy to try to resolve them.
Code
function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.skill == 'Elemental Magic' and player.mpp < 51 then
equip({ neck="Uggalepih pendant" })
end
end
function customize_melee_set(meleeSet)
if world.time >= (17*60) or world.time <= (7*60) then
return meleeSet = set_combine(meleeSet, {hands="Koga tekko"})
else
return meleeSet
end
end
NightTime_WS = S{"Blade: Jin"}
function job_post_precast(spell, action, spellMap, eventArgs)
if spell.type == 'WeaponSkill' and NightTime_WS:contains(spell.english) then
if world.time >= (17*60) or world.time <= (7*60) then
equip({hands="Koga Tekko"})
end
end
end
the line with the NightTime_WS = S{"Blade: Jin"} just inset any WS name that you want this to apply to. For example Code NightTime_WS = S{"Blade: Jin", "Blade: Rin", "Blade: Kamu"}
By Dubfire 2021-12-29 17:57:10
Hey guys, thanks for responding so fast and your help
The Ugg. Pendant one did not work, (I have not tried the Ninja one yet)
I noticed that there is already a "function job_post_midcast(spell, action, spellMap, eventArgs)"
In 2 different spots (Line 1734 and line 1764) I tried adding it to the line 1734 one, and I tried putting it by itself, neither worked.
Also I'm having a different issue, that I've actually had other people look at and they didn't see anything: If you happen to notice anything that may cause this while you are looking at it anyway, would appreciate if you could fix it (Also feel free to add/edit) anything else that you think would be helpful, as I don't know much about .lua's in general, I just edited one with my own stuff I used as a base)
So the issue is, My Aftercast/Current idle set, does NOT automatically equip after I cast Elemental magic...It DOES equip after every other magic type: (Dark/Healing/Enhancing, etc) Just not Elemental magic for some reason....Seems to happen more with the higher Tier spells for whatever reason. Something that I figured out though, if I hit the Nuke macro Twice (a little spaced out, maybe 1-2 sec after I start casting) Then the aftercast set will equip "most" of the time, where as if I don't...It does maybe 10% of the time....But it does SOMETIMES with just hitting the spell once.
Not sure what is going on with this. Any ideas?
Thanks so much guys, below see my noob'd lua (Playing on a Lvl 75 capped server and I'm still pretty gimpo (To say the least)
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.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('None', 'Normal', 'Acc', 'DW')
state.CastingMode:options('Normal', 'Resistant', 'AF', 'Proc', 'HighMP')
state.IdleMode:options('Normal', 'HighMP')
state.MagicBurst = M(false, 'Magic Burst')
-- Additional local binds
send_command('bind end gs c cycle DefenseMode Physical; input /ja "Mana Wall" <me>')
send_command('bind delete input /ma "Stun" <t>')
select_default_macro_book()
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'] = {}
-- Fast cast sets for spells
-- No other FC sets necessary.
sets.precast.FC = {
main="Terra's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Sorcerer's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Grandiose Chain",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
-- Fast cast set while in HighMP casting mode to assist in maintaining 2000 MP for Death
sets.precast.FC.HighMP = {
main="Terra's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Sorcerer's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Grandiose Chain",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
sets.precast.FC['Dark Magic'] = sets.precast.FC
sets.precast.FC['Enhancing Magic'] = sets.precast.FC
sets.precast.FC['Enfeebling Magic'] = sets.precast.FC
sets.precast.FC['Elemental Magic'] = sets.precast.FC
sets.precast.FC.Cure = sets.precast.FC
sets.precast.FC.Curaga = sets.precast.FC.Cure
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {}
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS['Savage Blade'] = {}
-- Midcast Sets
sets.midcast.FastRecast = sets.precast.FC
sets.midcast.Cure = {
main="Light Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Sorcerer's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Grandiose Chain",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
sets.midcast.Cure.Self = {}
sets.midcast.Curaga = sets.midcast.Cure
sets.midcast['Enhancing Magic'] = {
main="Terra's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Sorcerer's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Enhancing Torque",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
sets.midcast.Aquaveil = {
main="Terra's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Sorcerer's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Enhancing Torque",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
sets.midcast.Stoneskin = {
main="Terra's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Errant Hpl.",
hands="Sorcerer's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Enhancing Torque",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
sets.midcast['Phalanx'] = {
main="Terra's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Sorcerer's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Enhancing Torque",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
sets.midcast['Sneak'] = {
main="Auster's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Sorcerer's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Enhancing Torque",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Skulker's Cape",
}
sets.midcast['Invisible'] = {
main="Auster's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Sorcerer's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Enhancing Torque",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Skulker's Cape",
}
sets.midcast['Enfeebling Magic'] = {
main="Terra's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Igqira Tiara",
body="Wizard's Coat",
hands="Errant Cuffs",
legs="Igqira Lappas",
feet="Wizard's Sabots",
neck="Enfeebling Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
sets.midcast['Dia'] = {
main="Light Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Sorcerer's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Grandiose Chain",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
sets.midcast['Dia II'] = {
main="Light Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Sorcerer's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Grandiose Chain",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
sets.midcast['Paralyze'] = {
main="Aquilo's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Igqira Tiara",
body="Wizard's Coat",
hands="Sorcerer's Gloves",
legs="Igqira Lappas",
feet="Errant Pigaches",
neck="Enfeebling Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Insomnia Earring",
left_ring="Saintly Ring",
right_ring="Saintly Ring",
back="Prism Cape",
}
sets.midcast['Slow'] = {
main="Terra's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Igqira Tiara",
body="Wizard's Coat",
hands="Sorcerer's Gloves",
legs="Igqira Lappas",
feet="Errant Pigaches",
neck="Enfeebling Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Insomnia Earring",
left_ring="Saintly Ring",
right_ring="Saintly Ring",
back="Prism Cape",
}
sets.midcast['Silence'] = {
main="Auster's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Igqira Tiara",
body="Wizard's Coat",
hands="Sorcerer's Gloves",
legs="Igqira Lappas",
feet="Errant Pigaches",
neck="Enfeebling Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Insomnia Earring",
left_ring="Saintly Ring",
right_ring="Saintly Ring",
back="Prism Cape",
}
sets.midcast['Blind'] = {
main="Pluto's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Igqira Tiara",
body="Wizard's Coat",
hands="Errant Cuffs",
legs="Igqira Lappas",
feet="Wizard's Sabots",
neck="Enfeebling Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Phantom Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Dispel'] = {
main="Pluto's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Igqira Tiara",
body="Wizard's Coat",
hands="Errant Cuffs",
legs="Igqira Lappas",
feet="Wizard's Sabots",
neck="Enfeebling Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Phantom Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Bind'] = {
main="Aquilo's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Igqira Tiara",
body="Wizard's Coat",
hands="Errant Cuffs",
legs="Igqira Lappas",
feet="Wizard's Sabots",
neck="Enfeebling Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Phantom Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Gravity'] = {
main="Auster's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Igqira Tiara",
body="Wizard's Coat",
hands="Errant Cuffs",
legs="Igqira Lappas",
feet="Wizard's Sabots",
neck="Enfeebling Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Phantom Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Sleep'] = {
main="Pluto's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Igqira Tiara",
body="Wizard's Coat",
hands="Errant Cuffs",
legs="Igqira Lappas",
feet="Wizard's Sabots",
neck="Enfeebling Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Phantom Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Sleep II'] = {
main="Pluto's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Igqira Tiara",
body="Wizard's Coat",
hands="Errant Cuffs",
legs="Igqira Lappas",
feet="Wizard's Sabots",
neck="Enfeebling Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Phantom Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Sleepga'] = {
main="Pluto's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Igqira Tiara",
body="Wizard's Coat",
hands="Errant Cuffs",
legs="Igqira Lappas",
feet="Wizard's Sabots",
neck="Enfeebling Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Phantom Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Sleepga II'] = {
main="Pluto's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Igqira Tiara",
body="Wizard's Coat",
hands="Errant Cuffs",
legs="Igqira Lappas",
feet="Wizard's Sabots",
neck="Enfeebling Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Phantom Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Poison'] = {
main="Neptune's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Igqira Tiara",
body="Wizard's Coat",
hands="Errant Cuffs",
legs="Igqira Lappas",
feet="Wizard's Sabots",
neck="Enfeebling Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Phantom Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Poison II'] = {
main="Neptune's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Igqira Tiara",
body="Wizard's Coat",
hands="Errant Cuffs",
legs="Igqira Lappas",
feet="Wizard's Sabots",
neck="Enfeebling Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Phantom Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Poisonga'] = {
main="Neptune's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Igqira Tiara",
body="Wizard's Coat",
hands="Errant Cuffs",
legs="Igqira Lappas",
feet="Wizard's Sabots",
neck="Enfeebling Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Phantom Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast.ElementalEnfeeble = sets.midcast['Elemental Magic']
sets.midcast['Burn'] = {
main="Vulcan's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Dark Magic'] = {
main="Terra's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Sorcerer's Gloves",
legs="Wizard's Tonban",
feet="Wizard's Sabots",
neck="Dark Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
sets.midcast.Drain = {
main="Pluto's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Sorcerer's Gloves",
legs="Wizard's Tonban",
feet="Wizard's Sabots",
neck="Dark Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Phantom Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast.Aspir = sets.midcast.Drain
sets.midcast.Stun = {
main="Jupiter's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Sorcerer's Gloves",
legs="Wizard's Tonban",
feet="Wizard's Sabots",
neck="Dark Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Phantom Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Bio'] = {
main="Pluto's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Sorcerer's Gloves",
legs="Wizard's Tonban",
feet="Wizard's Sabots",
neck="Dark Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Phantom Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Bio II'] = {
main="Pluto's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Sorcerer's Gloves",
legs="Wizard's Tonban",
feet="Wizard's Sabots",
neck="Dark Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Phantom Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast.BardSong = set_combine(sets.midcast['Enfeebling Magic'], {})
-- Elemental Magic sets
sets.midcast['Elemental Magic'] = {
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Elemental Magic'].Resistant = {
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Sorcerer's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Stone'] = {
main="Terra's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Stone II'] = {
main="Terra's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Stone III'] = {
main="Terra's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Stone IV'] = {
main="Terra's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Stonega'] = {
main="Terra's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Stonega II'] = {
main="Terra's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Stonega III'] = {
main="Terra's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Water'] = {
main="Neptune's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Water II'] = {
main="Neptune's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Water III'] = {
main="Neptune's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Water IV'] = {
main="Neptune's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Waterga'] = {
main="Neptune's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Waterga II'] = {
main="Neptune's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Waterga III'] = {
main="Neptune's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Aero'] = {
main="Auster's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Aero II'] = {
main="Auster's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Aero III'] = {
main="Auster's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Aero IV'] = {
main="Auster's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Aeroga'] = {
main="Auster's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Aeroga II'] = {
main="Auster's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Aeroga III'] = {
main="Auster's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Fire'] = {
main="Vulcan's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Fire II'] = {
main="Vulcan's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Fire III'] = {
main="Vulcan's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Fire IV'] = {
main="Vulcan's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Firaga'] = {
main="Vulcan's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Firaga II'] = {
main="Vulcan's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Firaga III'] = {
main="Vulcan's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Blizzard'] = {
main="Aquilo's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Blizzard II'] = {
main="Aquilo's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Blizzard III'] = {
main="Aquilo's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Blizzard IV'] = {
main="Aquilo's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Blizzaga'] = {
main="Aquilo's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Blizzaga II'] = {
main="Aquilo's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Blizzaga III'] = {
main="Aquilo's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Thunder'] = {
main="Jupiter's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Thunder II'] = {
main="Jupiter's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Thunder III'] = {
main="Jupiter's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Thunder IV'] = {
main="Jupiter's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Thundaga'] = {
main="Jupiter's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Thundaga II'] = {
main="Jupiter's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Thundaga III'] = {
main="Jupiter's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Flare'] = {
main="Vulcan's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Burst'] = {
main="Jupiter's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Burst II'] = {
main="Jupiter's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Freeze'] = {
main="Aquilo's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
sets.midcast['Freeze II'] = {
main="Aquilo's Staff",
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Wizard's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
-- Idle sets
-- Normal refresh idle set
sets.idle = {
main="Terra's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Sorcerer's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Grandiose Chain",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
-- Idle mode that keeps PDT gear on, but doesn't prevent normal gear swaps for precast/etc.
sets.idle.PDT = {
main="Terra's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Sorcerer's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Grandiose Chain",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
sets.idle.HighMP = {
main="Terra's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Sorcerer's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Grandiose Chain",
waist="Hierarch Belt",
left_ear="Phantom Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
-- Idle mode scopes:
-- Idle mode when weak.
sets.idle.Weak = {
main="Terra's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Sorcerer's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Grandiose Chain",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
-- Town gear.
sets.idle.Town = {
main="Terra's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Sorcerer's Petasos",
body="Sorcerer's Coat",
hands="Sorcerer's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Grandiose Chain",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
-- Defense sets
sets.defense.PDT = {
main="Terra's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Sorcerer's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Grandiose Chain",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
sets.defense.MDT = {
main="Terra's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Sorcerer's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Grandiose Chain",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
-- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
sets.buff['Mana Wall'] = {}
sets.magic_burst = {
sub="Bugard Strap +1",
ammo="Phantom Tathlum",
head="Wizard's Petasos",
body="Igqira Weskit",
hands="Sorcerer's Gloves",
legs="Mahatma Slops",
feet="Wizard's Sabots",
neck="Elemental Torque",
waist="Penitent's Rope",
left_ear="Phantom Earring",
right_ear="Moldavite Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
back="Prism Cape",
}
-- 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="Terra's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Wizard's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Grandiose Chain",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
sets.engaged.Acc = {
main="Terra's Staff",
sub="Raptor Strap +1",
ammo="Phantom Tathlum",
head="Walahra Turban",
body="Sorcerer's Coat",
hands="Wizard's Gloves",
legs="Vendor's Slops",
feet="Wizard's Sabots",
neck="Grandiose Chain",
waist="Hierarch Belt",
left_ear="Stoic Earring",
right_ear="Insomnia Earring",
left_ring="Demon's Ring +1",
right_ring="Demon's Ring +1",
back="Intensifying Cape",
}
sets.engaged.DW = {}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
-- 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 spellMap == 'Cure' and spell.target.type == 'SELF' then
equip(sets.midcast.CureSelf)
end
end
-- 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.
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
-- Handle notifications of general user state change.
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
function job_midcast(spell, action, spellMap, eventArgs)
end
function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.skill == 'Elemental Magic' and state.MagicBurst.value then
equip(sets.magic_burst)
end
end
function job_aftercast(spell, action, spellMap, eventArgs)
-- Lock feet after using Mana Wall.
if spell.english == 'Sleep' or spell.english == 'Sleepga' 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
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- Modify the default idle set after it was constructed.
function customize_idle_set(idleSet)
if S{"Southern San d'Oria","Northern San d'Oria","Port San d'Oria"}:contains(world.area) then
idleSet = set_combine(idleSet,{head="Sorcerer's Petasos",body="Kingdom Aketon"})
end
return idleSet
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.
-------------------------------------------------------------------------------------------------------------------
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
-- Default macro set/book
if player.sub_job == 'RDM' then
set_macro_page(1, 4)
elseif player.sub_job == 'WHM' then
set_macro_page(1, 4)
elseif player.sub_job == 'NIN' then
set_macro_page(1, 6)
else
set_macro_page(1, 4)
end
end
By Dubfire 2021-12-30 22:12:08
I got it all working!!
Thanks again everyone for your help
サーバ: Asura
Game: FFXI
Posts: 37
By Asura.Zigzagzig 2022-01-03 10:09:19
Hi,
i often got the page moved from my Macro Book, while holding too often CTR or ALT ><
Doesn't any one know a way to lock down a Page from a Macrobook ?
Knowing, than playing with that .... you risk to hit the Bug of Macrobook page deleted ...
Help or advice will be appreciated , thanks.
Carbuncle.Zlavnich
サーバ: Carbuncle
Game: FFXI
Posts: 2
By Carbuncle.Zlavnich 2022-01-08 13:13:11
Hi,
I'm hoping someone can help me out with my NIN.lua or possibly my Mote-Mappings.lua. Everything works how I want it to except for one thing that I can't figure out. My Enfeebling Ninjutsu set will never load, it loads my precast FC set, but than stays stuck on it while I'm casting Enfeebling Ninjutsu. Elemental, enhancing, WS, etc... sets all work flawlessly, just the enfeebling is giving me trouble.
I'll paste the code below for both the NIN and Mote-Mappings lua's, hopefully someone can spot the error.
Thanks in advance!
NIN.lua Code
-- Original: Motenten / Modified: Arislan
-- Haste/DW Detection Requires Gearinfo Addon
-------------------------------------------------------------------------------------------------------------------
-- Keybinds
-------------------------------------------------------------------------------------------------------------------
-- Modes: [ F9 ] Cycle Offense Modes
-- [ CTRL+F9 ] Cycle Hybrid Modes
-- [ WIN+F9 ] Cycle Weapon Skill Modes
-- [ F10 ] Emergency -PDT Mode
-- [ ALT+F10 ] Toggle Kiting Mode
-- [ F11 ] Emergency -MDT Mode
-- [ CTRL+F11 ] Cycle Casting Modes
-- [ F12 ] Update Current Gear / Report Current Status
-- [ CTRL+F12 ] Cycle Idle Modes
-- [ ALT+F12 ] Cancel Emergency -PDT/-MDT Mode
-- [ CTRL+` ] Toggle Treasure Hunter Mode
-- [ ALT+` ] Toggle Magic Burst Mode
-- [ WIN+C ] Toggle Capacity Points Mode
--
-- Abilities: [ CTRL+- ] Yonin
-- [ CTRL+= ] Innin
-- [ CTRL+Numpad/ ] Berserk
-- [ CTRL+Numpad* ] Warcry
-- [ CTRL+Numpad- ] Aggressor
--
-- Spells: [ WIN+, ] Utsusemi: Ichi
-- [ WIN+. ] Utsusemi: Ni
-- [ WIN+/ ] Utsusemi: San
-- [ ALT+, ] Monomi: Ichi
-- [ ALT+. ] Tonko: Ni
--
-- WS: [ CTRL+Numpad7 ] Blade: Kamu
-- [ CTRL+Numpad8 ] Blade: Shun
-- [ CTRL+Numpad4 ] Blade: Ten
-- [ CTRL+Numpad6 ] Blade: Hi
-- [ CTRL+Numpad1 ] Blade: Yu
--
--
-- (Global-Binds.lua contains additional non-job-related keybinds)
-------------------------------------------------------------------------------------------------------------------
-- 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.Migawari = buffactive.migawari or false
state.Buff.Doom = buffactive.doom or false
state.Buff.Yonin = buffactive.Yonin or false
state.Buff.Innin = buffactive.Innin or false
state.Buff.Futae = buffactive.Futae or false
state.Buff.Sange = buffactive.Sange or false
no_swap_gear = S{"Warp Ring", "Tavnazian Ring", "Dim. Ring (Dem)", "Dim. Ring (Holla)", "Dim. Ring (Mea)",
"Trizek Ring", "Echad Ring", "Facility Ring", "Capacity Ring", "Endorsement Ring", "Reraise Earring"}
include('Mote-TreasureHunter')
-- For th_action_check():
-- JA IDs for actions that always have TH: Provoke, Animated Flourish
info.default_ja_ids = S{35, 204}
-- Unblinkable JA IDs for actions that always have TH: Quick/Box/Stutter Step, Desperate/Violent Flourish
info.default_u_ja_ids = S{201, 202, 203, 205, 207}
lugra_ws = S{'Blade: Kamu', 'Blade: Shun', 'Blade: Ten'}
lockstyleset = 2
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', 'STP')
state.HybridMode:options('Normal', 'DT')
state.WeaponskillMode:options('Normal', 'Acc')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'DT')
state.PhysicalDefenseMode:options('PDT', 'Evasion')
state.WeaponSet = M{['description']='Weapon Set', 'Kikoku', 'Heishi', 'Hitaki', 'Tanking'}
state.WeaponLock = M(false, 'Weapon Lock')
state.MagicBurst = M(false, 'Magic Burst')
-- state.CP = M(false, "Capacity Points Mode")
options.ninja_tool_warning_limit = 10
-- Additional local binds
include('Global-Binds.lua') -- OK to remove this line
include('Global-GEO-Binds.lua') -- OK to remove this line
send_command('bind @t gs c cycle treasuremode')
send_command('bind !` gs c toggle MagicBurst')
send_command('bind ^- input /ja "Yonin" <me>')
send_command('bind ^= input /ja "Innin" <me>')
send_command('bind ^, input /nin "Monomi: Ichi" <me>')
send_command('bind ^. input /ma "Tonko: Ni" <me>')
send_command('bind @, input /ma "Utsusemi: Ichi" <me>')
send_command('bind @. input /ma "Utsusemi: Ni" <me>')
send_command('bind @/ input /ma "Utsusemi: San" <me>')
send_command('bind @w gs c toggle WeaponLock')
-- send_command('bind @c gs c toggle CP')
send_command('bind @e gs c cycleback WeaponSet')
send_command('bind @r gs c cycle WeaponSet')
send_command('bind ^numlock input /ja "Innin" <me>')
send_command('bind !numlock input /ja "Yonin" <me>')
if player.sub_job == 'WAR' then
send_command('bind ^numpad/ input /ja "Berserk" <me>')
send_command('bind !numpad/ input /ja "Defender" <me>')
send_command('bind ^numpad* input /ja "Warcry" <me>')
send_command('bind ^numpad- input /ja "Aggressor" <me>')
end
send_command('bind ^numpad7 input /ws "Blade: Metsu" <t>')
send_command('bind ^numpad8 input /ws "Blade: Shun" <t>')
send_command('bind ^numpad4 input /ws "Blade: Ten" <t>')
send_command('bind ^numpad6 input /ws "Blade: Hi" <t>')
send_command('bind ^numpad1 input /ws "Blade: Yu" <t>')
send_command('bind ^numpad2 input /ws "Blade: Chi" <t>')
-- Whether a warning has been given for low ninja tools
state.warned = M(false)
select_default_macro_book()
set_lockstyle()
state.Auto_Kite = M(false, 'Auto_Kite')
Haste = 0
DW_needed = 0
DW = false
moving = false
update_combat_form()
determine_haste_group()
end
function user_unload()
send_command('unbind ^`')
send_command('unbind !`')
send_command('unbind ^-')
send_command('unbind ^=')
send_command('unbind @/')
send_command('unbind @w')
-- send_command('unbind @c')
send_command('unbind @e')
send_command('unbind @r')
send_command('unbind @t')
send_command('unbind ^numlock')
send_command('unbind !numlock')
send_command('unbind ^numpad/')
send_command('unbind !numpad/')
send_command('unbind ^numpad*')
send_command('unbind ^numpad-')
send_command('unbind ^numpad+')
send_command('unbind !numpad+')
send_command('unbind ^numpad7')
send_command('unbind ^numpad8')
send_command('unbind ^numpad4')
send_command('unbind ^numpad6')
send_command('unbind ^numpad1')
send_command('unbind ^numpad2')
send_command('unbind #`')
send_command('unbind #1')
send_command('unbind #2')
send_command('unbind #3')
send_command('unbind #4')
send_command('unbind #5')
send_command('unbind #6')
send_command('unbind #7')
send_command('unbind #8')
send_command('unbind #9')
send_command('unbind #0')
end
-- Define sets and vars used by this job file.
function init_gear_sets()
--------------------------------------
-- Precast sets
--------------------------------------
-- Enmity set
sets.Enmity = {
ammo="Date Shuriken", --3
hands="Macabre Gauntlets", --6
neck="Ritter Gorget", --3
ear1="Trux Earring", --5
ear2="Eris' Earring", --2
ring1="Mermaid's Ring", --2
waist="Warwolf Belt", --3
}
sets.precast.JA['Provoke'] = sets.Enmity
sets.precast.JA['Mijin Gakure'] = {}
sets.precast.JA['Futae'] = {}
sets.precast.JA['Sange'] = {}
sets.precast.JA['Innin'] = {head="Mochizuki Hatsuburi +2",}
sets.precast.JA['Yonin'] = {head="Mochizuki Hatsuburi +2",}
sets.precast.Waltz = {}
sets.precast.Waltz['Healing Waltz'] = {}
-- Fast cast sets for spells
sets.precast.FC = {
head="Herculean Helm", --13
body="Taeon Tabard", --5
hands="Taeon Gloves", --5
legs="Gyve Trousers", --4
feet="Mummu Gamashes +2",
neck="Sanctity Necklace",
ear1="Loquacious Earring", --2
ring1="Mummu Ring",
ring2="Stikini Ring",
back={ name="Andartia's Mantle", augments={'HP+24','Eva.+20 /Mag. Eva.+20','"Fast Cast"+10',}}, --10
}
sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {
head="Herculean Helm", --13
body="Taeon Tabard", --5
hands="Taeon Gloves", --5
legs="Gyve Trousers", --4
ear1="Loquacious Earring", --2
back={ name="Andartia's Mantle", augments={'HP+24','Eva.+20 /Mag. Eva.+20','"Fast Cast"+10',}}, --10
})
sets.precast.RA = {}
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {
ammo="Aurgelmir Orb",
head="Kendatsuba Jinpachi +1",
body="Malignance Tabard",
hands="Malignance Gloves",
legs="Hiza. Hizayoroi +2",
feet="Kendatsuba Sune-ate +1",
neck="Ninja Nodowa +2",
waist="Sailfi Belt +1",
ear1="Lugra Earring +1",
ear2="Moonshade Earring",
ring1="Ramuh Ring",
ring2="Rajas Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10',}},
} -- default set
sets.precast.WS.Acc = set_combine(sets.precast.WS, {
})
sets.precast.WS['Blade: Hi'] = set_combine(sets.precast.WS, {
})
sets.precast.WS['Blade: Hi'].Acc = set_combine(sets.precast.WS['Blade: Hi'], {})
sets.precast.WS['Blade: Metsu'] = set_combine(sets.precast.WS, {
head="Mochizuki Hatsuburi +3",
body="Kendatsuba Samue +1",
hands="Adhemar Wristbands +1",
ear2="Odr Earring",
{ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','Weapon skill damage +10%',}},
})
sets.precast.WS['Blade: Metsu'].Acc = set_combine(sets.precast.WS['Blade: Metsu'], {})
sets.precast.WS['Blade: Ten'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Blade: Ten'].Acc = set_combine(sets.precast.WS['Blade: Ten'], {})
sets.precast.WS['Blade: Shun'] = set_combine(sets.precast.WS, {
head="Mochizuki Hatsuburi +3",
body="Kendatsuba Samue +1",
hands="Adhemar Wristbands +1",
legs="Kendatsuba Hakama +1",
neck="Breeze Gorget",
waist="Flame Belt",
ear2="Odr Earring",
})
sets.precast.WS['Blade: Shun'].Acc = set_combine(sets.precast.WS['Blade: Shun'], {})
sets.precast.WS['Blade: Ku'] = set_combine(sets.precast.WS['Blade: Shun'], {})
sets.precast.WS['Blade: Ku'].Acc = set_combine(sets.precast.WS['Blade: Ku'], {})
sets.precast.WS['Blade: Kamu'] = set_combine(sets.precast.WS, {})
sets.precast.WS['Blade: Yu'] = set_combine(sets.precast.WS, {})
sets.Lugra = {ear2="Lugra Earring +1"}
--------------------------------------
-- Midcast sets
--------------------------------------
sets.midcast.FastRecast = sets.precast.FC
sets.midcast.SpellInterrupt = {
ammo="Staunch Tathlum", --11
}
-- Specific spells
sets.midcast.Utsusemi = set_combine(sets.midcast.SpellInterrupt, {
head="Herculean Helm",
body="Taeon Tabard",
hands="Taeon Gloves",
legs="Gyve Trousers",
feet="Hattori Kyahan +1",
ear1="Loquacious Earring",
back={ name="Andartia's Mantle", augments={'HP+24','Eva.+20 /Mag. Eva.+20','"Fast Cast"+10',}},
})
sets.midcast.ElementalNinjutsu = {
ammo="Seething Bomblet",
head="Mochizuki Hatsuburi +3",
body="Rawhide Vest",
hands="Taeon Gloves",
legs="Gyve Trousers",
feet="Hachiya Kyahan +2",
neck="Sanctity Necklace",
--waist="Eschan Stone",
ear1="Hectate's Earring",
ear2="Friomisi Earring",
ring1="Shiva Ring +1",
ring2="Shiva Ring +1",
back={ name="Andartia's Mantle", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10',}},
}
sets.midcast.ElementalNinjutsu.Resistant = set_combine(sets.midcast.Ninjutsu, {})
sets.midcast.EnfeeblingNinjutsu = {
ammo="Seething Bomblet",
head="Mummu Bonnet +1",
body="Malignance Tabard",
hands="Malignance Gloves",
legs="Mummu Kecks +1",
feet="Hachiya Kyahan +2",
neck="Henic Torque",
--waist="Eschan Stone",
ear1="Lifestorm Earring",
ear2="Psystorm Earring",
ring1="Mummu Ring",
ring2="Stikini Ring",
back={ name="Andartia's Mantle", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10',}},
}
sets.midcast.EnhancingNinjutsu = {
head="Herculean Helm",
body="Taeon Tabard",
hands="Taeon Gloves",
ear1="Loquacious Earring",
ring2="Stikini Ring",
back={ name="Andartia's Mantle", augments={'HP+24','Eva.+20 /Mag. Eva.+20','"Fast Cast"+10',}},
}
sets.midcast.Stun = sets.midcast.EnfeeblingNinjutsu
sets.midcast.RA = {}
--------------------------------------
-- Idle/resting/defense/etc sets
--------------------------------------
-- Resting sets
-- sets.resting = {}
-- Idle sets
sets.idle = {
ammo="Date Shuriken",
head="Adhemar Bonnet +1",
body="Malignance Tabard",
hands="Malignance Gloves",
legs="Kendatsuba Hakama +1",
feet="Hachiya Kyahan +2",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Cessance Earring",
ear2="Brutal Earring",
ring1="Shneddick Ring",
ring2="Defending Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10',}},
}
sets.idle.DT = set_combine(sets.idle, {})
sets.idle.Town = set_combine(sets.idle, {})
-- Defense sets
sets.defense.PDT = sets.idle.DT
sets.defense.MDT = sets.idle.DT
sets.Kiting = {ring1="Shneddick Ring"}
sets.DayMovement = {}
sets.NightMovement = {feet="Hachiya Kyahan +1"}
--------------------------------------
-- Engaged sets
--------------------------------------
-- Engaged sets
-- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
-- sets if more refined versions aren't defined.
-- If you create a set with both offense and defense modes, the offense mode should be first.
-- EG: sets.engaged.Dagger.Accuracy.Evasion
-- * NIN Native DW Trait: 35% DW
-- No Magic Haste (74% DW to cap)
sets.engaged = {
ammo="Date Shuriken",
head="Adhemar Bonnet +1",
body="Kendatsuba Samue +1",
hands="Adhemar Wristbands +1",
legs="Kendatsuba Hakama +1",
feet="Hizamaru Sune-ate +2",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Suppanomimi",
ear2="Eabani Earring",
ring1="Hizamaru Ring",
ring2="Rajas Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10',}},
}
sets.engaged.LowAcc = set_combine(sets.engaged, {
ammo="Date Shuriken",
head="Kendatsuba Jinpachi +1",
body="Kendatsuba Samue +1",
hands="Kendatsuba Tekko +1",
legs="Kendatsuba Hakama +1",
feet="Kendatsuba Sune-ate +1",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Suppanomimi",
ear2="Eabani Earring",
ring1="Hizamaru Ring",
ring2="Rajas Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10',}},
})
sets.engaged.MidAcc = set_combine(sets.engaged.LowAcc, {
ammo="Date Shuriken",
head="Kendatsuba Jinpachi +1",
body="Kendatsuba Samue +1",
hands="Kendatsuba Tekko +1",
legs="Kendatsuba Hakama +1",
feet="Kendatsuba Sune-ate +1",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Suppanomimi",
ear2="Eabani Earring",
ring1="Hizamaru Ring",
ring2="Defending Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10',}},
})
sets.engaged.HighAcc = set_combine(sets.engaged.MidAcc, {
ammo="Date Shuriken",
head="Kendatsuba Jinpachi +1",
body="Malignance Tabard",
hands="Malignance Gloves",
legs="Kendatsuba Hakama +1",
feet="Kendatsuba Sune-ate +1",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Suppanomimi",
ear2="Eabani Earring",
ring1="Hizamaru Ring",
ring2="Defending Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10',}},
})
sets.engaged.STP = set_combine(sets.engaged, {})
-- 15% Magic Haste (67% DW to cap)
sets.engaged.LowHaste = {
ammo="Date Shuriken",
head="Adhemar Bonnet +1",
body="Kendatsuba Samue +1",
hands="Adhemar Wristbands +1",
legs="Kendatsuba Hakama +1",
feet="Hizamaru Sune-ate +2",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Suppanomimi",
ear2="Eabani Earring",
ring1="Hizamaru Ring",
ring2="Rajas Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10',}},
}
sets.engaged.LowAcc.LowHaste = set_combine(sets.engaged.LowHaste, {
ammo="Date Shuriken",
head="Kendatsuba Jinpachi +1",
body="Kendatsuba Samue +1",
hands="Kendatsuba Tekko +1",
legs="Kendatsuba Hakama +1",
feet="Kendatsuba Sune-ate +1",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Suppanomimi",
ear2="Eabani Earring",
ring1="Hizamaru Ring",
ring2="Rajas Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10',}},
})
sets.engaged.MidAcc.LowHaste = set_combine(sets.engaged.LowAcc.LowHaste, {
ammo="Date Shuriken",
head="Kendatsuba Jinpachi +1",
body="Kendatsuba Samue +1",
hands="Kendatsuba Tekko +1",
legs="Kendatsuba Hakama +1",
feet="Kendatsuba Sune-ate +1",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Suppanomimi",
ear2="Eabani Earring",
ring1="Hizamaru Ring",
ring2="Defending Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10',}},
})
sets.engaged.HighAcc.LowHaste = set_combine(sets.engaged.LowAcc.LowHaste, {
ammo="Date Shuriken",
head="Kendatsuba Jinpachi +1",
body="Malignance Tabard",
hands="Malignance Gloves",
legs="Kendatsuba Hakama +1",
feet="Kendatsuba Sune-ate +1",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Suppanomimi",
ear2="Eabani Earring",
ring1="Hizamaru Ring",
ring2="Defending Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10',}},
})
sets.engaged.STP.LowHaste = set_combine(sets.engaged.LowHaste, {})
-- 30% Magic Haste (56% DW to cap)
sets.engaged.MidHaste = {
ammo="Date Shuriken",
head="Adhemar Bonnet +1",
body="Kendatsuba Samue +1",
hands="Adhemar Wristbands +1",
legs="Kendatsuba Hakama +1",
feet="Hizamaru Sune-ate +2",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Suppanomimi",
ear2="Eabani Earring",
ring1="Hizamaru Ring",
ring2="Rajas Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10',}},
}
sets.engaged.LowAcc.MidHaste = set_combine(sets.engaged.MidHaste, {
ammo="Date Shuriken",
head="Kendatsuba Jinpachi +1",
body="Kendatsuba Samue +1",
hands="Kendatsuba Tekko +1",
legs="Kendatsuba Hakama +1",
feet="Kendatsuba Sune-ate +1",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Suppanomimi",
ear2="Eabani Earring",
ring1="Hizamaru Ring",
ring2="Rajas Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10',}},
})
sets.engaged.MidAcc.MidHaste = set_combine(sets.engaged.LowAcc.MidHaste, {
ammo="Date Shuriken",
head="Kendatsuba Jinpachi +1",
body="Kendatsuba Samue +1",
hands="Kendatsuba Tekko +1",
legs="Kendatsuba Hakama +1",
feet="Kendatsuba Sune-ate +1",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Suppanomimi",
ear2="Eabani Earring",
ring1="Hizamaru Ring",
ring2="Defending Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10',}},
})
sets.engaged.HighAcc.MidHaste = set_combine(sets.engaged.MidHaste.MidAcc, {
ammo="Date Shuriken",
head="Kendatsuba Jinpachi +1",
body="Malignance Tabard",
hands="Malignance Gloves",
legs="Kendatsuba Hakama +1",
feet="Kendatsuba Sune-ate +1",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Suppanomimi",
ear2="Eabani Earring",
ring1="Hizamaru Ring",
ring2="Defending Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10',}},
})
sets.engaged.STP.MidHaste = set_combine(sets.engaged.MidHaste, {})
-- 35% Magic Haste (51% DW to cap)
sets.engaged.HighHaste = {
ammo="Date Shuriken",
head="Adhemar Bonnet +1",
body="Kendatsuba Samue +1",
hands="Adhemar Wristbands +1",
legs="Kendatsuba Hakama +1",
feet="Hizamaru Sune-ate +2",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Cessance Earring",
ear2="Brutal Earring",
ring1="Hizamaru Ring",
ring2="Rajas Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+8','"Store TP"+10',}},
}
sets.engaged.LowAcc.HighHaste = set_combine(sets.engaged.HighHaste, {
ammo="Date Shuriken",
head="Kendatsuba Jinpachi +1",
body="Kendatsuba Samue +1",
hands="Kendatsuba Tekko +1",
legs="Kendatsuba Hakama +1",
feet="Kendatsuba Sune-ate +1",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Suppanomimi",
ear2="Brutal Earring",
ring1="Hizamaru Ring",
ring2="Rajas Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+8','"Store TP"+10',}},
})
sets.engaged.MidAcc.HighHaste = set_combine(sets.engaged.LowAcc.HighHaste, {
ammo="Date Shuriken",
head="Kendatsuba Jinpachi +1",
body="Kendatsuba Samue +1",
hands="Kendatsuba Tekko +1",
legs="Kendatsuba Hakama +1",
feet="Kendatsuba Sune-ate +1",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Suppanomimi",
ear2="Brutal Earring",
ring1="Hizamaru Ring",
ring2="Defending Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+8','"Store TP"+10',}},
})
sets.engaged.HighAcc.HighHaste = set_combine(sets.engaged.MidAcc.HighHaste, {
ammo="Date Shuriken",
head="Kendatsuba Jinpachi +1",
body="Malignance Tabard",
hands="Malignance Gloves",
legs="Kendatsuba Hakama +1",
feet="Kendatsuba Sune-ate +1",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Suppanomimi",
ear2="Eabani Earring",
ring1="Hizamaru Ring",
ring2="Defending Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10',}},
})
sets.engaged.STP.HighHaste = set_combine(sets.engaged.HighHaste, {})
-- 45% Magic Haste (36% DW to cap)
sets.engaged.MaxHaste = {
ammo="Date Shuriken",
head="Adhemar Bonnet +1",
body="Kendatsuba Samue +1",
hands="Adhemar Wristbands +1",
legs="Kendatsuba Hakama +1",
feet="Kendatsuba Sune-ate +1",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Cessance Earring",
ear2="Brutal Earring",
ring1="Hizamaru Ring",
ring2="Rajas Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+8','"Store TP"+10',}},
}
sets.engaged.LowAcc.MaxHaste = set_combine(sets.engaged.MaxHaste, {
ammo="Date Shuriken",
head="Kendatsuba Jinpachi +1",
body="Kendatsuba Samue +1",
hands="Kendatsuba Tekko +1",
legs="Kendatsuba Hakama +1",
feet="Kendatsuba Sune-ate +1",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Cessance Earring",
ear2="Brutal Earring",
ring1="Hizamaru Ring",
ring2="Rajas Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+8','"Store TP"+10',}},
})
sets.engaged.MidAcc.MaxHaste = set_combine(sets.engaged.LowAcc.MaxHaste, {
ammo="Date Shuriken",
head="Kendatsuba Jinpachi +1",
body="Kendatsuba Samue +1",
hands="Kendatsuba Tekko +1",
legs="Kendatsuba Hakama +1",
feet="Kendatsuba Sune-ate +1",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Suppanomimi",
ear2="Brutal Earring",
ring1="Hizamaru Ring",
ring2="Defending Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+8','"Store TP"+10',}},
})
sets.engaged.HighAcc.MaxHaste = set_combine(sets.engaged.MidAcc.MaxHaste, {
ammo="Date Shuriken",
head="Kendatsuba Jinpachi +1",
body="Malignance Tabard",
hands="Malignance Gloves",
legs="Kendatsuba Hakama +1",
feet="Kendatsuba Sune-ate +1",
neck="Ninja Nodowa +2",
waist="Windbuffet Belt +1",
ear1="Suppanomimi",
ear2="Eabani Earring",
ring1="Hizamaru Ring",
ring2="Defending Ring",
back={ name="Andartia's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10',}},
})
sets.engaged.STP.MaxHaste = set_combine(sets.engaged.MaxHaste, {})
sets.engaged.Hybrid = {}
sets.engaged.DT = set_combine(sets.engaged, sets.engaged.Hybrid)
sets.engaged.LowAcc.DT = set_combine(sets.engaged.LowAcc, sets.engaged.Hybrid)
sets.engaged.MidAcc.DT = set_combine(sets.engaged.MidAcc, sets.engaged.Hybrid)
sets.engaged.HighAcc.DT = set_combine(sets.engaged.HighAcc, sets.engaged.Hybrid)
sets.engaged.STP.DT = set_combine(sets.engaged.STP, sets.engaged.Hybrid)
sets.engaged.DT.LowHaste = set_combine(sets.engaged.LowHaste, sets.engaged.Hybrid)
sets.engaged.LowAcc.DT.LowHaste = set_combine(sets.engaged.LowAcc.LowHaste, sets.engaged.Hybrid)
sets.engaged.MidAcc.DT.LowHaste = set_combine(sets.engaged.MidAcc.LowHaste, sets.engaged.Hybrid)
sets.engaged.HighAcc.DT.LowHaste = set_combine(sets.engaged.HighAcc.LowHaste, sets.engaged.Hybrid)
sets.engaged.STP.DT.LowHaste = set_combine(sets.engaged.STP.LowHaste, sets.engaged.Hybrid)
sets.engaged.DT.MidHaste = set_combine(sets.engaged.MidHaste, sets.engaged.Hybrid)
sets.engaged.LowAcc.DT.MidHaste = set_combine(sets.engaged.LowAcc.MidHaste, sets.engaged.Hybrid)
sets.engaged.MidAcc.DT.MidHaste = set_combine(sets.engaged.MidAcc.MidHaste, sets.engaged.Hybrid)
sets.engaged.HighAcc.DT.MidHaste = set_combine(sets.engaged.HighAcc.MidHaste, sets.engaged.Hybrid)
sets.engaged.STP.DT.MidHaste = set_combine(sets.engaged.STP.MidHaste, sets.engaged.Hybrid)
sets.engaged.DT.HighHaste = set_combine(sets.engaged.HighHaste, sets.engaged.Hybrid)
sets.engaged.LowAcc.DT.HighHaste = set_combine(sets.engaged.LowAcc.HighHaste, sets.engaged.Hybrid)
sets.engaged.MidAcc.DT.HighHaste = set_combine(sets.engaged.MidAcc.HighHaste, sets.engaged.Hybrid)
sets.engaged.HighAcc.DT.HighHaste = set_combine(sets.engaged.HighAcc.HighHaste, sets.engaged.Hybrid)
sets.engaged.STP.DT.HighHaste = set_combine(sets.engaged.HighHaste.STP, sets.engaged.Hybrid)
sets.engaged.DT.MaxHaste = set_combine(sets.engaged.MaxHaste, sets.engaged.Hybrid)
sets.engaged.LowAcc.DT.MaxHaste = set_combine(sets.engaged.LowAcc.MaxHaste, sets.engaged.Hybrid)
sets.engaged.MidAcc.DT.MaxHaste = set_combine(sets.engaged.MidAcc.MaxHaste, sets.engaged.Hybrid)
sets.engaged.HighAcc.DT.MaxHaste = set_combine(sets.engaged.HighAcc.MaxHaste, sets.engaged.Hybrid)
sets.engaged.STP.DT.MaxHaste = set_combine(sets.engaged.STP.MaxHaste, sets.engaged.Hybrid)
--------------------------------------
-- Custom buff sets
--------------------------------------
sets.buff.Migawari = {}
sets.buff.Yonin = {head="Mochizuki Hatsuburi +1",}
sets.buff.Innin = {head="Mochizuki Hatsuburi +1",}
sets.buff.Sange = {}
sets.magic_burst = {}
-- sets.buff.Migawari = {body="Iga Ningi +2"}
sets.buff.Doom = {}
-- sets.CP = {back="Mecisto. Mantle"}
sets.TreasureHunter = {
head="White Rarab Cap +1",
ammo="Perfect Lucky Egg",
}
--sets.Reive = {neck="Ygnas's Resolve +1"}
sets.Kikoku = {}
sets.Heishi = {}
sets.Hitaki = {}
sets.Tanking = {}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
function job_precast(spell, action, spellMap, eventArgs)
if spell.skill == "Ninjutsu" then
do_ninja_tool_checks(spell, spellMap, eventArgs)
end
if spellMap == 'Utsusemi' then
if buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)'] then
cancel_spell()
add_to_chat(123, '**!! '..spell.english..' Canceled: [3+ IMAGES] !!**')
eventArgs.handled = true
return
elseif buffactive['Copy Image'] or buffactive['Copy Image (2)'] then
send_command('cancel 66; cancel 444; cancel Copy Image; cancel Copy Image (2)')
end
end
end
function job_post_precast(spell, action, spellMap, eventArgs)
if spell.type == 'WeaponSkill' then
if lugra_ws:contains(spell.english) and (world.time >= (17*60) or world.time <= (7*60)) then
equip(sets.Lugra)
end
if spell.english == 'Blade: Yu' and (world.weather_element == 'Water' or world.day_element == 'Water') then
equip(sets.Obi)
end
end
end
-- Run after the general 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 spellMap == 'ElementalNinjutsu' 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(sets.Obi)
end
if state.Buff.Futae then
equip(sets.precast.JA['Futae'])
end
end
if state.Buff.Doom then
equip(sets.buff.Doom)
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 not spell.interrupted and spell.english == "Migawari: Ichi" then
state.Buff.Migawari = true
end
if player.status ~= 'Engaged' and state.WeaponLock.value == false then
check_weaponset()
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 buffactive['Reive Mark'] then
-- if gain then
-- equip(sets.Reive)
-- disable('neck')
-- else
-- enable('neck')
-- end
-- end
if buff == "Migawari" and not gain then
add_to_chat(61, "*** MIGAWARI DOWN ***")
end
if buff == "doom" then
if gain then
equip(sets.buff.Doom)
send_command('@input /p Doomed.')
disable('ring1','ring2','waist')
else
enable('ring1','ring2','waist')
handle_equipping_gear(player.status)
end
end
end
-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
if state.WeaponLock.value == true then
disable('main','sub')
else
enable('main','sub')
end
check_weaponset()
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- 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_handle_equipping_gear(playerStatus, eventArgs)
check_gear()
update_combat_form()
determine_haste_group()
check_moving()
end
function job_update(cmdParams, eventArgs)
handle_equipping_gear(player.status)
th_update(cmdParams, eventArgs)
end
function update_combat_form()
if DW == true then
state.CombatForm:set('DW')
elseif DW == false then
state.CombatForm:reset()
end
end
function get_custom_wsmode(spell, action, spellMap)
local wsmode
if state.OffenseMode.value == 'MidAcc' or state.OffenseMode.value == 'HighAcc' then
wsmode = 'Acc'
end
return wsmode
end
-- Modify the default idle set after it was constructed.
function customize_idle_set(idleSet)
if state.Buff.Migawari then
idleSet = set_combine(idleSet, sets.buff.Migawari)
end
-- if state.CP.current == 'on' then
-- equip(sets.CP)
-- disable('back')
-- else
-- enable('back')
-- end
if state.Auto_Kite.value == true then
if world.time >= (17*60) or world.time <= (7*60) then
idleSet = set_combine(idleSet, sets.NightMovement)
else
idleSet = set_combine(idleSet, sets.DayMovement)
end
end
return idleSet
end
-- Modify the default melee set after it was constructed.
function customize_melee_set(meleeSet)
if state.Buff.Migawari then
meleeSet = set_combine(meleeSet, sets.buff.Migawari)
end
if state.TreasureMode.value == 'Fulltime' then
meleeSet = set_combine(meleeSet, sets.TreasureHunter)
end
if state.Buff.Sange then
meleeSet = set_combine(meleeSet, sets.buff.Sange)
end
check_weaponset()
return meleeSet
end
-- Function to display the current relevant user state when doing an update.
function display_current_job_state(eventArgs)
local cf_msg = ''
if state.CombatForm.has_value then
cf_msg = ' (' ..state.CombatForm.value.. ')'
end
local m_msg = state.OffenseMode.value
if state.HybridMode.value ~= 'Normal' then
m_msg = m_msg .. '/' ..state.HybridMode.value
end
local ws_msg = state.WeaponskillMode.value
local c_msg = state.CastingMode.value
local d_msg = 'None'
if state.DefenseMode.value ~= 'None' then
d_msg = state.DefenseMode.value .. state[state.DefenseMode.value .. 'DefenseMode'].value
end
local i_msg = state.IdleMode.value
local msg = ''
if state.TreasureMode.value == 'Tag' then
msg = msg .. ' TH: Tag |'
end
if state.MagicBurst.value then
msg = ' Burst: On |'
end
if state.Kiting.value then
msg = msg .. ' Kiting: On |'
end
add_to_chat(002, '| ' ..string.char(31,210).. 'Melee' ..cf_msg.. ': ' ..string.char(31,001)..m_msg.. string.char(31,002).. ' |'
..string.char(31,207).. ' WS: ' ..string.char(31,001)..ws_msg.. string.char(31,002).. ' |'
..string.char(31,060).. ' Magic: ' ..string.char(31,001)..c_msg.. string.char(31,002).. ' |'
..string.char(31,004).. ' Defense: ' ..string.char(31,001)..d_msg.. string.char(31,002).. ' |'
..string.char(31,008).. ' Idle: ' ..string.char(31,001)..i_msg.. string.char(31,002).. ' |'
..string.char(31,002)..msg)
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function check_moving()
if state.DefenseMode.value == 'None' and state.Kiting.value == false then
if state.Auto_Kite.value == false and moving then
state.Auto_Kite:set(true)
elseif state.Auto_Kite.value == true and moving == false then
state.Auto_Kite:set(false)
end
end
end
function determine_haste_group()
classes.CustomMeleeGroups:clear()
if DW == true then
if DW_needed <= 1 then
classes.CustomMeleeGroups:append('MaxHaste')
elseif DW_needed > 1 and DW_needed <= 16 then
classes.CustomMeleeGroups:append('HighHaste')
elseif DW_needed > 16 and DW_needed <= 21 then
classes.CustomMeleeGroups:append('MidHaste')
elseif DW_needed > 21 and DW_needed <= 34 then
classes.CustomMeleeGroups:append('LowHaste')
elseif DW_needed > 34 then
classes.CustomMeleeGroups:append('')
end
end
end
function job_self_command(cmdParams, eventArgs)
gearinfo(cmdParams, eventArgs)
end
function gearinfo(cmdParams, eventArgs)
if cmdParams[1] == 'gearinfo' then
if type(tonumber(cmdParams[2])) == 'number' then
if tonumber(cmdParams[2]) ~= DW_needed then
DW_needed = tonumber(cmdParams[2])
DW = true
end
elseif type(cmdParams[2]) == 'string' then
if cmdParams[2] == 'false' then
DW_needed = 0
DW = false
end
end
if type(tonumber(cmdParams[3])) == 'number' then
if tonumber(cmdParams[3]) ~= Haste then
Haste = tonumber(cmdParams[3])
end
end
if type(cmdParams[4]) == 'string' then
if cmdParams[4] == 'true' then
moving = true
elseif cmdParams[4] == 'false' then
moving = false
end
end
if not midaction() then
job_update()
end
end
end
-- Determine whether we have sufficient tools for the spell being attempted.
function do_ninja_tool_checks(spell, spellMap, eventArgs)
local ninja_tool_name
local ninja_tool_min_count = 1
-- Only checks for universal tools and shihei
if spell.skill == "Ninjutsu" then
if spellMap == 'Utsusemi' then
ninja_tool_name = "Shihei"
elseif spellMap == 'ElementalNinjutsu' then
ninja_tool_name = "Inoshishinofuda"
elseif spellMap == 'EnfeeblingNinjutsu' then
ninja_tool_name = "Chonofuda"
elseif spellMap == 'EnhancingNinjutsu' then
ninja_tool_name = "Shikanofuda"
else
return
end
end
local available_ninja_tools = player.inventory[ninja_tool_name] or player.wardrobe[ninja_tool_name]
-- If no tools are available, end.
if not available_ninja_tools then
if spell.skill == "Ninjutsu" then
return
end
end
-- Low ninja tools warning.
if spell.skill == "Ninjutsu" and state.warned.value == false
and available_ninja_tools.count > 1 and available_ninja_tools.count <= options.ninja_tool_warning_limit then
local msg = '***** LOW TOOLS WARNING: '..ninja_tool_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_ninja_tools.count > options.ninja_tool_warning_limit and state.warned then
state.warned:reset()
end
end
-- Check for various actions that we've specified in user code as being used with TH gear.
-- This will only ever be called if TreasureMode is not 'None'.
-- Category and Param are as specified in the action event packet.
function th_action_check(category, param)
if category == 2 or -- any ranged attack
--category == 4 or -- any magic action
(category == 3 and param == 30) or -- Aeolian Edge
(category == 6 and info.default_ja_ids:contains(param)) or -- Provoke, Animated Flourish
(category == 14 and info.default_u_ja_ids:contains(param)) -- Quick/Box/Stutter Step, Desperate/Violent Flourish
then return true
end
end
function check_gear()
if no_swap_gear:contains(player.equipment.left_ring) then
disable("ring1")
else
enable("ring1")
end
if no_swap_gear:contains(player.equipment.right_ring) then
disable("ring2")
else
enable("ring2")
end
end
function check_weaponset()
equip(sets[state.WeaponSet.current])
if player.sub_job ~= 'NIN' and player.sub_job ~= 'DNC' then
equip(sets.DefaultShield)
end
end
windower.register_event('zone change',
function()
if no_swap_gear:contains(player.equipment.left_ring) then
enable("ring1")
equip(sets.idle)
end
if no_swap_gear:contains(player.equipment.right_ring) then
enable("ring2")
equip(sets.idle)
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, 3)
elseif player.sub_job == 'THF' then
set_macro_page(3, 3)
else
set_macro_page(1, 3)
end
end
function set_lockstyle()
send_command('wait 2; input /lockstyleset ' .. lockstyleset)
end
Carbuncle.Zlavnich
サーバ: Carbuncle
Game: FFXI
Posts: 2
By Carbuncle.Zlavnich 2022-01-08 13:13:49
Mote-Mappings.lua
Code
-------------------------------------------------------------------------------------------------------------------
-- Mappings, lists and sets to describe game relationships that aren't easily determinable otherwise.
-------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------
-- Elemental mappings for element relationships and certain types of spells and gear.
-------------------------------------------------------------------------------------------------------------------
-- Basic elements
elements = {}
elements.list = S{'Light','Dark','Fire','Ice','Wind','Earth','Lightning','Water'}
elements.weak_to = {['Light']='Dark', ['Dark']='Light', ['Fire']='Ice', ['Ice']='Wind', ['Wind']='Earth', ['Earth']='Lightning',
['Lightning']='Water', ['Water']='Fire'}
elements.strong_to = {['Light']='Dark', ['Dark']='Light', ['Fire']='Water', ['Ice']='Fire', ['Wind']='Ice', ['Earth']='Wind',
['Lightning']='Earth', ['Water']='Lightning'}
storms = S{"Aurorastorm", "Voidstorm", "Firestorm", "Sandstorm", "Rainstorm", "Windstorm", "Hailstorm", "Thunderstorm",
"Aurorastorm II", "Voidstorm II", "Firestorm II", "Sandstorm II", "Rainstorm II", "Windstorm II", "Hailstorm II", "Thunderstorm II"}
elements.storm_of = {['Light']="Aurorastorm", ['Dark']="Voidstorm", ['Fire']="Firestorm", ['Earth']="Sandstorm",
['Water']="Rainstorm", ['Wind']="Windstorm", ['Ice']="Hailstorm", ['Lightning']="Thunderstorm",['Light']="Aurorastorm II",
['Dark']="Voidstorm II", ['Fire']="Firestorm II", ['Earth']="Sandstorm II", ['Water']="Rainstorm II", ['Wind']="Windstorm II",
['Ice']="Hailstorm II", ['Lightning']="Thunderstorm II"}
spirits = S{"LightSpirit", "DarkSpirit", "FireSpirit", "EarthSpirit", "WaterSpirit", "AirSpirit", "IceSpirit", "ThunderSpirit"}
elements.spirit_of = {['Light']="Light Spirit", ['Dark']="Dark Spirit", ['Fire']="Fire Spirit", ['Earth']="Earth Spirit",
['Water']="Water Spirit", ['Wind']="Air Spirit", ['Ice']="Ice Spirit", ['Lightning']="Thunder Spirit"}
runes = S{'Lux', 'Tenebrae', 'Ignis', 'Gelus', 'Flabra', 'Tellus', 'Sulpor', 'Unda'}
elements.rune_of = {['Light']='Lux', ['Dark']='Tenebrae', ['Fire']='Ignis', ['Ice']='Gelus', ['Wind']='Flabra',
['Earth']='Tellus', ['Lightning']='Sulpor', ['Water']='Unda'}
elements.obi_of = {['Light']='Hachirin-no-obi', ['Dark']='Hachirin-no-obi', ['Fire']='Hachirin-no-obi', ['Ice']='Hachirin-no-obi', ['Wind']='Hachirin-no-obi',
['Earth']='Hachirin-no-obi', ['Lightning']='Hachirin-no-obi', ['Water']='Hachirin-no-obi'}
elements.gorget_of = {['Light']='Fotia Gorget', ['Dark']='Fotia Gorget', ['Fire']='Fotia Gorget', ['Ice']='Fotia Gorget',
['Wind']='Fotia Gorget', ['Earth']='Fotia Gorget', ['Lightning']='Fotia Gorget', ['Water']='Fotia Gorget'}
elements.belt_of = {['Light']='Fotia Belt', ['Dark']='Fotia Belt', ['Fire']='Fotia Belt', ['Ice']='Fotia Belt',
['Wind']='Fotia Belt', ['Earth']='Fotia Belt', ['Lightning']='Fotia Belt', ['Water']='Fotia Belt'}
elements.fastcast_staff_of = {['Light']='Arka I', ['Dark']='Xsaeta I', ['Fire']='Atar I', ['Ice']='Vourukasha I',
['Wind']='Vayuvata I', ['Earth']='Vishrava I', ['Lightning']='Apamajas I', ['Water']='Haoma I', ['Thunder']='Apamajas I'}
elements.recast_staff_of = {['Light']='Arka II', ['Dark']='Xsaeta II', ['Fire']='Atar II', ['Ice']='Vourukasha II',
['Wind']='Vayuvata II', ['Earth']='Vishrava II', ['Lightning']='Apamajas II', ['Water']='Haoma II', ['Thunder']='Apamajas II'}
elements.perpetuance_staff_of = {['Light']='Arka III', ['Dark']='Xsaeta III', ['Fire']='Atar III', ['Ice']='Vourukasha III',
['Wind']='Vayuvata III', ['Earth']='Vishrava III', ['Lightning']='Apamajas III', ['Water']='Haoma III', ['Thunder']='Apamajas III'}
-- Elements for skillchain names
skillchain_elements = {}
skillchain_elements.Light = S{'Light','Fire','Wind','Lightning'}
skillchain_elements.Darkness = S{'Dark','Ice','Earth','Water'}
skillchain_elements.Fusion = S{'Light','Fire'}
skillchain_elements.Fragmentation = S{'Wind','Lightning'}
skillchain_elements.Distortion = S{'Ice','Water'}
skillchain_elements.Gravitation = S{'Dark','Earth'}
skillchain_elements.Transfixion = S{'Light'}
skillchain_elements.Compression = S{'Dark'}
skillchain_elements.Liquification = S{'Fire'}
skillchain_elements.Induration = S{'Ice'}
skillchain_elements.Detonation = S{'Wind'}
skillchain_elements.Scission = S{'Earth'}
skillchain_elements.Impaction = S{'Lightning'}
skillchain_elements.Reverberation = S{'Water'}
-------------------------------------------------------------------------------------------------------------------
-- Mappings for weaponskills
-------------------------------------------------------------------------------------------------------------------
-- REM weapons and their corresponding weaponskills
data = {}
data.weaponskills = {}
data.weaponskills.relic = {
["Spharai"] = "Final Heaven",
["Mandau"] = "Mercy Stroke",
["Excalibur"] = "Knights of Round",
["Ragnarok"] = "Scourge",
["Guttler"] = "Onslaught",
["Bravura"] = "Metatron Torment",
["Apocalypse"] = "Catastrophe",
["Gungnir"] = "Gierskogul",
["Kikoku"] = "Blade: Metsu",
["Amanomurakumo"] = "Tachi: Kaiten",
["Mjollnir"] = "Randgrith",
["Claustrum"] = "Gates of Tartarus",
["Annihilator"] = "Coronach",
["Yoichinoyumi"] = "Namas Arrow"}
data.weaponskills.mythic = {
["Conqueror"] = "King's Justice",
["Glanzfaust"] = "Ascetic's Fury",
["Yagrush"] = "Mystic Boon",
["Laevateinn"] = "Vidohunir",
["Murgleis"] = "Death Blossom",
["Vajra"] = "Mandalic Stab",
["Burtgang"] = "Atonement",
["Liberator"] = "Insurgency",
["Aymur"] = "Primal Rend",
["Carnwenhan"] = "Mordant Rime",
["Gastraphetes"] = "Trueflight",
["Kogarasumaru"] = "Tachi: Rana",
["Nagi"] = "Blade: Kamu",
["Ryunohige"] = "Drakesbane",
["Nirvana"] = "Garland of Bliss",
["Tizona"] = "Expiacion",
["Death Penalty"] = "Leaden Salute",
["Kenkonken"] = "Stringing Pummel",
["Terpsichore"] = "Pyrrhic Kleos",
["Tupsimati"] = "Omniscience",
["Idris"] = "Exudation",
["Epeolatry"] = "Dimidiation"}
data.weaponskills.empyrean = {
["Verethragna"] = "Victory Smite",
["Twashtar"] = "Rudra's Storm",
["Almace"] = "Chant du Cygne",
["Caladbolg"] = "Torcleaver",
["Farsha"] = "Cloudsplitter",
["Ukonvasara"] = "Ukko's Fury",
["Redemption"] = "Quietus",
["Rhongomiant"] = "Camlann's Torment",
["Kannagi"] = "Blade: Hi",
["Masamune"] = "Tachi: Fudo",
["Gambanteinn"] = "Dagann",
["Hvergelmir"] = "Myrkr",
["Gandiva"] = "Jishnu's Radiance",
["Armageddon"] = "Wildfire"}
-- Weaponskills that can be used at range.
data.weaponskills.ranged = S{"Flaming Arrow", "Piercing Arrow", "Dulling Arrow", "Sidewinder", "Arching Arrow",
"Empyreal Arrow", "Refulgent Arrow", "Apex Arrow", "Namas Arrow", "Jishnu's Radiance",
"Hot Shot", "Split Shot", "Sniper Shot", "Slug Shot", "Heavy Shot", "Detonator", "Last Stand",
"Coronach", "Trueflight", "Leaden Salute", "Wildfire",
"Myrkr"}
ranged_weaponskills = data.weaponskills.ranged
-------------------------------------------------------------------------------------------------------------------
-- Spell mappings allow defining a general category or description that each of sets of related
-- spells all fall under.
-------------------------------------------------------------------------------------------------------------------
spell_maps = {
['Cure']='Cure',['Cure II']='Cure',['Cure III']='Cure',['Cure IV']='Cure',['Cure V']='Cure',['Cure VI']='Cure',
['Full Cure']='Cure',
['Cura']='Curaga',['Cura II']='Curaga',['Cura III']='Curaga',
['Curaga']='Curaga',['Curaga II']='Curaga',['Curaga III']='Curaga',['Curaga IV']='Curaga',['Curaga V']='Curaga',
-- Status Removal doesn't include Esuna or Sacrifice, since they work differently than the rest
['Poisona']='StatusRemoval',['Paralyna']='StatusRemoval',['Silena']='StatusRemoval',['Blindna']='StatusRemoval',['Cursna']='StatusRemoval',
['Stona']='StatusRemoval',['Viruna']='StatusRemoval',['Erase']='StatusRemoval',
['Barfire']='BarElement',['Barstone']='BarElement',['Barwater']='BarElement',['Baraero']='BarElement',['Barblizzard']='BarElement',['Barthunder']='BarElement',
['Barfira']='BarElement',['Barstonra']='BarElement',['Barwatera']='BarElement',['Baraera']='BarElement',['Barblizzara']='BarElement',['Barthundra']='BarElement',
['Raise']='Raise',['Raise II']='Raise',['Raise III']='Raise',['Arise']='Raise',
['Reraise']='Reraise',['Reraise II']='Reraise',['Reraise III']='Reraise',['Reraise IV']='Reraise',
['Protect']='Protect',['Protect II']='Protect',['Protect III']='Protect',['Protect IV']='Protect',['Protect V']='Protect',
['Shell']='Shell',['Shell II']='Shell',['Shell III']='Shell',['Shell IV']='Shell',['Shell V']='Shell',
['Protectra']='Protectra',['Protectra II']='Protectra',['Protectra III']='Protectra',['Protectra IV']='Protectra',['Protectra V']='Protectra',
['Shellra']='Shellra',['Shellra II']='Shellra',['Shellra III']='Shellra',['Shellra IV']='Shellra',['Shellra V']='Shellra',
['Regen']='Regen',['Regen II']='Regen',['Regen III']='Regen',['Regen IV']='Regen',['Regen V']='Regen',
['Refresh']='Refresh',['Refresh II']='Refresh',['Refresh III']='Refresh',
['Teleport-Holla']='Teleport',['Teleport-Dem']='Teleport',['Teleport-Mea']='Teleport',['Teleport-Altep']='Teleport',['Teleport-Yhoat']='Teleport',
['Teleport-Vahzl']='Teleport',['Recall-Pashh']='Teleport',['Recall-Meriph']='Teleport',['Recall-Jugner']='Teleport',
['Valor Minuet']='Minuet',['Valor Minuet II']='Minuet',['Valor Minuet III']='Minuet',['Valor Minuet IV']='Minuet',['Valor Minuet V']='Minuet',
["Knight's Minne"]='Minne',["Knight's Minne II"]='Minne',["Knight's Minne III"]='Minne',["Knight's Minne IV"]='Minne',["Knight's Minne V"]='Minne',
['Advancing March']='March',['Victory March']='March',
['Sword Madrigal']='Madrigal',['Blade Madrigal']='Madrigal',
["Hunter's Prelude"]='Prelude',["Archer's Prelude"]='Prelude',
['Sheepfoe Mambo']='Mambo',['Dragonfoe Mambo']='Mambo',
['Raptor Mazurka']='Mazurka',['Chocobo Mazurka']='Mazurka',
['Sinewy Etude']='Etude',['Dextrous Etude']='Etude',['Vivacious Etude']='Etude',['Quick Etude']='Etude',['Learned Etude']='Etude',['Spirited Etude']='Etude',['Enchanting Etude']='Etude',
['Herculean Etude']='Etude',['Uncanny Etude']='Etude',['Vital Etude']='Etude',['Swift Etude']='Etude',['Sage Etude']='Etude',['Logical Etude']='Etude',['Bewitching Etude']='Etude',
["Mage's Ballad"]='Ballad',["Mage's Ballad II"]='Ballad',["Mage's Ballad III"]='Ballad',
["Army's Paeon"]='Paeon',["Army's Paeon II"]='Paeon',["Army's Paeon III"]='Paeon',["Army's Paeon IV"]='Paeon',["Army's Paeon V"]='Paeon',["Army's Paeon VI"]='Paeon',
['Fire Carol']='Carol',['Ice Carol']='Carol',['Wind Carol']='Carol',['Earth Carol']='Carol',['Lightning Carol']='Carol',['Water Carol']='Carol',['Light Carol']='Carol',['Dark Carol']='Carol',
['Fire Carol II']='Carol',['Ice Carol II']='Carol',['Wind Carol II']='Carol',['Earth Carol II']='Carol',['Lightning Carol II']='Carol',['Water Carol II']='Carol',['Light Carol II']='Carol',['Dark Carol II']='Carol',
['Foe Lullaby']='Lullaby',['Foe Lullaby II']='Lullaby',['Horde Lullaby']='Lullaby',['Horde Lullaby II']='Lullaby',
['Fire Threnody']='Threnody',['Ice Threnody']='Threnody',['Wind Threnody']='Threnody',['Earth Threnody']='Threnody',['Lightning Threnody']='Threnody',['Water Threnody']='Threnody',['Light Threnody']='Threnody',['Dark Threnody']='Threnody',
['Fire Threnody II']='Threnody',['Ice Threnody II']='Threnody',['Wind Threnody II']='Threnody',['Earth Threnody II']='Threnody',['Lightning Threnody II']='Threnody',['Water Threnody II']='Threnody',['Light Threnody II']='Threnody',['Dark Threnody II']='Threnody',
['Battlefield Elegy']='Elegy',['Carnage Elegy']='Elegy',
['Foe Requiem']='Requiem',['Foe Requiem II']='Requiem',['Foe Requiem III']='Requiem',['Foe Requiem IV']='Requiem',['Foe Requiem V']='Requiem',['Foe Requiem VI']='Requiem',['Foe Requiem VII']='Requiem',
['Utsusemi: Ichi']='Utsusemi',['Utsusemi: Ni']='Utsusemi',['Utsusemi: San']='Utsusemi',
['Katon: Ichi'] = 'ElementalNinjutsu',['Suiton: Ichi'] = 'ElementalNinjutsu',['Raiton: Ichi'] = 'ElementalNinjutsu',
['Doton: Ichi'] = 'ElementalNinjutsu',['Huton: Ichi'] = 'ElementalNinjutsu',['Hyoton: Ichi'] = 'ElementalNinjutsu',
['Katon: Ni'] = 'ElementalNinjutsu',['Suiton: Ni'] = 'ElementalNinjutsu',['Raiton: Ni'] = 'ElementalNinjutsu',
['Doton: Ni'] = 'ElementalNinjutsu',['Huton: Ni'] = 'ElementalNinjutsu',['Hyoton: Ni'] = 'ElementalNinjutsu',
['Katon: San'] = 'ElementalNinjutsu',['Suiton: San'] = 'ElementalNinjutsu',['Raiton: San'] = 'ElementalNinjutsu',
['Doton: San'] = 'ElementalNinjutsu',['Huton: San'] = 'ElementalNinjutsu',['Hyoton: San'] = 'ElementalNinjutsu',
['Kurayami: Ichi'] = 'EnfeeblingNinjutsu',['Kurayami: Ni'] = 'EnfeeblingNinjutsu',['Hojo: Ichi'] = 'EnfeeblingNinjutsu',
['Hojo: Ni'] = 'EnfeeblingNinjutsu',['Dokumori: Ichi'] = 'EnfeeblingNinjutsu',['Jubaku: Ichi'] = 'EnfeeblingNinjutsu',
['Aisha: Ichi'] = 'EnfeeblingNinjutsu',['Yurin: Ichi'] = 'EnfeeblingNinjutsu',
['Tonko: Ichi'] = 'EnhancingNinjutsu',['Tonko: Ni'] = 'EnhancingNinjutsu', ['Monomi: Ichi'] = 'EnhancingNinjutsu',
['Myoshu: Ichi'] = 'EnhancingNinjutsu',['Migawari: Ichi'] = 'EnhancingNinjutsu',['Gekka: Ichi'] = 'EnhancingNinjutsu',
['Yain: Ichi'] = 'EnhancingNinjutsu',['Kakka: Ichi'] = 'EnhancingNinjutsu',
['Banish']='Banish',['Banish II']='Banish',['Banish III']='Banish',['Banishga']='Banish',['Banishga II']='Banish',
['Holy']='Holy',['Holy II']='Holy',['Drain']='Drain',['Drain II']='Drain',['Drain III']='Drain',['Aspir']='Aspir',['Aspir II']='Aspir',['Aspir III']='Aspir',
['Absorb-Str']='Absorb',['Absorb-Dex']='Absorb',['Absorb-Vit']='Absorb',['Absorb-Agi']='Absorb',['Absorb-Int']='Absorb',['Absorb-Mnd']='Absorb',['Absorb-Chr']='Absorb',
['Absorb-Acc']='Absorb',['Absorb-TP']='Absorb',['Absorb-Attri']='Absorb',
['Enlight']='Enlight',['Enlight II']='Enlight',['Endark']='Endark',['Endark II']='Endark',
['Burn']='ElementalEnfeeble',['Frost']='ElementalEnfeeble',['Choke']='ElementalEnfeeble',['Rasp']='ElementalEnfeeble',['Shock']='ElementalEnfeeble',['Drown']='ElementalEnfeeble',
['Pyrohelix']='Helix',['Cryohelix']='Helix',['Anemohelix']='Helix',['Geohelix']='Helix',['Ionohelix']='Helix',['Hydrohelix']='Helix',['Luminohelix']='Helix',['Noctohelix']='Helix',
['Pyrohelix II']='Helix',['Cryohelix II']='Helix',['Anemohelix II']='Helix',['Geohelix II']='Helix',['Ionohelix II']='Helix',['Hydrohelix II']='Helix',['Luminohelix II']='Helix',['Noctohelix II']='Helix',
['Firestorm']='Storm',['Hailstorm']='Storm',['Windstorm']='Storm',['Sandstorm']='Storm',['Thunderstorm']='Storm',['Rainstorm']='Storm',['Aurorastorm']='Storm',['Voidstorm']='Storm',
['Firestorm II']='Storm',['Hailstorm II']='Storm',['Windstorm II']='Storm',['Sandstorm II']='Storm',['Thunderstorm II']='Storm',['Rainstorm II']='Storm',['Aurorastorm II']='Storm',['Voidstorm II']='Storm',
['Fire Maneuver']='Maneuver',['Ice Maneuver']='Maneuver',['Wind Maneuver']='Maneuver',['Earth Maneuver']='Maneuver',['Thunder Maneuver']='Maneuver',
['Water Maneuver']='Maneuver',['Light Maneuver']='Maneuver',['Dark Maneuver']='Maneuver',
['Fira']='GeoElem',['Blizzara']='GeoElem',['Aerora']='GeoElem',['Stonera']='GeoElem',['Thundara']='GeoElem',['Watera']='GeoElem',
['Fira II']='GeoElem',['Blizzara II']='GeoElem',['Aerora II']='GeoElem',['Stonera II']='GeoElem',['Thundara II']='GeoElem',['Watera II']='GeoElem',
['Fira III']='GeoElem',['Blizzara III']='GeoElem',['Aerora III']='GeoElem',['Stonera III']='GeoElem',['Thundara III']='GeoElem',['Watera III']='GeoElem',
}
no_skill_spells_list = S{
'Haste', 'Haste II', 'Refresh', 'Refresh II', 'Refresh III', 'Protect', 'Protect II', 'Protect III', 'Protect IV', 'Protect V',
'Protectra', 'Protectra II', 'Protectra III', 'Protectra IV', 'Protectra V', 'Shell', 'Shell II', 'Shell III', 'Shell IV',
'Shell V', 'Shellra', 'Shellra II', 'Shellra III', 'Shellra IV', 'Shellra V', 'Raise', 'Raise II', 'Raise III', 'Arise',
'Reraise', 'Reraise II', 'Reraise III', 'Reraise IV', 'Sneak', 'Invisible', 'Deodorize'}
-------------------------------------------------------------------------------------------------------------------
-- Tables to specify general area groupings. Creates the 'areas' table to be referenced in job files.
-- Zone names provided by world.area/world.zone are currently in all-caps, so defining the same way here.
-------------------------------------------------------------------------------------------------------------------
areas = {}
-- City areas for town gear and behavior.
areas.Cities = 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",
"Tavnazian Safehold",
"Nashmau",
"Selbina",
"Mhaura",
"Norg",
"Eastern Adoulin",
"Western Adoulin",
"Kazham",
"Rabao",
"Chocobo Circuit",
}
-- Adoulin areas, where Ionis will grant special stat bonuses.
areas.Adoulin = S{
"Yahse Hunting Grounds",
"Ceizak Battlegrounds",
"Foret de Hennetiel",
"Morimar Basalt Fields",
"Yorcia Weald",
"Yorcia Weald [U]",
"Cirdas Caverns",
"Cirdas Caverns [U]",
"Marjami Ravine",
"Kamihr Drifts",
"Sih Gates",
"Moh Gates",
"Dho Gates",
"Woh Gates",
"Rala Waterways",
"Rala Waterways [U]",
"Outer Ra'Kaznar",
"Outer Ra'Kaznar [U]"
}
-------------------------------------------------------------------------------------------------------------------
-- Lists of certain NPCs. (Not up to date)
-------------------------------------------------------------------------------------------------------------------
npcs = {}
npcs.Trust = S{'Ajido-Marujido','Aldo','Ayame','Cherukiki','Curilla','D.Shantotto','Elivira','Excenmille',
'Fablinix','FerreousCoffin','Gadalar','Gessho','Ingrid','IronEater','Joachim','Klara','Kupipi',
'LehkoHabhoka','LhuMhakaracca','Lion','Luzaf','Maat','MihliAliapoh','Mnejing','Moogle','Mumor',
'NajaSalaheem','Najelith','Naji','NanaaMihgo','Nashmeira','Noillurie','Ovjang','Prishe','Rainemard',
'RomaaMihgo','Sakura','Shantotto','StarSibyl','Tenzen','Trion','UkaTotlihn','Ulmia','Valaineral',
'Volker','Zazarg','Zeid'}
By Zyla 2022-01-09 08:20:52
Hello, I was having an issue with using a Waltz ability turning up a weird error when trying to use it. It will still use the skill, but everytime I do I get this error that pops up on the console overlay:
Gearswap: Lua runtime error: Gearswap/flow.lua:354
Gearswap has detected an error in the user function precast:
...x86)Windower/addons/GearSwap/libs/mote-utility.lua:19: attempt to compare number with nil.
I've checked line 19 in the mote-utility lua file and lin 354 in the flow lua file, but I'm not really sure what I'm looking for and everything looks fine. Here's the 2 files in question:
Mote-Utility.lua: -------------------------------------------------------------------------------------------------------------------
-- General utility functions that can be used by any job files.
-- Outside the scope of what the main include file deals with.
-------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------
-- Buff utility functions.
-------------------------------------------------------------------------------------------------------------------
local cancel_spells_to_check = S{'Sneak', 'Stoneskin', 'Spectral Jig', 'Trance', 'Monomi: Ichi', 'Utsusemi: Ichi'}
local cancel_types_to_check = S{'Waltz', 'Samba'}
-- Function to cancel buffs if they'd conflict with using the spell you're attempting.
-- Requirement: Must have Cancel addon installed and loaded for this to work.
function cancel_conflicting_buffs(spell, action, spellMap, eventArgs)
if cancel_spells_to_check:contains(spell.english) or cancel_types_to_check:contains(spell.type) then
if spell.action_type == 'Ability' then
local abil_recasts = windower.ffxi.get_ability_recasts()
if abil_recasts[spell.recast_id] > 0 then
add_to_chat(123,'Abort: Ability waiting on recast.')
eventArgs.cancel = true
return
end
elseif spell.action_type == 'Magic' then
local spell_recasts = windower.ffxi.get_spell_recasts()
if spell_recasts[spell.recast_id] > 0 then
add_to_chat(123,'Abort: Spell waiting on recast.')
eventArgs.cancel = true
return
end
end
if spell.english == 'Spectral Jig' and buffactive.sneak then
cast_delay(0.2)
send_command('cancel sneak')
elseif spell.english == 'Sneak' and spell.target.type == 'SELF' and buffactive.sneak then
send_command('cancel sneak')
elseif spell.english == ('Stoneskin') then
send_command('@wait 1.0;cancel stoneskin')
elseif spell.english:startswith('Monomi') then
send_command('@wait 1.7;cancel sneak')
elseif spell.english == 'Utsusemi: Ichi' then
send_command('@wait 1.7;cancel copy image,copy image (2)')
elseif (spell.english == 'Trance' or spell.type=='Waltz') and buffactive['saber dance'] then
cast_delay(0.2)
send_command('cancel saber dance')
elseif spell.type=='Samba' and buffactive['fan dance'] then
cast_delay(0.2)
send_command('cancel fan dance')
end
end
end
-- Some mythics have special durations for level 1 and 2 aftermaths
local special_aftermath_mythics = S{'Tizona', 'Kenkonken', 'Murgleis', 'Yagrush', 'Carnwenhan', 'Nirvana', 'Tupsimati', 'Idris'}
-- Call from job_precast() to setup aftermath information for custom timers.
function custom_aftermath_timers_precast(spell)
if spell.type == 'WeaponSkill' then
info.aftermath = {}
local relic_ws = data.weaponskills.relic[player.equipment.main] or data.weaponskills.relic[player.equipment.range]
local mythic_ws = data.weaponskills.mythic[player.equipment.main] or data.weaponskills.mythic[player.equipment.range]
local empy_ws = data.weaponskills.empyrean[player.equipment.main] or data.weaponskills.empyrean[player.equipment.range]
if not relic_ws and not mythic_ws and not empy_ws then
return
end
info.aftermath.weaponskill = spell.english
info.aftermath.duration = 0
info.aftermath.level = math.floor(player.tp / 1000)
if info.aftermath.level == 0 then
info.aftermath.level = 1
end
if spell.english == relic_ws then
info.aftermath.duration = math.floor(0.2 * player.tp)
if info.aftermath.duration < 20 then
info.aftermath.duration = 20
end
elseif spell.english == empy_ws then
-- nothing can overwrite lvl 3
if buffactive['Aftermath: Lv.3'] then
return
end
-- only lvl 3 can overwrite lvl 2
if info.aftermath.level ~= 3 and buffactive['Aftermath: Lv.2'] then
return
end
-- duration is based on aftermath level
info.aftermath.duration = 30 * info.aftermath.level
elseif spell.english == mythic_ws then
-- nothing can overwrite lvl 3
if buffactive['Aftermath: Lv.3'] then
return
end
-- only lvl 3 can overwrite lvl 2
if info.aftermath.level ~= 3 and buffactive['Aftermath: Lv.2'] then
return
end
-- Assume mythic is lvl 80 or higher, for duration
if info.aftermath.level == 1 then
info.aftermath.duration = (special_aftermath_mythics:contains(player.equipment.main) and 270) or 90
elseif info.aftermath.level == 2 then
info.aftermath.duration = (special_aftermath_mythics:contains(player.equipment.main) and 270) or 120
else
info.aftermath.duration = 180
end
end
end
end
-- Call from job_aftercast() to create the custom aftermath timer.
function custom_aftermath_timers_aftercast(spell)
if not spell.interrupted and spell.type == 'WeaponSkill' and
info.aftermath and info.aftermath.weaponskill == spell.english and info.aftermath.duration > 0 then
local aftermath_name = 'Aftermath: Lv.'..tostring(info.aftermath.level)
send_command('timers d "Aftermath: Lv.1"')
send_command('timers d "Aftermath: Lv.2"')
send_command('timers d "Aftermath: Lv.3"')
send_command('timers c "'..aftermath_name..'" '..tostring(info.aftermath.duration)..' down abilities/00027.png')
info.aftermath = {}
end
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions for changing spells and target types in an automatic manner.
-------------------------------------------------------------------------------------------------------------------
local waltz_tp_cost = {['Curing Waltz'] = 200, ['Curing Waltz II'] = 350, ['Curing Waltz III'] = 500, ['Curing Waltz IV'] = 650, ['Curing Waltz V'] = 800}
-- Utility function for automatically adjusting the waltz spell being used to match HP needs and TP limits.
-- Handle spell changes before attempting any precast stuff.
function refine_waltz(spell, action, spellMap, eventArgs)
if spell.type ~= 'Waltz' then
return
end
-- Don't modify anything for Healing Waltz or Divine Waltzes
if spell.english == "Healing Waltz" or spell.english == "Divine Waltz" or spell.english == "Divine Waltz II" then
return
end
local newWaltz = spell.english
local waltzID
local missingHP
-- If curing ourself, get our exact missing HP
if spell.target.type == "SELF" then
missingHP = player.max_hp - player.hp
-- If curing someone in our alliance, we can estimate their missing HP
elseif spell.target.isallymember then
local target = find_player_in_alliance(spell.target.name)
local est_max_hp = target.hp / (target.hpp/100)
missingHP = math.floor(est_max_hp - target.hp)
end
-- If we have an estimated missing HP value, we can adjust the preferred tier used.
if missingHP ~= nil then
if player.main_job == 'DNC' then
dnc_level = player.main_job_level
if missingHP < 40 and spell.target.name == player.name then
-- Not worth curing yourself for so little.
-- Don't block when curing others to allow for waking them up.
add_to_chat(122,'Full HP!')
eventArgs.cancel = true
return
elseif missingHP >= 1500 and dnc_level >= 87 then
newWaltz = 'Curing Waltz V'
waltzID = 311
elseif missingHP >= 1100 and dnc_level >= 70 then
newWaltz = 'Curing Waltz IV'
waltzID = 193
elseif missingHP >= 600 and dnc_level >= 45 then
newWaltz = 'Curing Waltz III'
waltzID = 192
elseif missingHP >= 200 and dnc_level >= 30 then
newWaltz = 'Curing Waltz II'
waltzID = 191
else
newWaltz = 'Curing Waltz'
waltzID = 190
end
elseif player.sub_job == 'DNC' then
dnc_level = player.sub_job_level
if missingHP < 40 and spell.target.name == player.name then
-- Not worth curing yourself for so little.
-- Don't block when curing others to allow for waking them up.
add_to_chat(122,'Full HP!')
eventArgs.cancel = true
return
elseif missingHP >= 300 and dnc_level >= 45 then
newWaltz = 'Curing Waltz III'
waltzID = 192
elseif missingHP >= 150 and dnc_level >= 30 then
newWaltz = 'Curing Waltz II'
waltzID = 191
else
newWaltz = 'Curing Waltz'
waltzID = 190
end
else
-- Not dnc main or sub; bail out
return
end
end
local tpCost = waltz_tp_cost[newWaltz]
local downgrade
-- Downgrade the spell to what we can afford
if player.tp < tpCost and not buffactive.trance then
--[[ Costs:
Curing Waltz: 200 TP
Curing Waltz II: 350 TP
Curing Waltz III: 500 TP
Curing Waltz IV: 650 TP
Curing Waltz V: 800 TP
Divine Waltz: 400 TP
Divine Waltz II: 800 TP
--]]
if player.tp < 200 then
add_to_chat(122, 'Insufficient TP ['..tostring(player.tp)..']. Cancelling.')
eventArgs.cancel = true
return
elseif player.tp < 350 then
newWaltz = 'Curing Waltz'
elseif player.tp < 500 then
newWaltz = 'Curing Waltz II'
elseif player.tp < 650 then
newWaltz = 'Curing Waltz III'
elseif player.tp < 800 then
newWaltz = 'Curing Waltz IV'
end
downgrade = 'Insufficient TP ['..tostring(player.tp)..']. Downgrading to '..newWaltz..'.'
end
if newWaltz ~= spell.english then
send_command('@input /ja "'..newWaltz..'" '..tostring(spell.target.raw))
if downgrade then
add_to_chat(122, downgrade)
end
eventArgs.cancel = true
return
end
if missingHP and missingHP > 0 then
add_to_chat(122,'Trying to cure '..tostring(missingHP)..' HP using '..newWaltz..'.')
end
end
-- Function to allow for automatic adjustment of the spell target type based on preferences.
function auto_change_target(spell, spellMap)
-- Don't adjust targetting for explicitly named targets
if not spell.target.raw:startswith('<') then
return
end
-- Do not modify target for spells where we get <lastst> or <me>.
if spell.target.raw == ('<lastst>') or spell.target.raw == ('<me>') then
return
end
-- init a new eventArgs with current values
local eventArgs = {handled = false, PCTargetMode = state.PCTargetMode.value, SelectNPCTargets = state.SelectNPCTargets.value}
-- Allow the job to do custom handling, or override the default values.
-- They can completely handle it, or set one of the secondary eventArgs vars to selectively
-- override the default state vars.
if job_auto_change_target then
job_auto_change_target(spell, action, spellMap, eventArgs)
end
-- If the job handled it, we're done.
if eventArgs.handled then
return
end
local pcTargetMode = eventArgs.PCTargetMode
local selectNPCTargets = eventArgs.SelectNPCTargets
local validPlayers = S{'Self', 'Player', 'Party', 'Ally', 'NPC'}
local intersection = spell.targets * validPlayers
local canUseOnPlayer = not intersection:empty()
local newTarget
-- For spells that we can cast on players:
if canUseOnPlayer and pcTargetMode ~= 'default' then
-- Do not adjust targetting for player-targettable spells where the target was <t>
if spell.target.raw ~= ('<t>') then
if pcTargetMode == 'stal' then
-- Use <stal> if possible, otherwise fall back to <stpt>.
if spell.targets.Ally then
newTarget = '<stal>'
elseif spell.targets.Party then
newTarget = '<stpt>'
end
elseif pcTargetMode == 'stpt' then
-- Even ally-possible spells are limited to the current party.
if spell.targets.Ally or spell.targets.Party then
newTarget = '<stpt>'
end
elseif pcTargetMode == 'stpc' then
-- If it's anything other than a self-only spell, can change to <stpc>.
if spell.targets.Player or spell.targets.Party or spell.targets.Ally or spell.targets.NPC then
newTarget = '<stpc>'
end
end
end
-- For spells that can be used on enemies:
elseif spell.targets and spell.targets.Enemy and selectNPCTargets then
-- Note: this means macros should be written for <t>, and it will change to <stnpc>
-- if the flag is set. It won't change <stnpc> back to <t>.
newTarget = '<stnpc>'
end
-- If a new target was selected and is different from the original, call the change function.
if newTarget and newTarget ~= spell.target.raw then
change_target(newTarget)
end
end
-------------------------------------------------------------------------------------------------------------------
-- Environment utility functions.
-------------------------------------------------------------------------------------------------------------------
-- Function to get the current weather intensity: 0 for none, 1 for single weather, 2 for double weather.
function get_weather_intensity()
return gearswap.res.weather[world.weather_id].intensity
end
-- Returns true if you're in a party solely comprised of Trust NPCs.
-- TODO: Do we need a check to see if we're in a party partly comprised of Trust NPCs?
function is_trust_party()
-- Check if we're solo
if party.count == 1 then
return false
end
-- Can call a max of 3 Trust NPCs, so parties larger than that are out.
if party.count > 4 then
return false
end
-- If we're in an alliance, can't be a Trust party.
if alliance[2].count > 0 or alliance[3].count > 0 then
return false
end
-- Check that, for each party position aside from our own, the party
-- member has one of the Trust NPC names, and that those party members
-- are flagged is_npc.
for i = 2,4 do
if party then
if not npcs.Trust:contains(party.name) then
return false
end
if party.mob and party.mob.is_npc == false then
return false
end
end
end
-- If it didn't fail any of the above checks, return true.
return true
end
-- Call these function with a list of equipment slots to check ('head', 'neck', 'body', etc)
-- Returns true if any of the specified slots are currently encumbered.
-- Returns false if all specified slots are unencumbered.
function is_encumbered(...)
local check_list = {...}
-- Compensate for people passing a table instead of a series of strings.
if type(check_list[1]) == 'table' then
check_list = check_list[1]
end
local check_set = S(check_list)
for slot_id,slot_name in pairs(gearswap.default_slot_map) do
if check_set:contains(slot_name) then
if gearswap.encumbrance_table[slot_id] then
return true
end
end
end
return false
end
-------------------------------------------------------------------------------------------------------------------
-- Elemental gear utility functions.
-------------------------------------------------------------------------------------------------------------------
-- General handler function to set all the elemental gear for an action.
function set_elemental_gear(spell)
set_elemental_gorget_belt(spell)
set_elemental_obi_cape_ring(spell)
set_elemental_staff(spell)
end
-- Set the name field of the predefined gear vars for gorgets and belts, for the specified weaponskill.
function set_elemental_gorget_belt(spell)
if spell.type ~= 'WeaponSkill' then
return
end
-- Get the union of all the skillchain elements for the weaponskill
local weaponskill_elements = S{}:
union(skillchain_elements[spell.skillchain_a]):
union(skillchain_elements[spell.skillchain_b]):
union(skillchain_elements[spell.skillchain_c])
gear.ElementalGorget.name = get_elemental_item_name("gorget", weaponskill_elements) or gear.default.weaponskill_neck or ""
gear.ElementalBelt.name = get_elemental_item_name("belt", weaponskill_elements) or gear.default.weaponskill_waist or ""
end
-- Function to get an appropriate obi/cape/ring for the current action.
function set_elemental_obi_cape_ring(spell)
if spell.element == 'None' then
return
end
local world_elements = S{world.day_element}
if world.weather_element ~= 'None' then
world_elements:add(world.weather_element)
end
local obi_name = get_elemental_item_name("obi", S{spell.element}, world_elements)
gear.ElementalObi.name = obi_name or gear.default.obi_waist or ""
if obi_name then
if player.inventory['Twilight Cape'] or player.wardrobe['Twilight Cape'] then
gear.ElementalCape.name = "Twilight Cape"
end
if (player.inventory['Zodiac Ring'] or player.wardrobe['Zodiac Ring']) and spell.english ~= 'Impact' and
not S{'Divine Magic','Dark Magic','Healing Magic'}:contains(spell.skill) then
gear.ElementalRing.name = "Zodiac Ring"
end
else
gear.ElementalCape.name = gear.default.obi_back
gear.ElementalRing.name = gear.default.obi_ring
end
end
-- Function to get the appropriate fast cast and/or recast staves for the current spell.
function set_elemental_staff(spell)
if spell.action_type ~= 'Magic' then
return
end
gear.FastcastStaff.name = get_elemental_item_name("fastcast_staff", S{spell.element}) or gear.default.fastcast_staff or ""
gear.RecastStaff.name = get_elemental_item_name("recast_staff", S{spell.element}) or gear.default.recast_staff or ""
end
-- Gets the name of an elementally-aligned piece of gear within the player's
-- inventory that matches the conditions set in the parameters.
--
-- item_type: Type of item as specified in the elemental_map mappings.
-- EG: gorget, belt, obi, fastcast_staff, recast_staff
--
-- valid_elements: Elements that are valid for the action being taken.
-- IE: Weaponskill skillchain properties, or spell element.
--
-- restricted_to_elements: Secondary elemental restriction that limits
-- whether the item check can be considered valid.
-- EG: Day or weather elements that have to match the spell element being queried.
--
-- Returns: Nil if no match was found (either due to elemental restrictions,
-- or the gear isn't in the player inventory), or the name of the piece of
-- gear that matches the query.
function get_elemental_item_name(item_type, valid_elements, restricted_to_elements)
local potential_elements = restricted_to_elements or elements.list
local item_map = elements[item_type:lower()..'_of']
for element in (potential_elements.it or it)(potential_elements) do
if valid_elements:contains(element) and (player.inventory[item_map[element]] or player.wardrobe[item_map[element]]) then
return item_map[element]
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- Function to easily change to a given macro set or book. Book value is optional.
-------------------------------------------------------------------------------------------------------------------
function set_macro_page(set,book)
if not tonumber(set) then
add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
return
end
if set < 1 or set > 10 then
add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
return
end
if book then
if not tonumber(book) then
add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
return
end
if book < 1 or book > 20 then
add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
return
end
send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
else
send_command('@input /macro set '..tostring(set))
end
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions for including local user files.
-------------------------------------------------------------------------------------------------------------------
-- Attempt to load user gear files in place of default gear sets.
-- Return true if one exists and was loaded.
function load_sidecar(job)
if not job then return false end
-- filename format example for user-local files: whm_gear.lua, or playername_whm_gear.lua
local filenames = {player.name..'_'..job..'_gear.lua', job..'_gear.lua',
'gear/'..player.name..'_'..job..'_gear.lua', 'gear/'..job..'_gear.lua',
'gear/'..player.name..'_'..job..'.lua', 'gear/'..job..'.lua'}
return optional_include(filenames)
end
-- Attempt to include user-globals. Return true if it exists and was loaded.
function load_user_globals()
local filenames = {player.name..'-globals.lua', 'user-globals.lua'}
return optional_include(filenames)
end
-- Optional version of include(). If file does not exist, does not
-- attempt to load, and does not throw an error.
-- filenames takes an array of possible file names to include and checks
-- each one.
function optional_include(filenames)
for _,v in pairs(filenames) do
local path = gearswap.pathsearch({v})
if path then
include(v)
return true
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions for vars or other data manipulation.
-------------------------------------------------------------------------------------------------------------------
-- Attempt to locate a specified name within the current alliance.
function find_player_in_alliance(name)
for party_index,ally_party in ipairs(alliance) do
for player_index,_player in ipairs(ally_party) do
if _player.name == name then
return _player
end
end
end
end
-- buff_set is a set of buffs in a library table (any of S{}, T{} or L{}).
-- This function checks if any of those buffs are present on the player.
function has_any_buff_of(buff_set)
return buff_set:any(
-- Returns true if any buff from buff set that is sent to this function returns true:
function (b) return buffactive end
)
end
-- Invert a table such that the keys are values and the values are keys.
-- Use this to look up the index value of a given entry.
function invert_table(t)
if t == nil then error('Attempting to invert table, received nil.', 2) end
local i={}
for k,v in pairs(t) do
i[v] = k
end
return i
end
-- Gets sub-tables based on baseSet from the string str that may be in dot form
-- (eg: baseSet=sets, str='precast.FC', this returns the table sets.precast.FC).
function get_expanded_set(baseSet, str)
local cur = baseSet
for i in str:gmatch("[^.]+") do
if cur then
cur = cur
end
end
return cur
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions data and event tracking.
-------------------------------------------------------------------------------------------------------------------
-- This is a function that can be attached to a registered event for 'time change'.
-- It will send a call to the update() function if the time period changes.
-- It will also call job_time_change when any of the specific time class values have changed.
-- To activate this in your job lua, add this line to your user_setup function:
-- windower.register_event('time change', time_change)
--
-- Variables it sets: classes.Daytime, and classes.DuskToDawn. They are set to true
-- if their respective descriptors are true, or false otherwise.
function time_change(new_time, old_time)
local was_daytime = classes.Daytime
local was_dusktime = classes.DuskToDawn
if new_time >= 6*60 and new_time < 18*60 then
classes.Daytime = true
else
classes.Daytime = false
end
if new_time >= 17*60 or new_time < 7*60 then
classes.DuskToDawn = true
else
classes.DuskToDawn = false
end
if was_daytime ~= classes.Daytime or was_dusktime ~= classes.DuskToDawn then
if job_time_change then
job_time_change(new_time, old_time)
end
handle_update({'auto'})
end
end
Flow.lua: --Copyright (c) 2013~2016, Byrthnoth
--All rights reserved.
--Redistribution and use in source and binary forms, with or without
--modification, are permitted provided that the following conditions are met:
-- * Redistributions of source code must retain the above copyright
-- notice, this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- * Neither the name of <addon name> nor the
-- names of its contributors may be used to endorse or promote products
-- derived from this software without specific prior written permission.
--THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
--ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
--WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
--DISCLAIMED. IN NO EVENT SHALL <your name> BE LIABLE FOR ANY
--DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
--(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
--LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
--ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
--(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
--SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------------
--Name: equip_sets(swap_type,ts,val1,val2)
--Desc: General purpose equipment pipeline / user function caller.
--Args:
---- swap_type - Determines equip_sets' behavior in terms of which user function it
-- attempts to call
---- ts - index of command_registry or nil for pretarget/commands
---- val1 - First argument to be passed to the user function
---- val2 - Second argument to be passed to the user function
-----------------------------------------------------------------------------------
--Return (varies by swap type):
---- pretarget : empty string to blank packet or full string
---- Everything else : nil
-----------------------------------------------------------------------------------
function equip_sets(swap_type,ts,...)
local results
local var_inps = {...}
local val1 = var_inps[1]
local val2 = var_inps[2]
table.reassign(_global,command_registry[ts] or {pretarget_cast_delay = 0,precast_cast_delay=0,cancel_spell = false, new_target=false,target_arrow={x=0,y=0,z=0}})
_global.current_event = tostring(swap_type)
if _global.current_event == 'precast' and val1 and val1.english and val1.english:find('Geo-') then
_global.target_arrow = initialize_arrow_offset(val1.target)
end
windower.debug(tostring(swap_type)..' enter')
if showphase or debugging.general then msg.debugging(8,windower.to_shift_jis(tostring(swap_type))..' enter') end
local cur_equip = table.reassign({},update_equipment())
table.reassign(equip_list,{})
table.reassign(player.equipment,to_names_set(cur_equip))
for i,v in pairs(slot_map) do
if not player.equipment then
player.equipment = player.equipment[toslotname(v)]
end
end
logit('\n\n'..tostring(os.clock)..'(15) equip_sets: '..tostring(swap_type))
if val1 then
if type(val1) == 'table' and val1.english then
logit(' : '..val1.english)
else
logit(' : Unknown type val1- '..tostring(val1))
end
else
logit(' : nil-or-false')
end
if val2 then
if type(val2) == 'table' and val2.type then logit(' : '..val2.type)
else
logit(' : Unknown type val2- '..tostring(val2))
end
else
logit(' : nil-or-false')
end
if type(swap_type) == 'string' then
msg.debugging("Entering "..swap_type)
else
msg.debugging("Entering User Event "..tostring(swap_type))
end
if not val1 then val1 = {}
if debugging.general then
msg.debugging(8,'val1 error')
end
end
if type(swap_type) == 'function' then
results = { pcall(swap_type,...) }
if not table.remove(results,1) then error('\nUser Event Error: '..results[1]) end
elseif swap_type == 'equip_command' then
equip(val1)
else
user_pcall(swap_type,...)
end
--[[ local c
if type(swap_type) == 'function' then
c = coroutine.create(swap_type)
elseif swap_type == 'equip_command' then
equip(val1)
elseif type(swap_type) == 'string' and user_env[swap_type] and type(user_env[swap_type]) == 'function' then
c = coroutine.create(user_env[swap_type])
elseif type(swap_type) == 'string' and user_env[swap_type] then
msg.addon_msg(123,windower.to_shift_jis(tostring(str))..'() exists but is not a function')
end
if c then
while coroutine.status(c) == 'suspended' do
local err, typ, val = coroutine.resume(c,unpack(var_inputs))
if not err then
error('\nGearSwap has detected an error in the user function '..tostring(swap_type)..':\n'..typ)
elseif typ then
if typ == 'sleep' and type(val) == 'number' and val >= 0 then
-- coroutine slept
err, typ, val = coroutine.schedule(c,val)
else
-- Someone yielded or slept with a nonsensical argument.
err, typ, val = coroutine.resume(c)
end
else
-- coroutine finished
end
end
end]]
if type(swap_type) == 'string' and (swap_type == 'pretarget' or swap_type == 'filtered_action') then -- Target may just have been changed, so make the ind now.
ts = command_registry:new_entry(val1)
-- elseif type(swap_type) == 'string' and swap_type == 'precast' and not command_registry[ts] and debugging.command_registry then
-- print_set(spell,'precast nil error') -- spell's scope changed to local
end
if player.race ~= 'Precomposed NPC' then
-- Short circuits the routine and gets out before equip processing
-- if there's no swapping to be done because the user is a monster.
for v,i in pairs(default_slot_map) do
if equip_list and encumbrance_table[v] then
not_sent_out_equip = equip_list
equip_list = nil
msg.debugging(i..' slot was not equipped because you are encumbered.')
end
end
table.update(equip_list_history,equip_list)
-- Attempts to identify the player-specified item in inventory
-- Starts with (i=slot name, v=item name)
-- Ends with (i=slot id and v={bag_id=bag_id, slot=inventory slot}).
local equip_next,priorities = unpack_equip_list(equip_list,cur_equip)
if (_settings.show_swaps and table.length(equip_next) > 0) or _settings.demo_mode then --and table.length(equip_next)>0 then
local tempset = to_names_set(equip_next)
print_set(tempset,tostring(swap_type))
end
if (buffactive.charm or player.charmed) or (player.status == 2 or player.status == 3) then -- dead or engaged dead statuses
local failure_reason
if (buffactive.charm or player.charmed) then
failure_reason = 'Charmed'
elseif player.status == 2 or player.status == 3 then
failure_reason = 'KOed'
end
msg.debugging("Cannot change gear right now: "..tostring(failure_reason))
logit('\n\n'..tostring(os.clock)..'(69) failure_reason: '..tostring(failure_reason))
else
local chunk_table = L{}
for eq_slot_id,priority in priorities:it() do
if equip_next[eq_slot_id] and not encumbrance_table[eq_slot_id] and not _settings.demo_mode then
local minichunk = equip_piece(eq_slot_id,equip_next[eq_slot_id].bag_id,equip_next[eq_slot_id].slot)
chunk_table:append(minichunk)
end
end
if swap_type == 'midcast' and command_registry[ts] and command_registry[ts].proposed_packet and not _settings.demo_mode then
windower.packets.inject_outgoing(command_registry[ts].proposed_packet:byte(1),command_registry[ts].proposed_packet)
end
if chunk_table.n >= 3 then
local big_chunk = string.char(0x51,0x24,0,0,chunk_table.n,0,0,0)
for i=1,chunk_table.n do
big_chunk = big_chunk..chunk_table
end
while string.len(big_chunk) < 0x48 do big_chunk = big_chunk..string.char(0) end
windower.packets.inject_outgoing(0x51,big_chunk)
elseif chunk_table.n > 0 then
for i=1,chunk_table.n do
local chunk = string.char(0x50,4,0,0)..chunk_table
windower.packets.inject_outgoing(0x50,chunk)
end
end
end
else
if swap_type == 'midcast' and command_registry[ts] and command_registry[ts].proposed_packet and not _settings.demo_mode then
windower.packets.inject_outgoing(command_registry[ts].proposed_packet:byte(1),command_registry[ts].proposed_packet)
end
end
windower.debug(tostring(swap_type)..' exit')
if type(swap_type) == 'function' then
return unpack(results)
end
return equip_sets_exit(swap_type,ts,val1)
end
-----------------------------------------------------------------------------------
--Name: equip_sets_exit(swap_type,ind,val1)
--Desc: Cleans up the global table and leaves equip_sets properly.
--Args:
---- swap_type - Current swap type for equip_sets
---- ts - Current index of command_registry
---- val1 - First argument of equip_sets
-----------------------------------------------------------------------------------
--Returns:
---- none
-----------------------------------------------------------------------------------
function equip_sets_exit(swap_type,ts,val1)
if command_registry[ts] then
table.update(command_registry[ts],_global)
end
if type(swap_type) == 'string' then
if swap_type == 'pretarget' then
if command_registry[ts].cancel_spell then
msg.debugging("Action canceled ("..storedcommand..' '..val1.target.raw..")")
storedcommand = nil
command_registry:delete_entry(ts)
return true
elseif not ts or not command_registry[ts] or not storedcommand then
msg.debugging('This case should not be hittable - 1')
return true
end
if command_registry[ts].new_target then
val1.target = command_registry[ts].new_target -- Switch target, if it is requested.
end
-- Compose a proposed packet for the given action (this should be possible after pretarget)
command_registry[ts].spell = val1
if val1.target and val1.target.id and val1.target.index and val1.prefix and unify_prefix[val1.prefix] then
if val1.prefix == '/item' then
-- Item use packet handling here
if bit.band(val1.target.spawn_type, 2) == 2 and find_inventory_item(val1.id) then
-- 0x36 packet
if val1.target.distance <= 6 then
command_registry[ts].proposed_packet = assemble_menu_item_packet(val1.target.id,val1.target.index,val1.id)
else
windower.add_to_chat(67, "Target out of range.")
end
elseif find_usable_item(val1.id) then
-- 0x37 packet
command_registry[ts].proposed_packet = assemble_use_item_packet(val1.target.id,val1.target.index,val1.id)
end
if not command_registry[ts].proposed_packet then
command_registry:delete_entry(ts)
end
elseif outgoing_action_category_table[unify_prefix[val1.prefix]] then
if filter_precast(val1) then
command_registry[ts].proposed_packet = assemble_action_packet(val1.target.id,val1.target.index,outgoing_action_category_table[unify_prefix[val1.prefix]],val1.id,command_registry[ts].target_arrow)
if not command_registry[ts].proposed_packet then
command_registry:delete_entry(ts)
msg.debugging("Unable to create a packet for this command because the target is still invalid after pretarget ("..storedcommand..' '..val1.target.raw..")")
storedcommand = nil
return storedcommand..' '..val1.target.raw
end
end
else
msg.debugging(8,"Hark, what weird prefix through yonder window breaks? "..tostring(val1.prefix))
end
end
if ts and command_registry[ts] and val1.target then
if st_targs[val1.target.raw] then
-- st targets
st_flag = true
elseif not val1.target.name then
-- Spells with invalid pass_through_targs, like using <t> without a target
command_registry:delete_entry(ts)
msg.debugging("Change target was used to pick an invalid target ("..storedcommand..' '..val1.target.raw..")")
local ret = storedcommand..' '..val1.target.raw
storedcommand = nil
return ret
else
-- Spells with complete target information
-- command_registry[ts] is deleted for cancelled spells
if command_registry[ts].pretarget_cast_delay == 0 then
equip_sets('precast',ts,val1)
else
windower.send_command('@wait '..command_registry[ts].pretarget_cast_delay..';lua i '.._addon.name..' pretarget_delayed_cast '..ts)
end
return true
end
elseif not ts or not command_registry[ts] then
msg.debugging('This case should not be hittable - 2')
return true
end
elseif swap_type == 'precast' then
-- Update the target_arrow
if val1.prefix ~= '/item' then
command_registry[ts].proposed_packet = assemble_action_packet(val1.target.id,val1.target.index,outgoing_action_category_table[unify_prefix[val1.prefix]],val1.id,command_registry[ts].target_arrow)
end
return precast_send_check(ts)
elseif swap_type == 'filtered_action' and command_registry[ts] and command_registry[ts].cancel_spell then
storedcommand = nil
command_registry:delete_entry(ts)
return true
elseif swap_type == 'midcast' and _settings.demo_mode then
command_registry[ts].midaction = false
equip_sets('aftercast',ts,val1)
elseif swap_type == 'aftercast' then
if ts then
command_registry:delete_entry(ts)
end
elseif swap_type == 'pet_aftercast' then
if ts then
command_registry:delete_entry(ts)
end
end
end
end
-----------------------------------------------------------------------------------
--Name: user_pcall(str,val1,val2,exit_funct)
--Desc: Calls a user function, if it exists. If not, throws an error.
--Args:
---- str - Function's key in user_env.
-----------------------------------------------------------------------------------
--Returns:
---- none
-----------------------------------------------------------------------------------
function user_pcall(str,...)
if user_env then
if type(user_env[str]) == 'function' then
bool,err = pcall(user_env[str],...)
if not bool then error('\nGearSwap has detected an error in the user function '..str..':\n'..err) end
elseif user_env[str] then
msg.addon_msg(123,windower.to_shift_jis(tostring(str))..'() exists but is not a function')
end
end
end
-----------------------------------------------------------------------------------
--Name: pretarget_delayed_cast(ts)
--Desc: Triggers an outgoing action packet (if the passed key is valid).
--Args:
---- ts - Timestamp argument to precast_delayed_cast
-----------------------------------------------------------------------------------
--Returns:
---- none
-----------------------------------------------------------------------------------
function pretarget_delayed_cast(ts)
ts = tonumber(ts)
if ts then
equip_sets('precast',ts,command_registry[ts].spell)
else
msg.debugging("Bad index passed to pretarget_delayed_cast")
end
end
-----------------------------------------------------------------------------------
--Name: precast_send_check(ts)
--Desc: Determines whether or not to send the current packet.
-- Cancels if _global.cancel_spell is true
-- If command_registry[ts].precast_cast_delay is not 0, cues precast_delayed_cast with the proper
-- delay instead of sending immediately.
--Args:
---- ts - key of command_registry
-----------------------------------------------------------------------------------
--Returns:
---- true (to block) or the outgoing packet
-----------------------------------------------------------------------------------
function precast_send_check(ts)
if ts and command_registry[ts] then
if command_registry[ts].cancel_spell then
command_registry:delete_entry(ts)
else
if command_registry[ts].precast_cast_delay == 0 then
send_action(ts)
return
else
windower.send_command('@wait '..command_registry[ts].precast_cast_delay..';lua i '.._addon.name..' precast_delayed_cast '..ts)
end
end
end
return true
end
-----------------------------------------------------------------------------------
--Name: precast_delayed_cast(ts)
--Desc: Triggers an outgoing action packet (if the passed key is valid).
--Args:
---- ts - Timestamp argument to precast_delayed_cast
-----------------------------------------------------------------------------------
--Returns:
---- none
-----------------------------------------------------------------------------------
function precast_delayed_cast(ts)
ts = tonumber(ts)
if ts then
send_action(ts)
else
msg.debugging("Bad index passed to precast_delayed_cast")
end
end
-----------------------------------------------------------------------------------
--Name: send_action(ts)
--Desc: Sends the cued action packet, if it exists.
--Args:
---- ts - index for a command_registry entry that includes an action packet (hopefully)
-----------------------------------------------------------------------------------
--Returns:
---- none
-----------------------------------------------------------------------------------
function send_action(ts)
command_registry[ts].midaction = true
equip_sets('midcast',ts,command_registry[ts].spell)
end
The only things I've tried to change is removing the Waltz from the "local cancel_types_to_check = S{'Waltz', 'Samba'}" line at the top, as I thought that would just remove it from the check itself, but all that did was make it cancel using a Waltz of any kind regardless of my current hp (there is a function in most of the lua I use to use Waltzes based on your current hp values), and saying in my chat box that my HP is full. This did remove the error, but I've since reverted that change, so I'm back to square one with the error. Any help with this would be very appreciated.
By Zyla 2022-01-09 08:23:51
Here is a copy of the lua I'm currently getting this error on:
-- Original: Motenten / Modified: Arislan
-------------------------------------------------------------------------------------------------------------------
-- Keybinds
-------------------------------------------------------------------------------------------------------------------
-- Modes: [ F9 ] Cycle Offense Modes
-- [ CTRL+F9 ] Cycle Hybrid Modes
-- [ WIN+F9 ] Cycle Weapon Skill Modes
-- [ F10 ] Emergency -PDT Mode
-- [ ALT+F10 ] Toggle Kiting Mode
-- [ F11 ] Emergency -MDT Mode
-- [ F12 ] Update Current Gear / Report Current Status
-- [ CTRL+F12 ] Cycle Idle Modes
-- [ ALT+F12 ] Cancel Emergency -PDT/-MDT Mode
-- [ CTRL+` ] Cycle Treasure Hunter Mode
-- [ WIN+C ] Toggle Capacity Points Mode
--
-- Abilities: [ ALT+` ] Flee
-- [ CTRL+Numpad/ ] Berserk
-- [ CTRL+Numpad* ] Warcry
-- [ CTRL+Numpad- ] Aggressor
-- [ CTRL+Numpad0 ] Sneak Attack
-- [ CTRL+Numpad. ] Trick Attack
--
-- Spells: [ ALT+Numpad+ ] Utsusemi: Ichi
-- [ CTRL+Numpad+ ] Utsusemi: Ni
--
-- WS: [ CTRL+Numpad9 ] Exenterator
-- [ CTRL+Numpad8 ] Dancing Edge
-- [ CTRL+Numpad7 ] Evisceration
-- [ CTRL+Numpad6 ] Mandalic Stab
-- [ CTRL+Numpad4 ] Shark Bite
-- [ CTRL+Numpad1 ] Aeolian Edge
-------------------------------------------------------------------------------------------------------------------
-- Custom Commands (preface with /console to use these in macros)
-------------------------------------------------------------------------------------------------------------------
-- gs c cycle treasuremode (set on ctrl+` by default): Cycles through the available treasure hunter modes.
--
-- TH Modes: None Will never equip TH gear
-- Tag Will equip TH gear sufficient for initial contact with a mob (either melee,
--
-- SATA - Will equip TH gear sufficient for initial contact with a mob, and when using SATA
-- Fulltime - Will keep TH gear equipped fulltime
-------------------------------------------------------------------------------------------------------------------
-- 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['Sneak Attack'] = buffactive['sneak attack'] or false
state.Buff['Trick Attack'] = buffactive['trick attack'] or false
state.Buff['Feint'] = buffactive['feint'] or false
include('Mote-TreasureHunter')
-- For th_action_check():
-- JA IDs for actions that always have TH: Provoke, Animated Flourish
info.default_ja_ids = S{35, 204}
-- Unblinkable JA IDs for actions that always have TH: Quick/Box/Stutter Step, Desperate/Violent Flourish
info.default_u_ja_ids = S{201, 202, 203, 205, 207}
lockstyleset = 1
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', 'Acc', 'STP')
state.HybridMode:options('Normal', 'DT')
state.RangedMode:options('Normal', 'Acc')
state.WeaponskillMode:options('Normal', 'Acc')
state.IdleMode:options('Normal', 'DT')
state.CP = M(false, "Capacity Points Mode")
-- Additional local binds
send_command('bind ^` gs c cycle treasuremode')
send_command('bind !` input /ja "Flee" <me>')
send_command('bind @c gs c toggle CP')
send_command('bind ^z input /item "Echo Drops" <me>')
send_command('bind ^x input /item "Remedy" <me>')
send_command('bind ^c input /item "Holy Water" <me>')
send_command('bind ^- input /ja "Collaborator" <stpc>')
send_command('bind ^= input /ja "Conspirator" <me>')
if player.sub_job == 'WAR' then
send_command('bind ^numpad/ input /ja "Berserk" <me>')
send_command('bind ^numpad* input /ja "Warcry" <me>')
send_command('bind ^numpad- input /ja "Aggressor" <me>')
send_command('bind !numpad/ input /ja "Defender" <me>')
send_command('bind !. input /item "Silent Oil" <me>')
send_command('bind !, input /item "Prism Powder" <me>')
elseif player.sub_job == 'SAM' then
send_command('bind ^numpad/ input /ja "Meditate" <me>')
send_command('bind ^numpad* input /ja "Sekkanoki" <me>')
send_command('bind ^numpad- input /ja "Hasso" <me>')
send_command('bind !numpad* input /ja "Third Eye" <me>')
send_command('bind !numpad- input /ja "Seigan" <me>')
send_command('bind !. input /item "Silent Oil" <me>')
send_command('bind !, input /item "Prism Powder" <me>')
elseif player.sub_job == "NIN" then
send_command('bind !. input /ma "Monomi: Ichi" <me>')
send_command('bind !, input /ma "Tonko: Ni" <me>')
send_command('bind !numpad+ input /ma "Utsusemi: Ichi" <me>')
send_command('bind ^numpad+ input /ma "Utsusemi: Ni" <me>')
elseif player.sub_job == 'DNC' then
send_command('bind !. input /ja "Spectral Jig" <me>')
end
send_command('bind ^numpad9 input /ws "Exenterator" <t>')
send_command('bind ^numpad6 input /ws "Mandalic Stab" <t>')
send_command('bind ^numpad7 input /ws "Evisceration" <t>')
send_command('bind ^numpad8 input /ws "Dancing Edge" <t>')
send_command('bind ^numpad4 input /ws "Shark Bite" <t>')
send_command('bind ^numpad1 input /ws "Cyclone" <t>')
send_command('bind ^numpad0 input /ja "Sneak Attack" <me>')
send_command('bind ^numpad. input /ja "Trick Attack" <me>')
send_command('bind ^numlock input /ja "Assassin\'s Charge" <me>')
send_command('bind !numlock input /ja "Feint" <me>')
select_default_macro_book()
set_lockstyle()
end
-- Called when this job file is unloaded (eg: job change)
function user_unload()
send_command('unbind ^`')
send_command('unbind !`')
send_command('unbind ^,')
send_command('unbind @c')
send_command('unbind ^numlock')
send_command('unbind ^numpad/')
send_command('unbind ^numpad*')
send_command('unbind ^numpad-')
send_command('unbind ^numpad7')
send_command('unbind ^numpad8')
send_command('unbind ^numpad4')
send_command('unbind ^numpad9')
send_command('unbind ^numpad1')
send_command('unbind ^numpad0')
send_command('unbind ^numpad.')
send_command('unbind ^numpad+')
send_command('unbind !numpad+')
send_command('unbind ^z')
send_command('unbind ^x')
send_command('unbind ^c')
send_command('unbind !,')
send_command('unbind !.')
send_command('unbind ^-')
send_command('unbind ^=')
send_command('unbind #`')
send_command('unbind #1')
send_command('unbind #2')
send_command('unbind #3')
send_command('unbind #4')
send_command('unbind #5')
send_command('unbind #6')
send_command('unbind #7')
send_command('unbind #8')
send_command('unbind #9')
send_command('unbind #0')
end
-- Define sets and vars used by this job file.
function init_gear_sets()
------------------------------------------------------------------------------------------------
---------------------------------------- Ability Sets ------------------------------------------
------------------------------------------------------------------------------------------------
sets.TreasureHunter = {
hands="Asn. Armlets +1",
}
sets.buff['Sneak Attack'] = {
}
sets.buff['Trick Attack'] = {
}
-- Actions we want to use to tag TH.
sets.precast.Step = sets.TreasureHunter
sets.precast.Flourish1 = sets.TreasureHunter
sets.precast.JA.Provoke = sets.TreasureHunter
------------------------------------------------------------------------------------------------
---------------------------------------- Precast Sets ------------------------------------------
------------------------------------------------------------------------------------------------
-- Precast sets to enhance JAs
sets.precast.JA['Collaborator'] = {head="Skulker's Bonnet +1"}
sets.precast.JA['Accomplice'] = {head="Skulker's Bonnet +1"}
sets.precast.JA['Flee'] = {feet="Pill. Poulaines +2"}
sets.precast.JA['Hide'] = {body="Pillager's Vest +3"}
sets.precast.JA['Conspirator'] = {body="Skulker's Vest +1"}
sets.precast.JA['Steal'] = {
}
sets.precast.JA['Despoil'] = {ammo="Barathrum", legs="Skulk. Culottes +1", feet="Skulk. Poulaines +1"}
sets.precast.JA['Perfect Dodge'] = {hands="Plunderer's Armlets +1"}
sets.precast.JA['Feint'] = {legs="Plunderer's Culottes +1"}
sets.precast.JA['Sneak Attack'] = sets.buff['Sneak Attack']
sets.precast.JA['Trick Attack'] = sets.buff['Trick Attack']
sets.precast.Waltz = {
}
sets.precast.Waltz['Healing Waltz'] = {
}
sets.precast.RA = {}
sets.precast.FC = {
}
sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {
})
------------------------------------------------------------------------------------------------
------------------------------------- Weapon Skill Sets ----------------------------------------
------------------------------------------------------------------------------------------------
sets.precast.WS = {
ammo={ name="Bomb Core", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
head={ name="Empress Hairpin", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','Accuracy+2',}},
body={ name="Scp. Harness +1", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
hands="Assassin's Armlets",
legs={ name="Rogue's Culottes", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
feet={ name="Rogue's Poulaines", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
neck="Peacock Amulet",
waist={ name="Swordbelt +1", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
left_ear={ name="Pennon Earring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
right_ear={ name="Pennon Earring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
left_ring={ name="Toreador's Ring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
right_ring={ name="Toreador's Ring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
back={ name="Amemet Mantle +1", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
} -- default set
sets.precast.WS.Acc = set_combine(sets.precast.WS, {
})
sets.precast.WS['Exenterator'] = set_combine(sets.precast.WS, {
body={ name="Scp. Harness +1", augments={'Accuracy+5',}},
})
sets.precast.WS['Exenterator'].Acc = set_combine(sets.precast.WS['Exenterator'], {
})
sets.precast.WS['Dancing Edge'] = set_combine(sets.precast.WS, {
body={ name="Scp. Harness +1", augments={'Accuracy+5',}},
})
sets.precast.WS['Dancing Edge'].Acc = set_combine(sets.precast.WS['Dancing Edge'], {
})
sets.precast.WS['Evisceration'] = set_combine(sets.precast.WS, {
body={ name="Scp. Harness +1", augments={'Accuracy+5',}},
})
sets.precast.WS['Evisceration'].Acc = set_combine(sets.precast.WS['Evisceration'], {
})
sets.precast.WS['Rudra\'s Storm'] = set_combine(sets.precast.WS, {
})
sets.precast.WS['Rudra\'s Storm'].Acc = set_combine(sets.precast.WS['Rudra\'s Storm'], {
})
sets.precast.WS['Mandalic Stab'] = sets.precast.WS["Rudra's Storm"]
sets.precast.WS['Mandalic Stab'].Acc = sets.precast.WS["Rudra's Storm"].Acc
sets.precast.WS['Cyclone'] = set_combine(sets.precast.WS, {
head="Rogue's Bonnet",
neck="Lmg. Medallion +1",
left_ear="Moldavite Earring",
right_ear="Morion Earring",
left_ring="Snow Ring",
right_ring="Snow Ring",
})
sets.precast.WS['Cyclone'].TH = set_combine(sets.precast.WS['Cyclone'], sets.TreasureHunter)
------------------------------------------------------------------------------------------------
---------------------------------------- Midcast Sets ------------------------------------------
------------------------------------------------------------------------------------------------
sets.midcast.FastRecast = sets.precast.FC
sets.midcast.SpellInterrupt = {
}
sets.midcast.Utsusemi = sets.midcast.SpellInterrupt
sets.midcast.RA = {
head="Dragon Cap",
body="Noct Doublet +1",
hands="Sand Gloves",
legs="Bravo's Subligar",
feet="Bounding Boots",
neck="Peacock Amulet",
waist="R.K. Belt +2",
left_ear="Suppanomimi",
right_ear="Intruder Earring",
left_ring="Behemoth Ring",
right_ring="Behemoth Ring",
back="Kinesis Mantle +1",
}
------------------------------------------------------------------------------------------------
----------------------------------------- Idle Sets --------------------------------------------
------------------------------------------------------------------------------------------------
sets.resting = {}
sets.idle = {
ammo={ name="Bomb Core", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
head={ name="Empress Hairpin", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','Accuracy+2',}},
body={ name="Scp. Harness +1", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
hands="Assassin's Armlets",
legs={ name="Rogue's Culottes", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
feet={ name="Rogue's Poulaines", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
neck="Peacock Amulet",
waist={ name="Swordbelt +1", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
left_ear={ name="Pennon Earring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
right_ear={ name="Pennon Earring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
left_ring={ name="Toreador's Ring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
right_ring={ name="Toreador's Ring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
back={ name="Amemet Mantle +1", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
}
sets.idle.DT = set_combine(sets.idle, {
})
sets.idle.Weak = sets.idle.DT
------------------------------------------------------------------------------------------------
---------------------------------------- Defense Sets ------------------------------------------
------------------------------------------------------------------------------------------------
sets.defense.PDT = sets.idle.DT
sets.defense.MDT = sets.idle.DT
sets.Kiting = {feet="Trotter Boots"}
------------------------------------------------------------------------------------------------
---------------------------------------- Engaged Sets ------------------------------------------
------------------------------------------------------------------------------------------------
-- Engaged sets
-- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
-- sets if more refined versions aren't defined.
-- If you create a set with both offense and defense modes, the offense mode should be first.
-- EG: sets.engaged.Dagger.Accuracy.Evasion
sets.engaged = {
ammo={ name="Bomb Core", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
head={ name="Empress Hairpin", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','Accuracy+2',}},
body={ name="Scp. Harness +1", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
hands="Assassin's Armlets",
legs={ name="Rogue's Culottes", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
feet={ name="Rogue's Poulaines", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
neck="Peacock Amulet",
waist={ name="Swordbelt +1", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
left_ear={ name="Pennon Earring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
right_ear={ name="Pennon Earring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
left_ring={ name="Toreador's Ring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
right_ring={ name="Toreador's Ring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
back={ name="Amemet Mantle +1", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','DEX+4',}},
} -- 41%
sets.engaged.Acc = set_combine(sets.engaged, {
body={ name="Scp. Harness +1", augments={'Accuracy+5',}},
})
sets.engaged.STP = set_combine(sets.engaged, {
})
------------------------------------------------------------------------------------------------
---------------------------------------- Hybrid Sets -------------------------------------------
------------------------------------------------------------------------------------------------
sets.engaged.Hybrid = {
}
------------------------------------------------------------------------------------------------
---------------------------------------- Special Sets ------------------------------------------
------------------------------------------------------------------------------------------------
sets.buff.Doom = {ring1="Eshmun's Ring", ring2="Eshmun's Ring", waist="Gishdubar Sash"}
sets.Reive = {neck="Ygnas's Resolve +1"}
sets.CP = {back="Mecisto. Mantle"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
function job_precast(spell, action, spellMap, eventArgs)
if spellMap == 'Utsusemi' then
if buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)'] then
cancel_spell()
add_to_chat(123, '**!! '..spell.english..' Canceled: [3+ IMAGES] !!**')
eventArgs.handled = true
return
elseif buffactive['Copy Image'] or buffactive['Copy Image (2)'] then
send_command('cancel 66; cancel 444; cancel Copy Image; cancel Copy Image (2)')
end
end
end
-- Run after the general precast() is done.
function job_post_precast(spell, action, spellMap, eventArgs)
if spell.english == 'Aeolian Edge' and state.TreasureMode.value ~= 'None' then
equip(sets.TreasureHunter)
elseif spell.english=='Sneak Attack' or spell.english=='Trick Attack' then
if state.TreasureMode.value == 'SATA' or state.TreasureMode.value == 'Fulltime' then
equip(sets.TreasureHunter)
end
end
if spell.type == "WeaponSkill" then
if state.Buff['Sneak Attack'] == true or state.Buff['Trick Attack'] == true then
equip(sets.precast.WS.Critical)
end
end
end
-- Run after the general midcast() set is constructed.
function job_post_midcast(spell, action, spellMap, eventArgs)
if state.TreasureMode.value ~= 'None' and spell.action_type == 'Ranged Attack' then
equip(sets.TreasureHunter)
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)
-- Weaponskills wipe SATA/Feint. Turn those state vars off before default gearing is attempted.
if spell.type == 'WeaponSkill' and not spell.interrupted then
state.Buff['Sneak Attack'] = false
state.Buff['Trick Attack'] = false
state.Buff['Feint'] = false
end
end
-- Called after the default aftercast handling is complete.
function job_post_aftercast(spell, action, spellMap, eventArgs)
-- If Feint is active, put that gear set on on top of regular gear.
-- This includes overlaying SATA gear.
check_buff('Feint', eventArgs)
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 we gain or lose any haste buffs, adjust gear.
if S{'haste', 'march', 'mighty guard', 'embrava', 'haste samba', 'geo-haste', 'indi-haste'}:contains(buff:lower()) then
determine_haste_group()
if not gain then
haste = nil
--add_to_chat(122, "Haste Status: Cleared")
end
if not midaction() then
handle_equipping_gear(player.status)
end
end
-- if buffactive['Reive Mark'] then
-- if gain then
-- equip(sets.Reive)
-- disable('neck')
-- else
-- enable('neck')
-- end
-- end
if buff == "doom" then
if gain then
equip(sets.buff.Doom)
send_command('@input /p Doomed.')
disable('ring1','ring2','waist')
else
enable('ring1','ring2','waist')
handle_equipping_gear(player.status)
end
end
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.
-------------------------------------------------------------------------------------------------------------------
-- 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)
determine_haste_group()
th_update(cmdParams, eventArgs)
end
function get_custom_wsmode(spell, spellMap, defaut_wsmode)
local wsmode
if state.Buff['Sneak Attack'] then
wsmode = 'SA'
end
if state.Buff['Trick Attack'] then
wsmode = (wsmode or '') .. 'TA'
end
return wsmode
end
-- Called any time we attempt to handle automatic gear equips (ie: engaged or idle gear).
function job_handle_equipping_gear(playerStatus, eventArgs)
-- Check that ranged slot is locked, if necessary
check_range_lock()
-- Check for SATA when equipping gear. If either is active, equip
-- that gear specifically, and block equipping default gear.
check_buff('Sneak Attack', eventArgs)
check_buff('Trick Attack', eventArgs)
end
function customize_idle_set(idleSet)
if state.CP.current == 'on' then
equip(sets.CP)
disable('back')
else
enable('back')
end
return idleSet
end
function customize_melee_set(meleeSet)
if state.TreasureMode.value == 'Fulltime' then
meleeSet = set_combine(meleeSet, sets.TreasureHunter)
end
return meleeSet
end
-- Function to display the current relevant user state when doing an update.
-- Return true if display was handled, and you don't want the default info shown.
function display_current_job_state(eventArgs)
local msg = '[ Melee'
if state.CombatForm.has_value then
msg = msg .. ' (' .. state.CombatForm.value .. ')'
end
msg = msg .. ': '
msg = msg .. state.OffenseMode.value
if state.HybridMode.value ~= 'Normal' then
msg = msg .. '/' .. state.HybridMode.value
end
msg = msg .. ' ][ WS: ' .. state.WeaponskillMode.value
if state.DefenseMode.value ~= 'None' then
msg = msg .. ' ][ Defense: ' .. state.DefenseMode.value .. state[state.DefenseMode.value .. 'DefenseMode'].value
end
if state.Kiting.value then
msg = msg .. ' ][ Kiting Mode: ON'
end
msg = msg .. ' ][ TH: ' .. state.TreasureMode.value
msg = msg .. ' ]'
add_to_chat(060, msg)
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
--Read incoming packet to differentiate between Haste I and II
windower.register_event('action',
function(act)
--check if you are a target of spell
local actionTargets = act.targets
playerId = windower.ffxi.get_player().id
isTarget = false
for _, target in ipairs(actionTargets) do
if playerId == target.id then
isTarget = true
end
end
if isTarget == true then
if act.category == 4 then
local param = act.param
if param == 57 then
--add_to_chat(122, 'Haste Status: Haste I (Haste)')
haste = 1
elseif param == 511 then
--add_to_chat(122, 'Haste Status: Haste II (Haste II)')
haste = 2
end
elseif act.category == 5 then
if act.param == 5389 then
--add_to_chat(122, 'Haste Status: Haste II (Spy Drink)')
haste = 2
end
elseif act.category == 13 then
local param = act.param
if param == 595 and haste ~= 2 then
--add_to_chat(122, 'Haste Status: Haste I (Hastega)')
haste = 1
elseif param == 602 then
--add_to_chat(122, 'Haste Status: Haste II (Hastega2)')
haste = 2
end
end
end
end)
function determine_haste_group()
-- Assuming the following values:
-- Haste - 15%
-- Haste II - 30%
-- Haste Samba - 5%
-- Honor March - 15%
-- Victory March - 25%
-- Advancing March - 15%
-- Embrava - 25%
-- Mighty Guard (buffactive[604]) - 15%
-- Geo-Haste (buffactive[580]) - 30%
classes.CustomMeleeGroups:clear()
if (haste == 2 and (buffactive[580] or buffactive.march or buffactive.embrava or buffactive[604])) or
(haste == 1 and (buffactive[580] or buffactive.march == 2 or (buffactive.embrava and buffactive['haste samba']) or (buffactive.march and buffactive[604]))) or
(buffactive[580] and (buffactive.march or buffactive.embrava or buffactive[604])) or
(buffactive.march == 2 and (buffactive.embrava or buffactive[604])) or
(buffactive.march and (buffactive.embrava and buffactive['haste samba'])) then
--add_to_chat(122, 'Magic Haste Level: 43%')
classes.CustomMeleeGroups:append('MaxHaste')
elseif ((haste == 2 or buffactive[580] or buffactive.march == 2) and buffactive['haste samba']) or
(haste == 1 and buffactive['haste samba'] and (buffactive.march or buffactive[604])) or
(buffactive.march and buffactive['haste samba'] and buffactive[604]) then
--add_to_chat(122, 'Magic Haste Level: 35%')
classes.CustomMeleeGroups:append('HighHaste')
elseif (haste == 2 or buffactive[580] or buffactive.march == 2 or (buffactive.embrava and buffactive['haste samba']) or
(haste == 1 and (buffactive.march or buffactive[604])) or (buffactive.march and buffactive[604])) then
--add_to_chat(122, 'Magic Haste Level: 30%')
classes.CustomMeleeGroups:append('MidHaste')
elseif (haste == 1 or buffactive.march or buffactive[604] or buffactive.embrava) then
--add_to_chat(122, 'Magic Haste Level: 15%')
classes.CustomMeleeGroups:append('LowHaste')
end
end
-- State buff checks that will equip buff gear and mark the event as handled.
function check_buff(buff_name, eventArgs)
if state.Buff[buff_name] then
equip(sets.buff[buff_name] or {})
if state.TreasureMode.value == 'SATA' or state.TreasureMode.value == 'Fulltime' then
equip(sets.TreasureHunter)
end
eventArgs.handled = true
end
end
-- Check for various actions that we've specified in user code as being used with TH gear.
-- This will only ever be called if TreasureMode is not 'None'.
-- Category and Param are as specified in the action event packet.
function th_action_check(category, param)
if category == 2 or -- any ranged attack
--category == 4 or -- any magic action
(category == 3 and param == 30) or -- Aeolian Edge
(category == 6 and info.default_ja_ids:contains(param)) or -- Provoke, Animated Flourish
(category == 14 and info.default_u_ja_ids:contains(param)) -- Quick/Box/Stutter Step, Desperate/Violent Flourish
then return true
end
end
-- Function to lock the ranged slot if we have a ranged weapon equipped.
function check_range_lock()
if player.equipment.range ~= 'empty' then
disable('range', 'ammo')
else
enable('range', 'ammo')
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(1, 1)
elseif player.sub_job == 'WAR' then
set_macro_page(2, 1)
elseif player.sub_job == 'NIN' then
set_macro_page(3, 1)
else
set_macro_page(1, 1)
end
end
function set_lockstyle()
send_command('wait 2; input /lockstyleset ' .. lockstyleset)
end
Lakshmi.Elidyr
サーバ: Lakshmi
Game: FFXI
Posts: 912
By Lakshmi.Elidyr 2022-01-09 11:27:22
Here is a copy of the lua I'm currently getting this error on:
Line: 19 > Mote-UtilityCode if abil_recasts[spell.recast_id] and abil_recasts[spell.recast_id] > 0 then
This should prevent the error, but doesn't explain why it is happening. I am not familiar with any gearswaps outside of my own so I could not help any further, sorry. :(
By Zyla 2022-01-09 14:47:03
if abil_recasts[spell.recast_id] and abil_recasts[spell.recast_id] > 0 then That seems to have fixed the issue for the moment, thanks man you're made of awesome.
サーバ: Asura
Game: FFXI
Posts: 415
By Asura.Cambion 2022-01-09 17:06:10
Here is a copy of the lua I'm currently getting this error on:
Line: 19 > Mote-UtilityCode if abil_recasts[spell.recast_id] and abil_recasts[spell.recast_id] > 0 then
This should prevent the error, but doesn't explain why it is happening. I am not familiar with any gearswaps outside of my own so I could not help any further, sorry. :(
I could be wrong, but my guess is that error is related to the fact that the IDs are wrong. That entire script is screwed up in my opinion, as all of the Waltz IDs were changed at some point, and those IDs it's trying to check are no longer tied to the Dancer Job.
I've addressed it in the Dnc forum a few times now.
Lakshmi.Elidyr
サーバ: Lakshmi
Game: FFXI
Posts: 912
By Lakshmi.Elidyr 2022-01-09 17:39:33
You're not wrong, which is why I said it doesn't explain why it is happening. Lot's of these files have poor error checking though. So it won't fix the underlying cause. It will prevent the error from happening when it receives an ID it didn't expect. Not sure why it would be hard-checking an ID of a spell inside gearswap though. spell.id should match current resources, unless maybe it's not on current retail.
サーバ: Asura
Game: FFXI
Posts: 415
By Asura.Cambion 2022-01-10 12:54:47
You're not wrong, which is why I said it doesn't explain why it is happening. Lot's of these files have poor error checking though. So it won't fix the underlying cause. It will prevent the error from happening when it receives an ID it didn't expect. Not sure why it would be hard-checking an ID of a spell inside gearswap though. spell.id should match current resources, unless maybe it's not on current retail.
I might not be following, so I apologize if that's the case.
I was trying to say, the reason the error is coming up as "attempt to compare number with nil." is because one of the IDs (if not multiple) doesn't exist in the game, so the file literally can't determine if the cooldown is more than or less than 0, and therefor returns a NIL value.
In simplistic terms, the lua is trying to determine if the cooldown of <pick an ability from a different game> is more than or less than 0, and the lua is telling you, I can't compare that ability timer to 0, because it doesn't exist in this game.
For any Dancers who want the updated script, here is my version which also includes up/downgrades for Divine Waltz as well.
Code -------------------------------------------------------------------------------------------------------------------
-- Utility functions for changing spells and target types in an automatic manner.
-------------------------------------------------------------------------------------------------------------------
local waltz_tp_cost = {['Curing Waltz'] = 200, ['Curing Waltz II'] = 350, ['Curing Waltz III'] = 500, ['Curing Waltz IV'] = 650, ['Curing Waltz V'] = 800}
-- Utility function for automatically adjusting the waltz spell being used to match HP needs and TP limits.
-- Handle spell changes before attempting any precast stuff.
function refine_waltz(spell, action, spellMap, eventArgs)
if spell.type ~= 'Waltz' then
return
end
-- Don't modify anything for Healing Waltz or Divine Waltz
if spell.english == "Healing Waltz" or spell.english == "Divine Waltz" then
return
end
local abil_recasts = windower.ffxi.get_ability_recasts()
local spell_recasts = windower.ffxi.get_spell_recasts()
local newWaltz = spell.english
local missingHP
local waltzID
if spell.english == "Divine Waltz II" then
if spell.english == "Divine Waltz II" and abil_recasts[190] < 1 and player.tp > 800 then
newWaltz = 'Divine Waltz II'
waltzID = 190
elseif abil_recasts[225] < 1 and player.tp > 400 then
add_to_chat(122,'Downgrading to Divine Waltz')
newWaltz = 'Divine Waltz'
waltzID = 225
else
add_to_chat(122,'Insufficient TP or Timers')
eventArgs.cancel = true
return
end
-- If curing ourself, get our exact missing HP
elseif spell.target.type == "SELF" then
missingHP = player.max_hp - player.hp
-- If curing someone in our alliance, we can estimate their missing HP
elseif spell.target.isallymember then
local target = find_player_in_alliance(spell.target.name)
local est_max_hp = target.hp / (target.hpp/100)
missingHP = math.floor(est_max_hp - target.hp)
end
-- If we have an estimated missing HP value, we can adjust the preferred tier used.
-- Current Self Waltz Values 8/04/2019
-- Waltz 1 = 383
-- Waltz 2 = 719
-- Waltz 3 = 1168
-- Waltz 4 = 1683
-- Waltz 5 = 2157
-- Ability Recast IDs as of 6/20/2021
-- Waltz 1 = 217
-- Waltz 2 = 186
-- Waltz 3 = 187
-- Waltz 4 = 188
-- Waltz 5 = 189
-- Divine 2 = 190
-- Divine 1 = 225
if missingHP ~= nil then
if player.main_job == 'DNC' then
if missingHP < 100 and spell.target.name == player.name then
-- Not worth curing yourself for so little.
-- Don't block when curing others to allow for waking them up.
add_to_chat(122,'Full HP!')
eventArgs.cancel = true
return
elseif missingHP < 500 then
if abil_recasts[217] < 1 and player.tp > 200 then
newWaltz = 'Curing Waltz'
waltzID = 217
elseif abil_recasts[186] < 1 and player.tp > 350 then
newWaltz = 'Curing Waltz II'
waltzID = 186
elseif abil_recasts[187] < 1 and player.tp > 500 then
newWaltz = 'Curing Waltz III'
waltzID = 187
elseif abil_recasts[188] < 1 and player.tp > 650 then
newWaltz = 'Curing Waltz IV'
waltzID = 188
end
elseif missingHP < 1000 then
if abil_recasts[186] < 1 and player.tp > 350 then
newWaltz = 'Curing Waltz II'
waltzID = 186
elseif abil_recasts[217] < 1 and player.tp > 200 then
newWaltz = 'Curing Waltz'
waltzID = 217
elseif abil_recasts[187] < 1 and player.tp > 500 then
newWaltz = 'Curing Waltz III'
waltzID = 187
elseif abil_recasts[188] < 1 and player.tp > 650 then
newWaltz = 'Curing Waltz IV'
waltzID = 188
end
elseif missingHP < 1400 then
if abil_recasts[187] < 1 and player.tp > 500 then
newWaltz = 'Curing Waltz III'
waltzID = 187
elseif abil_recasts[186] < 1 and player.tp > 350 then
newWaltz = 'Curing Waltz II'
waltzID = 186
elseif abil_recasts[188] < 1 and player.tp > 650 then
newWaltz = 'Curing Waltz IV'
waltzID = 188
elseif abil_recasts[189] < 1 and player.tp > 800 then
newWaltz = 'Curing Waltz V'
waltzID = 189
elseif abil_recasts[217] < 1 and player.tp > 200 then
newWaltz = 'Curing Waltz'
waltzID = 217
end
elseif missingHP < 1900 then
if abil_recasts[188] < 1 and player.tp > 650 then
newWaltz = 'Curing Waltz IV'
waltzID = 188
elseif abil_recasts[187] < 1 and player.tp > 500 then
newWaltz = 'Curing Waltz III'
waltzID = 187
elseif abil_recasts[186] < 1 and player.tp > 350 then
newWaltz = 'Curing Waltz II'
waltzID = 186
elseif abil_recasts[189] < 1 and player.tp > 800 then
newWaltz = 'Curing Waltz V'
waltzID = 189
elseif abil_recasts[217] < 1 and player.tp > 200 then
newWaltz = 'Curing Waltz'
waltzID = 217
end
else
if abil_recasts[189] < 1 and player.tp > 800 then
newWaltz = 'Curing Waltz V'
waltzID = 189
elseif abil_recasts[188] < 1 and player.tp > 650 then
newWaltz = 'Curing Waltz IV'
waltzID = 188
elseif abil_recasts[187] < 1 and player.tp > 500 then
newWaltz = 'Curing Waltz III'
waltzID = 187
elseif abil_recasts[186] < 1 and player.tp > 350 then
newWaltz = 'Curing Waltz II'
waltzID = 186
elseif abil_recasts[217] < 1 and player.tp > 200 then
newWaltz = 'Curing Waltz'
waltzID = 217
end
end
elseif player.sub_job == 'DNC' then
if missingHP < 40 and spell.target.name == player.name then
-- Not worth curing yourself for so little.
-- Don't block when curing others to allow for waking them up.
add_to_chat(122,'Full HP!')
eventArgs.cancel = true
return
elseif missingHP < 150 then
newWaltz = 'Curing Waltz'
waltzID = 217
elseif missingHP < 300 then
newWaltz = 'Curing Waltz II'
waltzID = 186
else
newWaltz = 'Curing Waltz III'
waltzID = 187
end
else
-- Not dnc main or sub; bail out
return
end
end
local tpCost = waltz_tp_cost[newWaltz]
if newWaltz ~= spell.english then
send_command('@input /ja "'..newWaltz..'" '..tostring(spell.target.raw))
eventArgs.cancel = true
return
end
if missingHP and missingHP > 0 then
add_to_chat(122,'Trying to cure '..tostring(missingHP)..' HP using '..newWaltz..'.')
end
end
Mote files have Waltz as ID:
190 (Waltz 1)
191 (Waltz 2)
192 (Waltz 3)
193 (Waltz 4)
311 (Waltz 5)
My records show the correct IDs as of 6/20/2021
Waltz 1 = 217
Waltz 2 = 186
Waltz 3 = 187
Waltz 4 = 188
Waltz 5 = 189
Divine 2 = 190
Divine 1 = 225
サーバ: Asura
Game: FFXI
Posts: 18
By Asura.Desperado 2022-01-13 03:21:51
after the recent update, I keep getting the following error:
Gearswap has detected an error in the user function self_command:
...windower4/addons/gearswap/libs/mote-selfcommands.lua 56:attempt to call method 'slice' (a nil value)
Bismarck.Xurion
サーバ: Bismarck
Game: FFXI
Posts: 694
By Bismarck.Xurion 2022-01-13 08:11:43
after the recent update, I keep getting the following error:
Gearswap has detected an error in the user function self_command:
...windower4/addons/gearswap/libs/mote-selfcommands.lua 56:attempt to call method 'slice' (a nil value) That motes file doesn't contain slice at all. Can you post the contents of that file?
サーバ: Asura
Game: FFXI
Posts: 18
By Asura.Desperado 2022-01-13 16:01:02
just reopened windower and got upadates.. i no longer have the issue. thank you.
[+]
By Zyla 2022-01-14 16:33:34
Hello again, sorry to have another question so soon after the last, but this one has been wracking my brain. I'm trying to equip 2 identical rings, but the left ring won't work. I've tried the methods of putting them in separate bags, as well as separating the ring command lines in the lua. I think where I'm lost at here is maybe the structure of the ring data itself? I play on a private server currently that has custom augments, so this is what the rings both look like:
left_ring={ name="Sniper's Ring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','Accuracy+2',}},
right_ring={ name="Sniper's Ring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','Accuracy+2',}},
So exactly what am I missing here? I tried adding the bag='wardrobe1' argument to the end of it after the augment list, but that didn't work either. The odd thing is that it only seems to do this with rings, my earrings work just fine.
Leviathan.Boposhopo
サーバ: Leviathan
Game: FFXI
Posts: 229
By Leviathan.Boposhopo 2022-01-14 17:14:19
Hello again, sorry to have another question so soon after the last, but this one has been wracking my brain. I'm trying to equip 2 identical rings, but the left ring won't work. I've tried the methods of putting them in separate bags, as well as separating the ring command lines in the lua. I think where I'm lost at here is maybe the structure of the ring data itself? I play on a private server currently that has custom augments, so this is what the rings both look like:
left_ring={ name="Sniper's Ring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','Accuracy+2',}},
right_ring={ name="Sniper's Ring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','Accuracy+2',}},
So exactly what am I missing here? I tried adding the bag='wardrobe1' argument to the end of it after the augment list, but that didn't work either. The odd thing is that it only seems to do this with rings, my earrings work just fine.
You can define which bag the items are in like this
right_ring={ name="Sniper's Ring", bag="wardrobe2"},
By Zyla 2022-01-14 17:49:42
I tried adding that to the line, but it didn't work. Which is why I'm wondering how that would look in terms of line structure with the augments
サーバ: Asura
Game: FFXI
Posts: 37
By Asura.Zigzagzig 2022-01-14 21:03:12
What i did , seens to work for now : is
example:
sets.midcast[''] = {
head="",
right_ear="",
left_ring={name="Stikini Ring +1", bag="wardrobe1"},
neck="",
hands="",
right_ring={name="Stikini Ring +1", bag="wardrobe4"},
waist="",
legs="",
feet="",
back=""}
is to make sure than at last 2 lines separate the load on the sets, also 2 bags separate the Items ( don't know why ).
The Location also fix the load from Melee Sets 1hand weapon To > a 2.Hand weapon ( sword + shield by example ) / : gear={ name="", bag="location"},
You could also tried Priority load ( higher ==> lower )
ex: sets.midcast[''] = {
head="",
right_ear="",
left_ring={name="Stikini Ring +1", bag="wardrobe1", priority=2},
neck="",
hands="",
right_ring={name="Stikini Ring +1", bag="wardrobe4", priority=1},
waist="",
legs="",
feet="",
back=""}
By Zyla 2022-01-14 23:31:33
I've tried separating the 2 lines and that didn't work. Where would I put the text for the wardrobe at in relation to the list of augments? Would that go before the list of augments or after?
Example of what I mean:
left_ring={ name="Sniper's Ring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','Accuracy+2',}},
right_ring={ name="Sniper's Ring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','Accuracy+2',}},
Where in those lines would bag='wardrobe1' actually go?
サーバ: Asura
Game: FFXI
Posts: 37
By Asura.Zigzagzig 2022-01-15 04:04:36
left_ring={ name="Sniper's Ring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','Accuracy+2',}} , bag="wardrobe1",
[+]
Bismarck.Xurion
サーバ: Bismarck
Game: FFXI
Posts: 694
By Bismarck.Xurion 2022-01-15 07:02:50
left_ring={ name="Sniper's Ring", augments={'Attack+10','"Dbl.Atk."+1','Haste+2','Accuracy+2',}, bag="wardrobe1"} Fixed - bracket was in wrong place :)
By Zyla 2022-01-15 07:44:24
Thanks guys, that seemed to have fixed my issue, I was in fact putting it in the wrong place I think.
[+]
サーバ: Asura
Game: FFXI
Posts: 31
By Asura.Bladework 2022-01-19 03:21:20
function has_any_buff_of(buff_set)
for i,v in pairs(buff_set) do
if buffactive[v] ~= nil then
return true
end
end
end
Learning more about gear swap lately and it all seems pretty straightforward except for a few function lines like I just pasted above. WHAT DOES IT DO???? It’s coded so much different. Essentially I want to remove it or at least know why the function exists.
Quetzalcoatl.Aravil
サーバ: Quetzalcoatl
Game: FFXI
Posts: 5
By Quetzalcoatl.Aravil 2022-01-19 06:55:27
You pass the function a list of buffs (looks to be names, not IDs). It then iterates through that list and checks if any of them are active. If it finds one, it returns true.
Bismarck.Xurion
サーバ: Bismarck
Game: FFXI
Posts: 694
By Bismarck.Xurion 2022-01-19 08:56:07
You can remove it, as long as it isn't referenced anywhere else.
Fenrir.Pog
サーバ: Fenrir
Game: FFXI
Posts: 4
By Fenrir.Pog 2022-02-10 15:18:51
Is anyone else getting Gearswap errors in Windower while transferring equipment to the new wardrobes?
It appears to me that Gearswap seems to be using FindAll addon to index where all of your equipment is located. I don't think that FindAll knows how to handle indexing the new wardrobes. It might just be a simple FindAll fix.
The error in question from the Windower console: Code Gearswap: Lua runtime error: Gearswap/packet_parsing:165: attempt to index field '?' (a nil value)
I'm not really sure if this is the correct place to be asking about this error or if should be asked to the FindAll people. My hope is this is just a wait for an update to either Gearswap or FindAll for a fix.
Leviathan.Boposhopo
サーバ: Leviathan
Game: FFXI
Posts: 229
By Leviathan.Boposhopo 2022-02-10 15:28:31
Is anyone else getting Gearswap errors in Windower while transferring equipment to the new wardrobes?
It appears to me that Gearswap seems to be using FindAll addon to index where all of your equipment is located. I don't think that FindAll knows how to handle indexing the new wardrobes. It might just be a simple FindAll fix.
The error in question from the Windower console: Code Gearswap: Lua runtime error: Gearswap/packet_parsing:165: attempt to index field '?' (a nil value)
I'm not really sure if this is the correct place to be asking about this error or if should be asked to the FindAll people. My hope is this is just a wait for an update to either Gearswap or FindAll for a fix.
Yes, here's an entire other thread about all the ***that broke this update. It'll take a while for them to fix it all.
Fenrir.Pog
サーバ: Fenrir
Game: FFXI
Posts: 4
By Fenrir.Pog 2022-02-10 15:31:23
Thanks for pointing me to this, I also stumbled upon after I posted.
Leviathan.Boposhopo said: »
Yes, here's an entire other thread about all the ***that broke this update. It'll take a while for them to fix it all.
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.
|
|