|
Gearswap Support Thread
Carbuncle.Kigensuro
Serveur: Carbuncle
Game: FFXI
Posts: 93
By Carbuncle.Kigensuro 2019-03-10 19:02:58
Carbuncle.Kigensuro said: »Thanks. This was interesting. So I tried that command on a trust, "Zeid II" and this is what I got:
...
Tried that on myself and got roughly the same with some different values.
...
I can see some of the values are name, distance, xpos, ypos, and whatnot, but the fact they're reporting back as nil makes it hard to know what syntax to use in the lua.
How do I know from that table that I needed to use xxx.is_npc?
Sorry to be pain; I'm just eager to learn more. your output is wonky because the code has an error
Code for k,v in pairs(party[#].mob) then
windower.add_to_chat(2, tostring(i)..' '..tostring(v))
end
the first line says for k,v in pairs
it is breaking up the table and putting the data in to local variables k(location) and v(variable)
how ever when it tries to write the data so it can be seen
windower.add_to_chat(2, tostring(i)..' '..tostring(v))
it uses i for the location
so the easiest fix is to change the i in tostring(i) to k
or the k in for k,v to i
That worked perfectly and has been a great help to me! Thank you.
I had another question though. I'm working on an addon and was attempting to use windower.ffxi.get_party().p# to obtain the parties buffs/debuffs. I ran the code above to see what was contained in windower.ffxi.get_party().p# table and don't see a buffs table. Gearswap has this option for party[#].buffactive so I know it's possible somehow, but I am at a loss again. gearswap gets party buffs from packets not windower.ffxi.get_party()
By Tubguy 2019-03-19 06:54:18
Hi,
Long time listener, first time caller. <3
I'm having an issue where I can't get //gs export to recognize the augments on my Rostams (Path A and Path C) and typing out augs manually isn't working either.
I was wondering if this is a known issue or if there is an easy fix or workaround.
Serveur: Asura
Game: FFXI
Posts: 91
By Asura.Bigtymer 2019-03-19 11:05:37
Put them in different bags, and instead of referencing augments, you reference the bag name:
Code equip({main={name="Rostam",bag="Wardrobe"},sub={name="Rostam",bag="Wardrobe 2"}})
By Tubguy 2019-03-20 02:44:41
Put them in different bags, and instead of referencing augments, you reference the bag name:
Code equip({main={name="Rostam",bag="Wardrobe"},sub={name="Rostam",bag="Wardrobe 2"}})
Thank you very much :)
By zhain 2019-03-25 11:49:19
I was hoping someone can help me out with a gearswap issue I am having with my BRD lua.
When I debug my lua, it appears that only the base FC set is activating for spells/songs. The cure set, stoneskin, enhancing, and most importantly the song precast sets do not activate.
If there is a better location for lua collaboration please let me know.
Thanks!
Code
-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
--[[
Custom commands:
ExtraSongsMode may take one of three values: None, Dummy, FullLength
You can set these via the standard 'set' and 'cycle' self-commands. EG:
gs c cycle ExtraSongsMode
gs c set ExtraSongsMode Dummy
The Dummy state will equip the bonus song instrument and ensure non-duration gear is equipped.
The FullLength state will simply equip the bonus song instrument on top of standard gear.
Simple macro to cast a dummy Daurdabla song:
/console gs c set ExtraSongsMode Dummy
/ma "Shining Fantasia" <me>
To use a Terpander rather than Daurdabla, set the info.ExtraSongInstrument variable to
'Terpander', and info.ExtraSongs to 1.
--]]
-- 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.ExtraSongsMode = M{['description']='Extra Songs', 'None', 'Dummy', 'FullLength'}
state.Buff['Pianissimo'] = buffactive['pianissimo'] or false
-- For tracking current recast timers via the Timers plugin.
custom_timers = {}
end
-------------------------------------------------------------------------------------------------------------------
-- User setup functions for this job. Recommend that these be overridden in a sidecar file.
-------------------------------------------------------------------------------------------------------------------
-- Setup vars that are user-dependent. Can override this function in a sidecar file.
function user_setup()
state.OffenseMode:options('None', 'Normal')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'PDT')
brd_daggers = S{'Izhiikoh', 'Vanir Knife', 'Atoyac', 'Aphotic Kukri', 'Sabebus'}
pick_tp_weapon()
-- Adjust this if using the Terpander (new +song instrument)
info.ExtraSongInstrument = 'Daurdabla'
-- How many extra songs we can keep from Daurdabla/Terpander
info.ExtraSongs = 2
-- Set this to false if you don't want to use custom timers.
state.UseCustomTimers = M(true, 'Use Custom Timers')
-- Additional local binds
send_command('bind ^` gs c cycle ExtraSongsMode')
select_default_macro_book()
end
-- Called when this job file is unloaded (eg: job change)
function user_unload()
send_command('unbind ^`')
end
-- Define sets and vars used by this job file.
function init_gear_sets()
--------------------------------------
-- Start defining the sets
--------------------------------------
-- Precast Sets
-- Fast cast sets for spells
sets.precast.FastCast = {
main="Kali",
sub="Genbu's Shield",
ammo="Impatiens",
head="Welkin Crown",
body="Inyanga Jubbah +2",
hands={ name="Leyline Gloves", augments={'Accuracy+14','Mag. Acc.+13','"Mag.Atk.Bns."+13','"Fast Cast"+2',}},
legs={ name="Kaykaus Tights +1", augments={'MP+80','"Cure" spellcasting time -7%','Enmity-6',}},
feet={ name="Kaykaus Boots +1", augments={'Mag. Acc.+20','"Cure" potency +6%','"Fast Cast"+4',}},
neck="Baetyl Pendant",
waist="Witful Belt",
left_ear="Loquac. Earring",
right_ear="Etiolation Earring",
left_ring="Kishar Ring",
right_ring="Lebeche Ring",
back="Moonlight Cape",
}
sets.precast.FastCast.Cure = set_combine(sets.precast.FastCast, {
body="Heka's Kalasiris",
right_ear="Mendi. Earring",
})
sets.precast.FastCast.Stoneskin = set_combine(sets.precast.FastCast, {
waist="Siegel Sash",
})
sets.precast.FastCast['Enhancing Magic'] = set_combine(sets.precast.FastCast, {
})
sets.precast.FastCast.BardSong = {
main="Kali",
sub="Genbu's Shield",
range="Gjallarhorn",
head="Fili Calot +1",
body="Inyanga Jubbah +2",
hands={ name="Leyline Gloves", augments={'Accuracy+14','Mag. Acc.+13','"Mag.Atk.Bns."+13','"Fast Cast"+2',}},
legs={ name="Kaykaus Tights +1", augments={'MP+80','"Cure" spellcasting time -7%','Enmity-6',}},
feet="Bihu Slippers +3",
neck="Baetyl Pendant",
waist="Witful Belt",
ear1="Aoidos' Earring",
right_ear="Etiolation Earring",
left_ring="Kishar Ring",
right_ring="Lebeche Ring",
back="Moonlight Cape",
}
sets.precast.FC.Daurdabla = set_combine(sets.precast.FC.BardSong, {range=info.ExtraSongInstrument})
-- Precast sets to enhance JAs
sets.precast.JA.Nightingale = {feet="Bihu Slippers +3"}
sets.precast.JA.Troubadour = {body="Bihu Justaucorps +3"}
sets.precast.JA['Soul Voice'] = {legs="Bihu Cannions +2"}
-- Waltz set (chr and vit)
sets.precast.Waltz = {
}
-- 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['Evisceration'] = set_combine(sets.precast.WS)
sets.precast.WS['Exenterator'] = set_combine(sets.precast.WS)
sets.precast.WS['Mordant Rime'] = set_combine(sets.precast.WS)
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
-- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
function job_precast(spell, action, spellMap, eventArgs)
if spell.type == 'BardSong' then
-- Auto-Pianissimo
if ((spell.target.type == 'PLAYER' and not spell.target.charmed) or (spell.target.type == 'NPC' and spell.target.in_party)) and
not state.Buff['Pianissimo'] then
local spell_recasts = windower.ffxi.get_spell_recasts()
if spell_recasts[spell.recast_id] < 2 then
send_command('@input /ja "Pianissimo" <me>; wait 1.5; input /ma "'..spell.name..'" '..spell.target.name)
eventArgs.cancel = true
return
end
end
end
end
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
function job_midcast(spell, action, spellMap, eventArgs)
if spell.action_type == 'Magic' then
if spell.type == 'BardSong' then
-- layer general gear on first, then let default handler add song-specific gear.
local generalClass = get_song_class(spell)
if generalClass and sets.midcast[generalClass] then
equip(sets.midcast[generalClass])
end
end
end
end
function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.type == 'BardSong' then
if state.ExtraSongsMode.value == 'FullLength' then
equip(sets.midcast.Daurdabla)
end
state.ExtraSongsMode:reset()
end
end
-- Set eventArgs.handled to true if we don't want automatic gear equipping to be done.
function job_aftercast(spell, action, spellMap, eventArgs)
if spell.type == 'BardSong' and not spell.interrupted then
if spell.target and spell.target.type == 'SELF' then
adjust_timers(spell, spellMap)
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
if stateField == 'Offense Mode' then
if newValue == 'Normal' then
disable('main','sub','ammo')
else
enable('main','sub','ammo')
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- Called by the 'update' self-command.
function job_update(cmdParams, eventArgs)
pick_tp_weapon()
end
-- Modify the default idle set after it was constructed.
function customize_idle_set(idleSet)
if player.mpp < 51 then
idleSet = set_combine(idleSet, sets.latent_refresh)
end
return idleSet
end
-- Function to display the current relevant user state when doing an update.
function display_current_job_state(eventArgs)
display_current_caster_state()
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
-- Determine the custom class to use for the given song.
function get_song_class(spell)
-- Can't use spell.targets:contains() because this is being pulled from resources
if set.contains(spell.targets, 'Enemy') then
if state.CastingMode.value == 'Resistant' then
return 'ResistantSongDebuff'
else
return 'SongDebuff'
end
elseif state.ExtraSongsMode.value == 'Dummy' then
return 'DaurdablaDummy'
else
return 'SongEffect'
end
end
-- Function to create custom buff-remaining timers with the Timers plugin,
-- keeping only the actual valid songs rather than spamming the default
-- buff remaining timers.
function adjust_timers(spell, spellMap)
if state.UseCustomTimers.value == false then
return
end
local current_time = os.time()
-- custom_timers contains a table of song names, with the os time when they
-- will expire.
-- Eliminate songs that have already expired from our local list.
local temp_timer_list = {}
for song_name,expires in pairs(custom_timers) do
if expires < current_time then
temp_timer_list[song_name] = true
end
end
for song_name,expires in pairs(temp_timer_list) do
custom_timers[song_name] = nil
end
local dur = calculate_duration(spell.name, spellMap)
if custom_timers[spell.name] then
-- Songs always overwrite themselves now, unless the new song has
-- less duration than the old one (ie: old one was NT version, new
-- one has less duration than what's remaining).
-- If new song will outlast the one in our list, replace it.
if custom_timers[spell.name] < (current_time + dur) then
send_command('timers delete "'..spell.name..'"')
custom_timers[spell.name] = current_time + dur
send_command('timers create "'..spell.name..'" '..dur..' down')
end
else
-- Figure out how many songs we can maintain.
local maxsongs = 2
if player.equipment.range == info.ExtraSongInstrument then
maxsongs = maxsongs + info.ExtraSongs
end
if buffactive['Clarion Call'] then
maxsongs = maxsongs + 1
end
-- If we have more songs active than is currently apparent, we can still overwrite
-- them while they're active, even if not using appropriate gear bonuses (ie: Daur).
if maxsongs < table.length(custom_timers) then
maxsongs = table.length(custom_timers)
end
-- Create or update new song timers.
if table.length(custom_timers) < maxsongs then
custom_timers[spell.name] = current_time + dur
send_command('timers create "'..spell.name..'" '..dur..' down')
else
local rep,repsong
for song_name,expires in pairs(custom_timers) do
if current_time + dur > expires then
if not rep or rep > expires then
rep = expires
repsong = song_name
end
end
end
if repsong then
custom_timers[repsong] = nil
send_command('timers delete "'..repsong..'"')
custom_timers[spell.name] = current_time + dur
send_command('timers create "'..spell.name..'" '..dur..' down')
end
end
end
end
-- Function to calculate the duration of a song based on the equipment used to cast it.
-- Called from adjust_timers(), which is only called on aftercast().
function calculate_duration(spellName, spellMap)
local mult = 1
if player.equipment.range == 'Daurdabla' then mult = mult + 0.25 end -- change to 0.25 with 90 Daur
if player.equipment.range == "Gjallarhorn" then mult = mult + 0.3 end -- change to 0.3 with 95 Gjall
if player.equipment.main == "Carnwenhan" then mult = mult + 0.1 end -- 0.1 for 75, 0.4 for 95, 0.5 for 99/119
if player.equipment.main == "Legato Dagger" then mult = mult + 0.05 end
if player.equipment.sub == "Legato Dagger" then mult = mult + 0.05 end
if player.equipment.neck == "Aoidos' Matinee" then mult = mult + 0.1 end
if player.equipment.body == "Fili Hongreline +1" then mult = mult + 0.1 end
if player.equipment.legs == "Mdk. Shalwar +1" then mult = mult + 0.1 end
if player.equipment.feet == "Brioso Slippers +3" then mult = mult + 0.1 end
if player.equipment.feet == "Brioso Slippers +3" then mult = mult + 0.11 end
if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet +2" then mult = mult + 0.1 end
if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet +2" then mult = mult + 0.1 end
if spellMap == 'Madrigal' and player.equipment.head == "Fili Calot +1" then mult = mult + 0.1 end
if spellMap == 'Minuet' and player.equipment.body == "Fili Hongreline +1" then mult = mult + 0.1 end
if spellMap == 'March' and player.equipment.hands == 'Fili Manchettes +1' then mult = mult + 0.1 end
if spellMap == 'Ballad' and player.equipment.legs == "Fili Rhingrave +1" then mult = mult + 0.1 end
if spellName == "Sentinel's Scherzo" and player.equipment.feet == "Fili Cothurnes +1" then mult = mult + 0.1 end
if buffactive.Troubadour then
mult = mult*2
end
if spellName == "Sentinel's Scherzo" then
if buffactive['Soul Voice'] then
mult = mult*2
elseif buffactive['Marcato'] then
mult = mult*1.5
end
end
local totalDuration = math.floor(mult*120)
return totalDuration
end
-- Examine equipment to determine what our current TP weapon is.
function pick_tp_weapon()
if brd_daggers:contains(player.equipment.main) then
state.CombatWeapon:set('Dagger')
if S{'NIN','DNC'}:contains(player.sub_job) and brd_daggers:contains(player.equipment.sub) then
state.CombatForm:set('DW')
else
state.CombatForm:reset()
end
else
state.CombatWeapon:reset()
state.CombatForm:reset()
end
end
-- Function to reset timers.
function reset_timers()
for i,v in pairs(custom_timers) do
send_command('timers delete "'..i..'"')
end
custom_timers = {}
end
windower.raw_register_event('zone change',reset_timers)
windower.raw_register_event('logout',reset_timers)
Asura.Byrne
Serveur: Asura
Game: FFXI
By Asura.Byrne 2019-03-25 12:59:53
Your sets are called sets.precast.FastCast.BardSong, and sets.precast.FastCast.Blahblahblah
The base fast cast set will work under either nomenclature, but without specific arguments in precast, you need to name the customized ones like "sets.precast. FC.BardSong" etc.
[+]
Asura.Sohoku
Serveur: Asura
Game: FFXI
Posts: 3
By Asura.Sohoku 2019-03-27 23:31:43
Hi all, I'm having a bit of trouble trying to figure out what's wrong here. I'm very new to GS and am using Selindrile's GS's. I'm also attempting to use a bunch of elseif commands I got that were posted from Ejin.
I basically am trying to tribox and just write my send@all command and have all my toons react accordingly. Could just be possible I put it in the wrong location but I was attempting it and hoping for the best.
"Brd.lua:300; unexpected symbol near 'then'. Any Ideas? Appreciate any help,Thanks.
Asura.Byrne
Serveur: Asura
Game: FFXI
By Asura.Byrne 2019-03-28 00:08:03
Well there's a couple of things I'd say here, and it may make your life alot easier.
First, that "then" isn't necessary at all if you want it to poll every time you use any self_command. Then is only necessary when it follows an if, or elseif. If you don't want it to poll every single time, you'll need to figure out some sort of appropriate if/elseif logic.
Secondly, I highly recommend changing your style configurator in Notepad++ to "Dark Ink" mode. (Settings > Style configurator) The default colors actually are a bit hard to see, it likes putting bright colors on a white background, and that's just asking to miss small mistakes.
Serveur: Shiva
Game: FFXI
Posts: 1052
By Shiva.Arislan 2019-03-29 08:44:00
I'm very new to GS and am using Selindrile's GS's. I'm also attempting to use a bunch of elseif commands I got that were posted from Ejin.
I basically am trying to tribox and just write my send@all command and have all my toons react accordingly. Could just be possible I put it in the wrong location but I was attempting it and hoping for the best.
Somebody new to the piano wouldn't expect to play La Campanella right away. Just like somebody new to lua shouldn't start by trying to merge two complex luas together to multibox.
My advice: learn the basics first.
[+]
Asura.Sohoku
Serveur: Asura
Game: FFXI
Posts: 3
By Asura.Sohoku 2019-03-31 12:28:10
Thanks for the advice Byrne. Definitely helped to change the default colors.
Well there's a couple of things I'd say here, and it may make your life alot easier.
First, that "then" isn't necessary at all if you want it to poll every time you use any self_command. Then is only necessary when it follows an if, or elseif. If you don't want it to poll every single time, you'll need to figure out some sort of appropriate if/elseif logic.
Secondly, I highly recommend changing your style configurator in Notepad++ to "Dark Ink" mode. (Settings > Style configurator) The default colors actually are a bit hard to see, it likes putting bright colors on a white background, and that's just asking to miss small mistakes.
By Silfer 2019-04-01 17:23:26
Would someone be kind enough to help fix this SMN lua for me, it does everything I want except one thing, when I use a bloodpact it switches in my -bp delay gear like it should but does not switch back to my regular gear for when avatars are out/engaged after the bp. It keeps the -bp delay gear on til whatever I'm fighting is dead.
Code
-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
-- Also, you'll need the Shortcuts addon to handle the auto-targetting of the custom pact commands.
--[[
Custom commands:
gs c petweather
Automatically casts the storm appropriate for the current avatar, if possible.
gs c siphon
Automatically run the process to: dismiss the current avatar; cast appropriate
weather; summon the appropriate spirit; Elemental Siphon; release the spirit;
and re-summon the avatar.
Will not cast weather you do not have access to.
Will not re-summon the avatar if one was not out in the first place.
Will not release the spirit if it was out before the command was issued.
gs c pact [PactType]
Attempts to use the indicated pact type for the current avatar.
PactType can be one of:
cure
curaga
buffOffense
buffDefense
buffSpecial
debuff1
debuff2
sleep
nuke2
nuke4
bp70
bp75 (merits and lvl 75-80 pacts)
astralflow
--]]
-- Initialization function for this job file.
function get_sets()
mote_include_version = 2
-- Load and initialize the include file.
include('Mote-Include.lua')
windower.send_command('sta !packets off')
end
-- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
function job_setup()
state.Buff["Avatar's Favor"] = buffactive["Avatar's Favor"] or false
state.Buff["Astral Conduit"] = buffactive["Astral Conduit"] or false
spirits = S{"LightSpirit", "DarkSpirit", "FireSpirit", "EarthSpirit", "WaterSpirit", "AirSpirit", "IceSpirit", "ThunderSpirit"}
avatars = S{"Carbuncle", "Fenrir", "Diabolos", "Ifrit", "Titan", "Leviathan", "Garuda", "Shiva", "Ramuh", "Odin", "Alexander", "Cait Sith"}
magicalRagePacts = S{
'Inferno','Earthen Fury','Tidal Wave','Aerial Blast','Diamond Dust','Judgment Bolt','Searing Light','Howling Moon','Ruinous Omen',
'Fire II','Stone II','Water II','Aero II','Blizzard II','Thunder II',
'Fire IV','Stone IV','Water IV','Aero IV','Blizzard IV','Thunder IV',
'Thunderspark','Burning Strike','Meteorite','Nether Blast','Flaming Crush',
'Meteor Strike','Heavenly Strike','Wind Blade','Geocrush','Grand Fall','Thunderstorm',
'Holy Mist','Lunar Bay','Night Terror','Level ? Holy'}
pacts = {}
pacts.cure = {['Carbuncle']='Healing Ruby'}
pacts.curaga = {['Carbuncle']='Healing Ruby II', ['Garuda']='Whispering Wind', ['Leviathan']='Spring Water'}
pacts.buffoffense = {['Carbuncle']='Glittering Ruby', ['Ifrit']='Crimson Howl', ['Garuda']='Hastega', ['Ramuh']='Rolling Thunder',
['Fenrir']='Ecliptic Growl'}
pacts.buffdefense = {['Carbuncle']='Shining Ruby', ['Shiva']='Frost Armor', ['Garuda']='Aerial Armor', ['Titan']='Earthen Ward',
['Ramuh']='Lightning Armor', ['Fenrir']='Ecliptic Howl', ['Diabolos']='Noctoshield', ['Cait Sith']='Reraise II'}
pacts.buffspecial = {['Ifrit']='Inferno Howl', ['Garuda']='Fleet Wind', ['Titan']='Earthen Armor', ['Diabolos']='Dream Shroud',
['Carbuncle']='Soothing Ruby', ['Fenrir']='Heavenward Howl', ['Cait Sith']='Raise II'}
pacts.debuff1 = {['Shiva']='Diamond Storm', ['Ramuh']='Shock Squall', ['Leviathan']='Tidal Roar', ['Fenrir']='Lunar Cry',
['Diabolos']='Pavor Nocturnus', ['Cait Sith']='Eerie Eye'}
pacts.debuff2 = {['Shiva']='Sleepga', ['Leviathan']='Slowga', ['Fenrir']='Lunar Roar', ['Diabolos']='Somnolence'}
pacts.sleep = {['Shiva']='Sleepga', ['Diabolos']='Nightmare', ['Cait Sith']='Mewing Lullaby'}
pacts.nuke2 = {['Ifrit']='Fire II', ['Shiva']='Blizzard II', ['Garuda']='Aero II', ['Titan']='Stone II',
['Ramuh']='Thunder II', ['Leviathan']='Water II'}
pacts.nuke4 = {['Ifrit']='Fire IV', ['Shiva']='Blizzard IV', ['Garuda']='Aero IV', ['Titan']='Stone IV',
['Ramuh']='Thunder IV', ['Leviathan']='Water IV'}
pacts.bp70 = {['Ifrit']='Flaming Crush', ['Shiva']='Rush', ['Garuda']='Predator Claws', ['Titan']='Mountain Buster',
['Ramuh']='Chaotic Strike', ['Leviathan']='Spinning Dive', ['Carbuncle']='Meteorite', ['Fenrir']='Eclipse Bite',
['Diabolos']='Nether Blast',['Cait Sith']='Regal Scratch'}
pacts.bp75 = {['Ifrit']='Meteor Strike', ['Shiva']='Heavenly Strike', ['Garuda']='Wind Blade', ['Titan']='Geocrush',
['Ramuh']='Thunderstorm', ['Leviathan']='Grand Fall', ['Carbuncle']='Holy Mist', ['Fenrir']='Lunar Bay',
['Diabolos']='Night Terror', ['Cait Sith']='Level ? Holy'}
pacts.astralflow = {['Ifrit']='Inferno', ['Shiva']='Diamond Dust', ['Garuda']='Aerial Blast', ['Titan']='Earthen Fury',
['Ramuh']='Judgment Bolt', ['Leviathan']='Tidal Wave', ['Carbuncle']='Searing Light', ['Fenrir']='Howling Moon',
['Diabolos']='Ruinous Omen', ['Cait Sith']="Altana's Favor"}
-- Wards table for creating custom timers
wards = {}
-- Base duration for ward pacts.
wards.durations = {
['Crimson Howl'] = 60, ['Earthen Armor'] = 60, ['Inferno Howl'] = 60, ['Heavenward Howl'] = 60,
['Rolling Thunder'] = 120, ['Fleet Wind'] = 120,
['Shining Ruby'] = 180, ['Frost Armor'] = 180, ['Lightning Armor'] = 180, ['Ecliptic Growl'] = 180,
['Glittering Ruby'] = 180, ['Hastega'] = 180, ['Noctoshield'] = 180, ['Ecliptic Howl'] = 180,
['Dream Shroud'] = 180,
['Reraise II'] = 3600
}
-- Icons to use when creating the custom timer.
wards.icons = {
['Earthen Armor'] = 'spells/00299.png', -- 00299 for Titan
['Shining Ruby'] = 'spells/00043.png', -- 00043 for Protect
['Dream Shroud'] = 'spells/00304.png', -- 00304 for Diabolos
['Noctoshield'] = 'spells/00106.png', -- 00106 for Phalanx
['Inferno Howl'] = 'spells/00298.png', -- 00298 for Ifrit
['Hastega'] = 'spells/00358.png', -- 00358 for Hastega
['Rolling Thunder'] = 'spells/00104.png', -- 00358 for Enthunder
['Frost Armor'] = 'spells/00250.png', -- 00250 for Ice Spikes
['Lightning Armor'] = 'spells/00251.png', -- 00251 for Shock Spikes
['Reraise II'] = 'spells/00135.png', -- 00135 for Reraise
['Fleet Wind'] = 'abilities/00074.png', --
}
-- Flags for code to get around the issue of slow skill updates.
wards.flag = false
wards.spell = ''
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')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'PDT')
gear.perp_staff = {name=""}
select_default_macro_book()
end
function user_unload()
windower.send_command('sta !packets on')
end
-- Define sets and vars used by this job file.
function init_gear_sets()
--------------------------------------
-- Precast Sets
--------------------------------------
-- Precast sets to enhance JAs
sets.precast.JA['Astral Flow'] = {head="Glyphic Horn"}
sets.precast.JA['Elemental Siphon'] = {main="Soulscourge",
head="Convoker's Horn",neck="Caller's Pendant",
body="Caller's Doublet +2",hands="Glyphic Bracers",ring1="Evoker's Ring",ring2="Fervor Ring",
legs="Marduk's Shalwar +1",feet="Caller's Pigaches +2"}
sets.precast.JA['Mana Cede'] = {hands="Caller's Bracers +2"}
-- Pact delay reduction gear
sets.precast.BloodPactWard = {main="Iridal Staff",
sub="Bugard Strap +1",
ammo="Hedgehog Bomb",
head="Summoner's Horn",
body="Yinyang robe",
hands="Summoner's Brcr.",
legs="Summoner's Spats",
feet="Mgn. M Ledelsens",
neck="Beak Necklace +1",
waist="Forest Rope",
left_ear="Moldavite Earring",
right_ear="Phantom Earring",
left_ring="Evoker's Ring",
right_ring="Serket Ring",
back="Summoner's Cape",}
sets.precast.BloodPactRage = sets.precast.BloodPactWard
-- Fast cast sets for spells
sets.precast.FC = {
head="Nahtirah Hat",ear2="Loquacious Earring",
body="Vanir Cotehardie",ring1="Prolix Ring",
back="Swith Cape +1",waist="Witful Belt",legs="Orvail Pants +1",feet="Chelona Boots +1"}
sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {
head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Pahtli Cape",waist="Cascade Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS['Myrkr'] = {
head="Nahtirah Hat",ear1="Gifted Earring",ear2="Loquacious Earring",
body="Convoker's Doublet",hands="Caller's Bracers +2",ring1="Evoker's Ring",ring2="Sangoma Ring",
back="Pahtli Cape",waist="Fucho-no-Obi",legs="Nares Trews",feet="Chelona Boots +1"}
--------------------------------------
-- Midcast sets
--------------------------------------
sets.midcast.FastRecast = {
head="Nahtirah Hat",ear2="Loquacious Earring",
body="Vanir Cotehardie",hands="Bokwus Gloves",ring1="Prolix Ring",
back="Swith Cape +1",waist="Witful Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}
sets.midcast.Cure = {main="Tamaxchi",
head="Nahtirah Hat",ear2="Loquacious Earring",
body="Heka's Kalasiris",hands="Bokwus Gloves",ring1="Prolix Ring",ring2="Sirona's Ring",
back="Swith Cape +1",waist="Witful Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}
sets.midcast.Stoneskin = {waist="Siegel Sash"}
sets.midcast['Elemental Magic'] = {main="Lehbrailg +2",sub="Wizzan Grip",
head="Hagondes Hat",neck="Stoicheion Medal",ear1="Friomisi Earring",ear2="Hecate's Earring",
body="Hagondes Coat",hands="Yaoyotl Gloves",ring1="Icesoul Ring",ring2="Acumen Ring",
back="Toro Cape",waist=gear.ElementalBelt,legs="Hagondes Pants",feet="Hagondes Sabots"}
sets.midcast['Dark Magic'] = {main="Lehbrailg +2",sub="Wizzan Grip",
head="Nahtirah Hat",neck="Aesir Torque",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Vanir Cotehardie",hands="Yaoyotl Gloves",ring1="Excelsis Ring",ring2="Sangoma Ring",
waist="Fuchi-no-Obi",legs="Bokwus Slops",feet="Bokwus Boots"}
-- Avatar pact sets. All pacts are Ability type.
sets.midcast.Pet.BloodPactWard = {main="Iridal Staff",
sub="Bugard Strap +1",
ammo="Hedgehog Bomb",
head="Summoner's Horn",
body="Yinyang robe",
hands="Summoner's Brcr.",
legs="Summoner's Spats",
feet="Mgn. M Ledelsens",
neck="Beak Necklace +1",
waist="Forest Rope",
left_ear="Moldavite Earring",
right_ear="Phantom Earring",
left_ring="Evoker's Ring",
right_ring="Serket Ring",
back="Summoner's Cape",}
sets.midcast.Pet.DebuffBloodPactWard = {main="Iridal Staff",
sub="Bugard Strap +1",
ammo="Hedgehog Bomb",
head="Summoner's Horn",
body="Yinyang robe",
hands="Summoner's Brcr.",
legs="Summoner's Spats",
feet="Mgn. M Ledelsens",
neck="Beak Necklace +1",
waist="Forest Rope",
left_ear="Moldavite Earring",
right_ear="Phantom Earring",
left_ring="Evoker's Ring",
right_ring="Serket Ring",
back="Summoner's Cape",}
sets.midcast.Pet.DebuffBloodPactWard.Acc = sets.midcast.Pet.DebuffBloodPactWard
sets.midcast.Pet.PhysicalBloodPactRage = {main="Iridal Staff",
sub="Bugard Strap +1",
ammo="Hedgehog Bomb",
head="Summoner's Horn",
body="Yinyang robe",
hands="Summoner's Brcr.",
legs="Summoner's Spats",
feet="Mgn. M Ledelsens",
neck="Beak Necklace +1",
waist="Forest Rope",
left_ear="Moldavite Earring",
right_ear="Phantom Earring",
left_ring="Evoker's Ring",
right_ring="Serket Ring",
back="Summoner's Cape",}
sets.midcast.Pet.PhysicalBloodPactRage.Acc = sets.midcast.Pet.PhysicalBloodPactRage
sets.midcast.Pet.MagicalBloodPactRage = {main="Iridal Staff",
sub="Bugard Strap +1",
ammo="Hedgehog Bomb",
head="Summoner's Horn",
body="Yinyang robe",
hands="Summoner's Brcr.",
legs="Summoner's Spats",
feet="Mgn. M Ledelsens",
neck="Beak Necklace +1",
waist="Forest Rope",
left_ear="Moldavite Earring",
right_ear="Phantom Earring",
left_ring="Evoker's Ring",
right_ring="Serket Ring",
back="Summoner's Cape",}
sets.midcast.Pet.MagicalBloodPactRage.Acc = sets.midcast.Pet.MagicalBloodPactRage
-- Spirits cast magic spells, which can be identified in standard ways.
sets.midcast.Pet.WhiteMagic = {legs="Summoner's Spats"}
sets.midcast.Pet['Elemental Magic'] = set_combine(sets.midcast.Pet.BloodPactRage, {legs="Summoner's Spats"})
sets.midcast.Pet['Elemental Magic'].Resistant = {}
--------------------------------------
-- Idle/resting/defense/etc sets
--------------------------------------
-- Resting sets
sets.resting = {main="Iridal Staff",
sub="Bugard Strap +1",
ammo="Hedgehog Bomb",
head="Evoker's Horn",
body="Yinyang robe",
hands="Summoner's Bracers",
legs="Summoner's Spats",
feet="Mgn. M Ledelsens",
neck="Beak Necklace +1",
waist="Forest Rope",
left_ear="Moldavite Earring",
right_ear="Phantom Earring",
left_ring="Evoker's Ring",
right_ring="Serket Ring",
back="Summoner's Cape",}
-- Idle sets
sets.idle = {main="Iridal Staff",
sub="Bugard Strap +1",
ammo="Hedgehog Bomb",
head="Evoker's Horn",
body="Yinyang robe",
hands="Summoner's Bracers",
legs="Summoner's Spats",
feet="Mgn. M Ledelsens",
neck="Beak Necklace +1",
waist="Forest Rope",
left_ear="Moldavite Earring",
right_ear="Phantom Earring",
left_ring="Evoker's Ring",
right_ring="Serket Ring",
back="Summoner's Cape",}
sets.idle.PDT = {}
-- perp costs:
-- spirits: 7
-- carby: 11 (5 with mitts)
-- fenrir: 13
-- others: 15
-- avatar's favor: -4/tick
-- Max useful -perp gear is 1 less than the perp cost (can't be reduced below 1)
-- Aim for -14 perp, and refresh in other slots.
-- -perp gear:
-- Gridarvor: -5
-- Glyphic Horn: -4
-- Caller's Doublet +2/Glyphic Doublet: -4
-- Evoker's Ring: -1
-- Convoker's Pigaches: -4
-- total: -18
-- Can make due without either the head or the body, and use +refresh items in those slots.
sets.idle.Avatar = {main="Iridal Staff",
sub="Bugard Strap +1",
ammo="Hedgehog Bomb",
head="Evoker's Horn",
body="Yinyang robe",
hands="Summoner's Bracers",
legs="Summoner's Spats",
feet="Mgn. M Ledelsens",
neck="Beak Necklace +1",
waist="Forest Rope",
left_ear="Moldavite Earring",
right_ear="Phantom Earring",
left_ring="Evoker's Ring",
right_ring="Serket Ring",
back="Summoner's Cape",}
sets.idle.PDT.Avatar = {main="Iridal Staff",
sub="Bugard Strap +1",
ammo="Hedgehog Bomb",
head="Evoker's Horn",
body="Yinyang robe",
hands="Summoner's Bracers",
legs="Summoner's Spats",
feet="Mgn. M Ledelsens",
neck="Beak Necklace +1",
waist="Forest Rope",
left_ear="Moldavite Earring",
right_ear="Phantom Earring",
left_ring="Evoker's Ring",
right_ring="Serket Ring",
back="Summoner's Cape",}
sets.idle.Spirit = {main="Iridal Staff",
sub="Bugard Strap +1",
ammo="Hedgehog Bomb",
head="Evoker's Horn",
body="Yinyang robe",
hands="Summoner's Bracers",
legs="Summoner's Spats",
feet="Mgn. M Ledelsens",
neck="Beak Necklace +1",
waist="Forest Rope",
left_ear="Moldavite Earring",
right_ear="Phantom Earring",
left_ring="Evoker's Ring",
right_ring="Serket Ring",
back="Summoner's Cape",}
sets.idle.Town = {main="Iridal Staff",
sub="Bugard Strap +1",
ammo="Hedgehog Bomb",
head="Evoker's Horn",
body="Yinyang robe",
hands="Summoner's Bracers",
legs="Summoner's Spats",
feet="Mgn. M Ledelsens",
neck="Beak Necklace +1",
waist="Forest Rope",
left_ear="Moldavite Earring",
right_ear="Phantom Earring",
left_ring="Evoker's Ring",
right_ring="Serket Ring",
back="Summoner's Cape",}
-- Favor uses Caller's Horn instead of Convoker's Horn for refresh
sets.idle.Avatar.Favor = {head="Caller's Horn +2"}
sets.idle.Avatar.Melee = {hands="Regimen Mittens",back="Samanisi Cape",waist="Kuku Stone",legs="Convoker's Spats"}
sets.perp = {}
-- Caller's Bracer's halve the perp cost after other costs are accounted for.
-- Using -10 (Gridavor, ring, Conv.feet), standard avatars would then cost 5, halved to 2.
-- We can then use Hagondes Coat and end up with the same net MP cost, but significantly better defense.
-- Weather is the same, but we can also use the latent on the pendant to negate the last point lost.
sets.perp.Day = {body="Summoner's Doublet"}
sets.perp.Weather = {head="Summoner's Horn"}
-- Carby: Mitts+Conv.feet = 1/tick perp. Everything else should be +refresh
sets.perp.Carbuncle = {hands="Carbuncle Mitts"}
-- Diabolos's Rope doesn't gain us anything at this time
--sets.perp.Diabolos = {waist="Diabolos's Rope"}
sets.perp.Alexander = sets.midcast.Pet.BloodPactWard
sets.perp.staff_and_grip = {main=gear.perp_staff,sub="Achaq Grip"}
-- Defense sets
sets.defense.PDT = {}
sets.defense.MDT = {}
sets.Kiting = {feet="Herald's Gaiters"}
sets.latent_refresh = {}
--------------------------------------
-- Engaged sets
--------------------------------------
-- Normal melee group
sets.engaged = {main="Iridal Staff",
sub="Bugard Strap +1",
ammo="Hedgehog Bomb",
head="Evoker's Horn",
body="Yinyang robe",
hands="Summoner's Bracers",
legs="Summoner's Spats",
feet="Mgn. M Ledelsens",
neck="Beak Necklace +1",
waist="Forest Rope",
left_ear="Moldavite Earring",
right_ear="Phantom Earring",
left_ring="Evoker's Ring",
right_ring="Serket Ring",
back="Summoner's Cape",}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
-- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
function job_precast(spell, action, spellMap, eventArgs)
if state.Buff['Astral Conduit'] and pet_midaction() then
eventArgs.handled = true
end
end
function job_midcast(spell, action, spellMap, eventArgs)
if state.Buff['Astral Conduit'] and pet_midaction() then
eventArgs.handled = true
end
end
-- Runs when pet completes an action.
function job_pet_aftercast(spell, action, spellMap, eventArgs)
if not spell.interrupted and spell.type == 'BloodPactWard' and spellMap ~= 'DebuffBloodPactWard' then
wards.flag = true
wards.spell = spell.english
send_command('wait 4; gs c reset_ward_flag')
end
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
-- Called when a player gains or loses a buff.
-- buff == buff gained or lost
-- gain == true if the buff was gained, false if it was lost.
function job_buff_change(buff, gain)
if state.Buff[buff] ~= nil then
handle_equipping_gear(player.status)
elseif storms:contains(buff) then
handle_equipping_gear(player.status)
end
end
-- Called when the player's pet's status changes.
-- This is also called after pet_change after a pet is released. Check for pet validity.
function job_pet_status_change(newStatus, oldStatus, eventArgs)
if pet.isvalid and not midaction() and not pet_midaction() and (newStatus == 'Engaged' or oldStatus == 'Engaged') then
handle_equipping_gear(player.status, newStatus)
end
end
-- Called when a player gains or loses a pet.
-- pet == pet structure
-- gain == true if the pet was gained, false if it was lost.
function job_pet_change(petparam, gain)
classes.CustomIdleGroups:clear()
if gain then
if avatars:contains(pet.name) then
classes.CustomIdleGroups:append('Avatar')
elseif spirits:contains(pet.name) then
classes.CustomIdleGroups:append('Spirit')
end
else
select_default_macro_book('reset')
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- Custom spell mapping.
function job_get_spell_map(spell)
if spell.type == 'BloodPactRage' then
if magicalRagePacts:contains(spell.english) then
return 'MagicalBloodPactRage'
else
return 'PhysicalBloodPactRage'
end
elseif spell.type == 'BloodPactWard' and spell.target.type == 'MONSTER' then
return 'DebuffBloodPactWard'
end
end
-- Modify the default idle set after it was constructed.
function customize_idle_set(idleSet)
if pet.isvalid then
if pet.element == world.day_element then
idleSet = set_combine(idleSet, sets.perp.Day)
end
if pet.element == world.weather_element then
idleSet = set_combine(idleSet, sets.perp.Weather)
end
if sets.perp[pet.name] then
idleSet = set_combine(idleSet, sets.perp[pet.name])
end
gear.perp_staff.name = elements.perpetuance_staff_of[pet.element]
if gear.perp_staff.name and (player.inventory[gear.perp_staff.name] or player.wardrobe[gear.perp_staff.name]) then
idleSet = set_combine(idleSet, sets.perp.staff_and_grip)
end
if state.Buff["Avatar's Favor"] and avatars:contains(pet.name) then
idleSet = set_combine(idleSet, sets.idle.Avatar.Favor)
end
if pet.status == 'Engaged' then
idleSet = set_combine(idleSet, sets.idle.Avatar.Melee)
end
end
if player.mpp < 51 then
idleSet = set_combine(idleSet, sets.latent_refresh)
end
return idleSet
end
-- Called by the 'update' self-command, for common needs.
-- Set eventArgs.handled to true if we don't want automatic equipping of gear.
function job_update(cmdParams, eventArgs)
classes.CustomIdleGroups:clear()
if pet.isvalid then
if avatars:contains(pet.name) then
classes.CustomIdleGroups:append('Avatar')
elseif spirits:contains(pet.name) then
classes.CustomIdleGroups:append('Spirit')
end
end
end
-- Set eventArgs.handled to true if we don't want the automatic display to be run.
function display_current_job_state(eventArgs)
end
-------------------------------------------------------------------------------------------------------------------
-- User self-commands.
-------------------------------------------------------------------------------------------------------------------
-- Called for custom player commands.
function job_self_command(cmdParams, eventArgs)
if cmdParams[1]:lower() == 'petweather' then
handle_petweather()
eventArgs.handled = true
elseif cmdParams[1]:lower() == 'siphon' then
handle_siphoning()
eventArgs.handled = true
elseif cmdParams[1]:lower() == 'pact' then
handle_pacts(cmdParams)
eventArgs.handled = true
elseif cmdParams[1] == 'reset_ward_flag' then
wards.flag = false
wards.spell = ''
eventArgs.handled = true
end
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
-- Cast the appopriate storm for the currently summoned avatar, if possible.
function handle_petweather()
if player.sub_job ~= 'SCH' then
add_to_chat(122, "You can not cast storm spells")
return
end
if not pet.isvalid then
add_to_chat(122, "You do not have an active avatar.")
return
end
local element = pet.element
if element == 'Thunder' then
element = 'Lightning'
end
if S{'Light','Dark','Lightning'}:contains(element) then
add_to_chat(122, 'You do not have access to '..elements.storm_of[element]..'.')
return
end
local storm = elements.storm_of[element]
if storm then
send_command('@input /ma "'..elements.storm_of[element]..'" <me>')
else
add_to_chat(123, 'Error: Unknown element ('..tostring(element)..')')
end
end
-- Custom uber-handling of Elemental Siphon
function handle_siphoning()
if areas.Cities:contains(world.area) then
add_to_chat(122, 'Cannot use Elemental Siphon in a city area.')
return
end
local siphonElement
local stormElementToUse
local releasedAvatar
local dontRelease
-- If we already have a spirit out, just use that.
if pet.isvalid and spirits:contains(pet.name) then
siphonElement = pet.element
dontRelease = true
-- If current weather doesn't match the spirit, but the spirit matches the day, try to cast the storm.
if player.sub_job == 'SCH' and pet.element == world.day_element and pet.element ~= world.weather_element then
if not S{'Light','Dark','Lightning'}:contains(pet.element) then
stormElementToUse = pet.element
end
end
-- If we're subbing /sch, there are some conditions where we want to make sure specific weather is up.
-- If current (single) weather is opposed by the current day, we want to change the weather to match
-- the current day, if possible.
elseif player.sub_job == 'SCH' and world.weather_element ~= 'None' then
-- We can override single-intensity weather; leave double weather alone, since even if
-- it's partially countered by the day, it's not worth changing.
if get_weather_intensity() == 1 then
-- If current weather is weak to the current day, it cancels the benefits for
-- siphon. Change it to the day's weather if possible (+0 to +20%), or any non-weak
-- weather if not.
-- If the current weather matches the current avatar's element (being used to reduce
-- perpetuation), don't change it; just accept the penalty on Siphon.
if world.weather_element == elements.weak_to[world.day_element] and
(not pet.isvalid or world.weather_element ~= pet.element) then
-- We can't cast lightning/dark/light weather, so use a neutral element
if S{'Light','Dark','Lightning'}:contains(world.day_element) then
stormElementToUse = 'Wind'
else
stormElementToUse = world.day_element
end
end
end
end
-- If we decided to use a storm, set that as the spirit element to cast.
if stormElementToUse then
siphonElement = stormElementToUse
elseif world.weather_element ~= 'None' and (get_weather_intensity() == 2 or world.weather_element ~= elements.weak_to[world.day_element]) then
siphonElement = world.weather_element
else
siphonElement = world.day_element
end
local command = ''
local releaseWait = 0
if pet.isvalid and avatars:contains(pet.name) then
command = command..'input /pet "Release" <me>;wait 1.1;'
releasedAvatar = pet.name
releaseWait = 10
end
if stormElementToUse then
command = command..'input /ma "'..elements.storm_of[stormElementToUse]..'" <me>;wait 4;'
releaseWait = releaseWait - 4
end
if not (pet.isvalid and spirits:contains(pet.name)) then
command = command..'input /ma "'..elements.spirit_of[siphonElement]..'" <me>;wait 4;'
releaseWait = releaseWait - 4
end
command = command..'input /ja "Elemental Siphon" <me>;'
releaseWait = releaseWait - 1
releaseWait = releaseWait + 0.1
if not dontRelease then
if releaseWait > 0 then
command = command..'wait '..tostring(releaseWait)..';'
else
command = command..'wait 1.1;'
end
command = command..'input /pet "Release" <me>;'
end
if releasedAvatar then
command = command..'wait 1.1;input /ma "'..releasedAvatar..'" <me>'
end
send_command(command)
end
-- Handles executing blood pacts in a generic, avatar-agnostic way.
-- cmdParams is the split of the self-command.
-- gs c [pact] [pacttype]
function handle_pacts(cmdParams)
if areas.Cities:contains(world.area) then
add_to_chat(122, 'You cannot use pacts in town.')
return
end
if not pet.isvalid then
add_to_chat(122,'No avatar currently available. Returning to default macro set.')
select_default_macro_book('reset')
return
end
if spirits:contains(pet.name) then
add_to_chat(122,'Cannot use pacts with spirits.')
return
end
if not cmdParams[2] then
add_to_chat(123,'No pact type given.')
return
end
local pact = cmdParams[2]:lower()
if not pacts[pact] then
add_to_chat(123,'Unknown pact type: '..tostring(pact))
return
end
if pacts[pact][pet.name] then
if pact == 'astralflow' and not buffactive['astral flow'] then
add_to_chat(122,'Cannot use Astral Flow pacts at this time.')
return
end
-- Leave out target; let Shortcuts auto-determine it.
send_command('@input /pet "'..pacts[pact][pet.name]..'"')
else
add_to_chat(122,pet.name..' does not have a pact of type ['..pact..'].')
end
end
-- Event handler for updates to player skill, since we can't rely on skill being
-- correct at pet_aftercast for the creation of custom timers.
windower.raw_register_event('incoming chunk',
function (id)
if id == 0x62 then
if wards.flag then
create_pact_timer(wards.spell)
wards.flag = false
wards.spell = ''
end
end
end)
-- Function to create custom timers using the Timers addon. Calculates ward duration
-- based on player skill and base pact duration (defined in job_setup).
function create_pact_timer(spell_name)
-- Create custom timers for ward pacts.
if wards.durations[spell_name] then
local ward_duration = wards.durations[spell_name]
if ward_duration < 181 then
local skill = player.skills.summoning_magic
if skill > 300 then
skill = skill - 300
if skill > 200 then skill = 200 end
ward_duration = ward_duration + skill
end
end
local timer_cmd = 'timers c "'..spell_name..'" '..tostring(ward_duration)..' down'
if wards.icons[spell_name] then
timer_cmd = timer_cmd..' '..wards.icons[spell_name]
end
send_command(timer_cmd)
end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book(reset)
if reset == 'reset' then
-- lost pet, or tried to use pact when pet is gone
end
-- Default macro set/book
set_macro_page(3, 12)
end
Ragnarok.Goldnboy
Serveur: Ragnarok
Game: FFXI
Posts: 23
By Ragnarok.Goldnboy 2019-04-01 18:57:13
Im not too versed with mage jobs with gs.... im not seeing an aftercast command when you use a bloodpactrage or bloodpactward. whether its idle set or engaged set??? unless i missed it but that would be where i would look as starters
Quetzalcoatl.Silfer
Serveur: Quetzalcoatl
Game: FFXI
Posts: 1
By Quetzalcoatl.Silfer 2019-04-01 19:59:18
Ragnarok.Goldnboy said: »Im not too versed with mage jobs with gs.... im not seeing an aftercast command when you use a bloodpactrage or bloodpactward. whether its idle set or engaged set??? unless i missed it but that would be where i would look as starters line 506 is aftercast?
By Kwech 2019-04-04 16:48:25
My THF lua is having some problems, if I turn on cp-mode and showswaps, while idle I'm constantly swapping between Toutatis Cape and Mec. Cape.
Also occasionally it's not swapping back to tp mode after tagging a mob with TH or using a ws.
Bismarck.Xurion
Serveur: Bismarck
Game: FFXI
Posts: 694
By Bismarck.Xurion 2019-04-05 02:15:03
Have you used debugmode?
By Kwech 2019-04-05 07:00:30
Wasn’t aware there was one, is it like a debugger you’d use when writing code?
Hades.Dade
Serveur: Hades
Game: FFXI
Posts: 230
By Hades.Dade 2019-04-11 17:29:08
I'm working on automating weaponswaps with rostam path C. I'm running into a problem when my path C is my offhand. Is there a way to force an equip change before precast?
Bismarck.Xurion
Serveur: Bismarck
Game: FFXI
Posts: 694
By Bismarck.Xurion 2019-04-12 04:21:29
Wasn’t aware there was one, is it like a debugger you’d use when writing code? You can set Gearswap into debug mode and it will print a bunch of helpful info into your chatlog.
//gs debugmode
Use it again to disable it.
Bismarck.Xurion
Serveur: Bismarck
Game: FFXI
Posts: 694
By Bismarck.Xurion 2019-04-12 04:28:00
I'm working on automating weaponswaps with rostam path C. I'm running into a problem when my path C is my offhand. Is there a way to force an equip change before precast? Are you saying that your path C Rostam is in sub slot, and you want to allow it to swap to your main slot?
You should be able to achieve that in the precast function by simply unequipping it from the sub slot. The trick would be to know when to do it, as doing that every time precast was executed would cause you to continuously lose TP.
By Cronnus 2019-04-14 10:44:34
Does Windower have a option for auto job abilities during auto range attack like Ashita does? Anyone know?
Sylph.Chazza
Serveur: Sylph
Game: FFXI
Posts: 1
By Sylph.Chazza 2019-04-15 22:07:42
Hi, wonder if anyone could help me. I have written my own .lua and when I load it into ffxi I get the following windower console error message "C;FFXI/addons/GearSwap/data/Exalasrdm.lua:2: attempt to index field 'precast' (a nil value)". I am assuming this is to do with my precast function but honestly I haven't a scooby. Could anybody kindly shine a light on what might be doing it? tia.
Edit: full fault in game:
+GearSwap: lua runtime error: Gearswap/flow.lua:346:
+gearswap has detected an error in the user function get_sets:
+ExalasRDM.lua:2:attempt to index field "precast" (a nil value)
get_sets and Precast section of my lua: function get_sets()
sets.precast.JA = {}
sets.precast.JA['Chainspell'] = {body="Vitivation Tabard"}
sets.precast.FC = {ammo="",
head="Atrophy Chapeau +1",ear2="Loquacious Earring",
body="Duelist's Tabard",hands="Gendewitha Gages",ring1="Prolix Ring",
back="Swith Cape +1",waist="Witful Belt",legs="Ayanmo Cosciales",feet="Chelona Boots +1"}
sets.precast.WS = {}
sets.precast.WS = {
head="Ayanmo Zucchetto",neck="Chivalrous Chain",ear1="Moonshade Earring",ear2="Mache Earring",
body="Ayanmo Corazza +1",hands="Atrophy Gloves +1",ring1="Rajas Ring",ring2="Excelsis Ring",
back="Amemat Mantle +1",waist="Potent Belt",legs="Taeon Tights",feet="Jhakri Pigaches"}
sets.midcast.Cure = {
head="Helios Band",neck="Inquisitor's Chain",
body="Kaykaus Bliaut",hands="Gendewitha Gages",ring1="Ephedra Ring",ring2="Ephedra Ring",
legs="Atrophy Tights +1",waist="Salire Belt",legs="Atrophy Tights",feet="Jhakri Pigaches"}
sets.midcast['Enhancing Magic'] = {
head="Atrophy Chapeau +1",
body="Telchine Chasuble",hands="Atrophy Gloves +1",
waist="Cascade Belt",legs="Atrophy Tights +1"}
sets.midcast['Enfeebling Magic'] = {ammo="Phantom Tathlum",
head="Atrophy Chapeau +1",neck="Stoicheion Medal",ear1="Friomisi Earring",
body="Atrophy Tabard +1",hands="Gendewitha Gages",ring1="Quies Ring",ring2="Snow Ring",
back="Hecate's Cape",waist="Salire Belt",legs="Ayanmo Cosciales",feet="Jhakri Pigaches"}
sets.midcast['Addle'] = set_combine(sets.midcast['Enfeebling Magic'], {back="Romanus Cape"})
sets.midcast['Elemental Magic'] = {ammo="Phantom Tathlum",
head="Atrophy Chapeau +1",neck="Stoicheion Medal",ear1="Friomisi Earring",
body="Kaykaus Bliaut",hands="Helios Gloves",ring1="Snow Ring",ring2="Acumen Ring",
back="Hecate's Cape",waist="Salire Belt",legs="Telchine Braconi",feet="Jhakri Pigaches"}
sets.aftercast = {}
sets.aftercast.idle = {main="",sub="",ammo="",
head="Duelist's Chapeau",neck="",ear1="",ear2="",
body="Atrophy Tabard +1",hands="Ayanmo Gages",ring1="",ring2="",
back="",waist,legs="Ayanmo Cosciales",feet="Atrophy Boots +1"}
sets.aftercast.engaged = {
head="Taeon Chapeau",neck="Chivalrous Chain",ear1="Mache Earring",ear2="Suppanomimi",
body="Ayanmo Corazza +1",hands="Ayanmo Manopolas",ring1="Rajas Ring",ring2="Mouflon Ring",
back="Vellaunus' Mantle +1",waist="Kentarch Belt",legs="Taeon Tights",feet="Ayanmo Gambieras"}
sets.idle.town = {}
sets.idle.town = {body='Republic Aketon',legs="Crimson Cuisses"}
end
-----------------------------------------------------------------------------------
function precast(spell,position)
--This function performs right before the action is sent to the server.
if spell.skill=='ElementalMagic' and spell.cast_time < 2 then
equip(sets.midcast['Elemental Magic'])
elseif spell.skill=='EnfeeblingMagic' and spell.cast_time < 2 then
equip(sets.midcast['Enfeebling Magic'])
elseif spell.skill=='HealingMagic' and spell.cast_time < 2 then
equip(sets.midcast.Cure)
elseif spell.skill=='EnhancingMagic' and spell.cast_time < 2 then
equip(sets.midcast['Enhancing Magic'])
elseif spell.type:contains('Magic') then
equip(sets.precast.FC)
elseif spell.type=='Abilities' then
if sets.JA[spell.english] then equip(sets.precast.JA)
end
elseif spell.type=='WeaponSkill' then
if sets.WS[spell.english] then equip(sets.precast.WS)
end
end
end
Bismarck.Xurion
Serveur: Bismarck
Game: FFXI
Posts: 694
By Bismarck.Xurion 2019-04-16 08:08:51
My guess (I'm at work) is that because you've created your own from scratch, you don't get to benefit from various default values that something like motes would provide.
Your code is complaining because precast cannot be set against sets, because sets is nil. I'm unsure if Gearswap defines and exposes this by default, but my first advice would be to try adding sets = {} on line 1 of the get_sets() function.
Asura.Exalas
Serveur: Asura
Game: FFXI
Posts: 2
By Asura.Exalas 2019-04-16 10:28:06
My guess (I'm at work) is that because you've created your own from scratch, you don't get to benefit from various default values that something like motes would provide.
Your code is complaining because precast cannot be set against sets, because sets is nil. I'm unsure if Gearswap defines and exposes this by default, but my first advice would be to try adding sets = {} on line 1 of the get_sets() function.
you sweet beautiful human. it now loads. Unfortunately though, it's now saying that "precast" is not defined for functions, it's saying line 106 which is the last precast argument. I tried to use the rdm lua from the kinematics GitHub but it wasn't equipping any of my aftercast sets and trying to fix it was just another level for my level of knowledge. (which is zero btw xD)
Bismarck.Xurion
Serveur: Bismarck
Game: FFXI
Posts: 694
By Bismarck.Xurion 2019-04-16 16:42:39
My guess (I'm at work) is that because you've created your own from scratch, you don't get to benefit from various default values that something like motes would provide.
Your code is complaining because precast cannot be set against sets, because sets is nil. I'm unsure if Gearswap defines and exposes this by default, but my first advice would be to try adding sets = {} on line 1 of the get_sets() function.
you sweet beautiful human. it now loads. Unfortunately though, it's now saying that "precast" is not defined for functions, it's saying line 106 which is the last precast argument. I tried to use the rdm lua from the kinematics GitHub but it wasn't equipping any of my aftercast sets and trying to fix it was just another level for my level of knowledge. (which is zero btw xD) Not sure I understand what the issue is - when I load this, it works fine, assuming you first define sets.precast, sets.midcast and sets.idle before setting any subsequent sets.
However, I can see that the if...else statements in the precast make some assumptions that may be wrong. For example, casting Utsusemi: Ni will pass in a spell with a skill value of "Ninjutsu", which would be missed by the spell.type:contains("Magic") condition.
By RebornedHero 2019-04-18 07:24:25
I have just returned to the game this week and am trying to get the hand of gearswap again. Last night I was having some issues and I believe the issue is gearswap related. I have noticed the issue so far is on at least Blue Mage and I think Dark Knight and could be on all jobs. After playing for a little while my character becomes unable to cast any spells, or do any abilities unless I disable gearswap, change to a different job or exit FFXI (reloading gearswap doesnt fix the problem). If I change my job back to Blue Mage it still doesn't work either. Does anyone have any idea what the issue is? Could my BLU.lua, gearswap or windower be out of date? I had put quite a bit of time into gearswap for BLU when I last played.
I did just install DGvoodoo which is the only new feature I have introduced to my PC. Maybe I should reinstall windower or FFXI?
Any help is appreciated! Thanks!
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.
|
|