|
BRD Terpander GS
Hades.Triet
Serveur: Hades
Game: FFXI
Posts: 1615
By Hades.Triet 2014-05-25 01:39:10
Anyone have a decent working lua for Terpander?
Using Motenten's but songs are acting funky (I bet its something in the lua) even with specific song gearsets to remove the song duration+. Using Hymnus/Fantasia for dummy song. (Ghorn in progress)
I have +3 instruments for majority of songs. Ballad=+1 (Cithara&AF3 Legs), Scherzo=+1 (AF3 Feet), March=+4 (Langeleik&AF3 Hands), Minuet+4 (Apollo's&AF3 Body), Madrigal=+4 (Cantabank's&AF3 Head).
Code -------------------------------------------------------------------------------------------------------------------
-- Initialization function that defines sets and variables to be used.
-------------------------------------------------------------------------------------------------------------------
-- IMPORTANT: Make sure to also get the Mote-Include.lua file (and its supplementary files) to go with this.
--[[
Custom commands:
Terpander has a set of modes: None, Dummy, Terpander
You can set these via the standard 'set' and 'cycle' self-commands. EG:
gs c cycle Terpander
gs c set Terpander Dummy
The Dummy state will equip the Terpander and ensure non-duration gear is equipped.
The Terpander state will simply equip the Terpander on top of standard gear.
Use the Dummy version to put up dummy songs that can be overwritten by full-potency songs.
Use the Terpander version to simply put up additional songs without worrying about dummy songs.
Simple macro to cast a dummy Terpander song:
/console gs c set Terpander Dummy
/ma "Shining Fantasia" <me>
There is also an auto-handling of Terpander songs, via the state.AutoTerpander flag:
If state.TerpanderMode is None, and if currently tracked songs (via timers) is less
than the max we could sing while using the Terpander, and if the song is cast on
self (rather than Pianissimo on another player), then it will equip the Terpander on
top of standard duration gear.
--]]
-- Initialization function for this job file.
function get_sets()
-- Load and initialize the include file.
include('Mote-Include.lua')
end
-- Setup vars that are user-independent.
function job_setup()
state.Buff['Pianissimo'] = buffactive['pianissimo'] or false
options.TerpanderModes = {'None','Dummy','Terpander'}
state.TerpanderMode = 'Dummy'
-- For tracking current recast timers via the Timers plugin.
timer_reg = {}
end
-- Setup vars that are user-dependent. Can override this function in a sidecar file.
function user_setup()
-- Options: Override default values
options.CastingModes = {'Normal', 'Resistant'}
options.OffenseModes = {'None', 'Normal'}
options.DefenseModes = {'Normal'}
options.WeaponskillModes = {'Normal'}
options.IdleModes = {'Normal', 'PDT'}
options.RestingModes = {'Normal'}
options.PhysicalDefenseModes = {'PDT'}
options.MagicalDefenseModes = {'MDT'}
state.Defense.PhysicalMode = 'PDT'
state.OffenseMode = 'None'
brd_daggers = S{'Izhiikoh', 'Vanir Knife', 'Atoyac', 'Aphotic Kukri'}
pick_tp_weapon()
-- Adjust this is using Terpander (new +song instrument)
info.TerpanderInstrument = 'Terpander'
-- How many extra songs we can keep from Terpander
info.TerpanderSongs = 1
-- Whether to try to automatically use Terpander when an appropriate gap in current vs potential
-- songs appears, and you haven't specifically changed state.TerpanderMode.
state.AutoTerpander = true
-- Additional local binds
send_command('bind ^` input /ma "Chocobo Mazurka" <me>')
-- Default macro set/book
set_macro_page(1, 7)
end
-- Called when this job file is unloaded (eg: job change)
function file_unload()
if binds_on_unload then
binds_on_unload()
end
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.FC = {head="Nahtirah Hat",ear2="Loquacious Earring",
ring1="Prolix Ring",back="Swith Cape",waist="Witful Belt",legs="Orvail Pants +1"}
sets.precast.FC.Cure = set_combine(sets.precast.FC, {body="Heka's Kalasiris"})
sets.precast.FC.EnhancingMagic = set_combine(sets.precast.FC, {waist="Siegel Sash"})
sets.precast.FC.BardSong = {main="Felibre's Dague",
head="Aoidos' Calot +2",neck="Aoidos' Matinee",ear1="Aoidos' Earring",ear2="Loquacious Earring",
body="Sha'ir Manteel",hands="Schellenband",ring1="Prolix Ring",
back="Swith Cape",waist="Witful Belt",legs="Gendewitha Spats",feet="Bokwus Boots"}
sets.precast.FC.Terpander = {main="Felibre's Dague", range="Terpander",
head="Nahtirah Hat",neck="Jeweled Collar",ear1="Aoidos' Earring",ear2="Loquacious Earring",
body="Sha'ir Manteel",hands="Schellenband",ring1="Prolix Ring",
back="Swith Cape",waist="Witful Belt",legs="Gendewitha Spats",feet="Bokwus Boots"}
-- Precast sets to enhance JAs
--sets.precast.JA.Nightingale = {feet="Bard's Slippers +2"}
--sets.precast.JA.Troubadour = {body="Bard's Justaucorps +2"}
--sets.precast.JA['Soul Voice'] = {legs="Bard's 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 = {head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Bard's Justaucorps +2",hands="Buremte Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Atheling Mantle",waist="Caudata Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS['Evisceration'] = {
head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Bard's Justaucorps +2",hands="Buremte Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Atheling Mantle",waist="Caudata Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
sets.precast.WS['Exenterator'] = {
head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Bard's Justaucorps +2",hands="Buremte Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Atheling Mantle",waist="Caudata Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
sets.precast.WS['Mordant Rime'] = {
head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Bard's Justaucorps +2",hands="Buremte Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Atheling Mantle",waist="Caudata Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
-- Midcast Sets
-- General set for recast times.
sets.midcast.FastRecast = {head="Nahtirah Hat",ear2="Loquacious Earring",
body="Anhur Robe",hands="Magavan Mitts",ring1="Prolix Ring",
back="Swith Cape",waist="Witful Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
-- Gear to enhance certain classes of songs. No instruments added here since Gjallarhorn is being used.
sets.midcast.Ballad = {range="Crooner's Cithara",legs="Aoidos' Rhing. +2"}
sets.midcast.Lullaby = {range="Pan's Horn",hands="Brioso Cuffs"}
sets.midcast.Madrigal = {range="Cantabank's Horn",head="Aoidos' Calot +2"}
sets.midcast.March = {range="Langeleik",hands="Aoidos' Manchettes +2"}
sets.midcast.Minuet = {range="Apollo's Flute",body="Aoidos' Hongreline +2"}
sets.midcast.Etude = {range="Langeleik"}
sets.midcast.Carol = {head="Aoidos' Calot +2",body="Aoidos' Hongreline +2",hands="Aoidos' Manchettes +2",legs="Aoidos' Rhing. +2",feet="Aoidos' Cothrn. +2"}
sets.midcast.Elegy = {range="Syrinx"}
sets.midcast.Minne = {range="Syrinx"}
sets.midcast.Prelude = {range="Cantabank's Horn"}
sets.midcast.Mambo = {range="Vihuela"}
sets.midcast.Mazurka = {range="Vihuela"}
sets.midcast.Requiem = {range="Hamelin Flute"}
sets.midcast.Threnody = {range="Piccolo +1"}
sets.midcast.Hymnus = {main="Felibre's Dague", range="Terpander",
head="Nahtirah Hat",neck="Jeweled Collar",ear1="Aoidos' Earring",ear2="Loquacious Earring",
body="Sha'ir Manteel",hands="Schellenband",ring1="Prolix Ring",
back="Swith Cape",waist="Witful Belt",legs="Gendewitha Spats",feet="Bokwus Boots"}
sets.midcast.Fantasia = {main="Felibre's Dague", range="Terpander",
head="Nahtirah Hat",neck="Jeweled Collar",ear1="Aoidos' Earring",ear2="Loquacious Earring",
body="Sha'ir Manteel",hands="Schellenband",ring1="Prolix Ring",
back="Swith Cape",waist="Witful Belt",legs="Gendewitha Spats",feet="Bokwus Boots"}
sets.midcast["Sentinel's Scherzo"] = {feet="Aoidos' Cothrn. +2"}
sets.midcast['Magic Finale'] = {range="Pan's Horn",neck="Wind Torque",legs="Aoidos' Rhing. +2"}
-- For song buffs (duration and AF3 set bonus)
sets.midcast.SongEffect = {main="Legato Dagger",
head="Aoidos' Calot +2",neck="Aoidos' Matinee",ear2="Loquacious Earring",
body="Aoidos' Hongreline +2",hands="Aoidos' Manchettes +2",ring1="Prolix Ring",
legs="Aoidos' Rhing. +2",feet="Brioso Slippers"}
-- For song defbuffs (duration primary, accuracy secondary)
sets.midcast.SongDebuff = {main="Soothsayer Staff",sub="Mephitis Grip",
head="Nahtirah Hat",neck="Wind Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Aoidos' Hongreline +2",hands="Gendewitha Gages",ring1="Perception Ring",ring2="Sangoma Ring",
back="Balladeer's Cape",waist="Demonry Sash",legs="Gendewitha Spats",feet="Brioso Slippers"}
-- For song defbuffs (accuracy primary, duration secondary)
sets.midcast.ResistantSongDebuff = {main="Soothsayer Staff",sub="Mephitis Grip",
head="Nahtirah Hat",neck="Wind Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Aoidos' Hongreline +2",hands="Gendewitha Gages",ring1="Perception Ring",ring2="Sangoma Ring",
back="Balladeer's Cape",waist="Demonry Sash",legs="Gendewitha Spats",feet="Brioso Slippers"}
-- Song-specific recast reduction
sets.midcast.SongRecast = {ear2="Loquacious Earring",
ring1="Prolix Ring",back="Harmony Cape",waist="Corvax Sash",legs="Aoidos' Rhinghrave +2"}
sets.midcast.Terpander = {main="Felibre's Dague", range="Terpander",
head="Nahtirah Hat",neck="Jeweled Collar",ear1="Aoidos' Earring",ear2="Loquacious Earring",
body="Sha'ir Manteel",hands="Schellenband",ring1="Prolix Ring",
back="Swith Cape",waist="Witful Belt",legs="Gendewitha Spats",feet="Bokwus Boots"}
-- Cast spell with normal gear, except using Terpander instead
sets.midcast.Terpander = {range="Terpander"}
-- Dummy song with Terpander; minimize duration to make it easy to overwrite.
sets.midcast.TerpanderDummy = {range="Terpander"}
--head="Nahtirah Hat",neck="Wind Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
--body="Brioso Justaucorps",hands="Aoidos' Manchettes +2",ring1="Prolix Ring",ring2="Sangoma Ring",
--back="Swith Cape",waist="Goading Belt",legs="Gendewitha Spats",feet="Bokwus Boots"
-- Other general spells and classes.
sets.midcast.Cure = {main="Arka IV",neck="Phalaina Locket",
head="Gendewitha Caubeen",body="Heka's Kalasiris",feet="Gendewitha Galoshes"}
sets.midcast.Stoneskin = {head="Nahtirah Hat",neck="Stone Gorget",
body="Anhur Robe",waist="Siegel Sash",legs="Haven Hose",feet="Gendewitha Galoshes"}
sets.midcast.Cursna = {feet="Gendewitha Galoshes"}
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {}
-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
sets.idle = {main="Legato Dagger",sub="Genbu's Shield",range="Terpander",head="Nahtirah Hat",
neck="Twilight Torque",ear1="Musical Earring",ear2="Aoidos' Earring",body="Heka's Kalasiris",
hands="Serpentes Cuffs",ring1="Dark Ring",ring2="Dark Ring",back="Shadow Mantle",
waist="Witful Belt",legs="Aoidos' Rhingrave +2",feet="Aoidos' Cothurnes +2"}
sets.idle.Town = {main="Legato Dagger",sub="Genbu's Shield",range="Terpander",head="Nahtirah Hat",
neck="Twilight Torque",ear1="Musical Earring",ear2="Aoidos' Earring",body="Heka's Kalasiris",
hands="Serpentes Cuffs",ring1="Dark Ring",ring2="Dark Ring",back="Shadow Mantle",
waist="Witful Belt",legs="Aoidos' Rhingrave +2",feet="Aoidos' Cothurnes +2"}
sets.idle.Weak = {main="Legato Dagger",sub="Genbu's Shield",range="Terpander",head="Nahtirah Hat",
neck="Twilight Torque",ear1="Musical Earring",ear2="Aoidos' Earring",body="Heka's Kalasiris",
hands="Serpentes Cuffs",ring1="Dark Ring",ring2="Dark Ring",back="Shadow Mantle",
waist="Witful Belt",legs="Aoidos' Rhingrave +2",feet="Aoidos' Cothurnes +2"}
-- Defense sets
sets.defense.PDT = {main=gear.Staff.PDT,sub="Quire Grip",
head="Gendewitha Caubeen",neck="Twilight Torque",
body="Gendewitha Bliaut",hands="Gendewitha Gages",ring1="Dark Ring",
back="Umbra Cape",waist="Flume Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
sets.defense.MDT = {main=gear.Staff.PDT,sub="Quire Grip",
head="Nahtirah Hat",neck="Twilight Torque",
body="Gendewitha Bliaut",hands="Gendewitha Gages",ring1="Merman's Ring",ring2="Merman's Ring",
back="Engulfer Cape",waist="Flume Belt",legs="Bokwus Slops",feet="Gendewitha Galoshes"}
sets.Kiting = {feet="Aoidos' Cothurnes +2"}
-- 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
-- Basic set for if no TP weapon is defined.
sets.engaged = {main="Izhiikoh",head="Espial Cap",neck="Asperity Necklace",
ear1="Bladeborn Earring",ear2="Steelflash Earring",body="Espial Gambison",
hands="Buremte Gloves",ring1="Tyrant's Ring",ring2="Rajas Ring",back="Atheling Mantle",
waist="Dynamic Belt",legs="Espial Hose",feet="Espial Socks"}
-- Sets with weapons defined.
sets.engaged.Dagger = {main="Izhiikoh",head="Espial Cap",neck="Asperity Necklace",
ear1="Bladeborn Earring",ear2="Steelflash Earring",body="Espial Gambison",
hands="Buremte Gloves",ring1="Tyrant's Ring",ring2="Rajas Ring",back="Atheling Mantle",
waist="Dynamic Belt",legs="Espial Hose",feet="Espial Socks"}
-- Set if dual-wielding
sets.engaged.DualWield = {main="Izhiikoh",sub="Eminent Dagger",head="Espial Cap",neck="Asperity Necklace",
ear1="Bladeborn Earring",ear2="Steelflash Earring",body="Espial Gambison",
hands="Buremte Gloves",ring1="Tyrant's Ring",ring2="Rajas Ring",back="Atheling Mantle",
waist="Dynamic Belt",legs="Espial Hose",feet="Espial Socks"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job- versions of event handlers, allowing overriding default handling.
-------------------------------------------------------------------------------------------------------------------
-- 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 and not state.Buff['Pianissimo'] then
cancel_spell()
send_command('@input /ja "Pianissimo" <me>; wait 1.25; input /ma "'..spell.name..'" '..spell.target.name)
eventArgs.cancel = true
return
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
-- Default base equipment layer of fast recast.
equip(sets.midcast.FastRecast)
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.TerpanderMode == 'Terpander' then
equip(sets.midcast.Terpander)
elseif state.TerpanderMode == 'None' and spell.target.type == 'SELF' and state.AutoTerpander and daur_song_gap() then
equip(sets.midcast.Terpander)
end
state.TerpanderMode = 'None'
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 not spell.interrupted then
if state.Buff[spell.name] ~= nil then
state.Buff[spell.name] = true
end
if spell.type == 'BardSong' then
if spell.target then
if spell.target.type and spell.target.type:upper() == 'SELF' then
adjust_Timers(spell, action, spellMap)
end
end
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- Hooks for other events that aren't handled by the include file.
-------------------------------------------------------------------------------------------------------------------
function job_buff_change(buff, gain)
if state.Buff[buff] ~= nil then
state.Buff[buff] = gain
end
end
-------------------------------------------------------------------------------------------------------------------
-- Hooks for Terpander mode handling.
-------------------------------------------------------------------------------------------------------------------
-- Request job-specific mode tables.
-- Return true on the third returned value to indicate an error: that we didn't recognize the requested field.
function job_get_mode_list(field)
if field == 'Terpander' and player.inventory.Terpander then
return options.TerpanderModes, state.TerpanderMode
end
end
-- Set job-specific mode values.
-- Return true if we recognize and set the requested field.
function job_set_mode(field, val)
if field == 'Terpander' then
state.TerpanderMode = val
return true
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements self-commands.
-------------------------------------------------------------------------------------------------------------------
-- Called by the 'update' self-command.
function job_update(cmdParams, eventArgs)
pick_tp_weapon()
end
-- Handle notifications of general user state change.
function job_state_change(stateField, newValue)
if stateField == 'OffenseMode' then
if newValue == 'Normal' then
disable('main','sub')
else
enable('main','sub')
end
elseif stateField == 'Reset' then
if state.OffenseMode == 'None' then
enable('main','sub')
end
end
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 defenseString = ''
if state.Defense.Active then
local defMode = state.Defense.PhysicalMode
if state.Defense.Type == 'Magical' then
defMode = state.Defense.MagicalMode
end
defenseString = 'Defense: '..state.Defense.Type..' '..defMode..', '
end
local meleeString = ''
if state.OffenseMode == 'Normal' then
if state.CombatForm then
meleeString = 'Melee: Dual-wield, '
else
meleeString = 'Melee: Single-wield, '
end
end
add_to_chat(122,'Casting ['..state.CastingMode..'], '..meleeString..'Idle ['..state.IdleMode..'], '..defenseString..
'Kiting: '..on_off_names[state.Kiting])
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)
if spell.targets:contains('Enemy') then
if state.CastingMode == 'Resistant' then
return 'ResistantSongDebuff'
else
return 'SongDebuff'
end
elseif state.TerpanderMode == 'Dummy' then
return 'TerpanderDummy'
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, action, spellMap)
local t = os.time()
-- Eliminate songs that have already expired from our local list.
local tempreg = {}
for i,v in pairs(timer_reg) do
if v < t then tempreg[i] = true end
end
for i,v in pairs(tempreg) do
timer_reg[i] = nil
end
local dur = calculate_duration(spell.name, spellMap)
if timer_reg[spell.name] then
-- Can delete timers that have less than 120 seconds remaining, since
-- the new version of the song will overwrite the old one.
-- Otherwise create a new timer counting down til we can overwrite.
if (timer_reg[spell.name] - t) <= 120 then
send_command('timers delete "'..spell.name..'"')
timer_reg[spell.name] = t + 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 == 'Terpander' then
maxsongs = maxsongs + info.TerpanderSongs
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(timer_reg) then
maxsongs = table.length(timer_reg)
end
-- Create or update new song timers.
if table.length(timer_reg) < maxsongs then
timer_reg[spell.name] = t+dur
send_command('timers create "'..spell.name..'" '..dur..' down')
else
local rep,repsong
for i,v in pairs(timer_reg) do
if t+dur > v then
if not rep or rep > v then
rep = v
repsong = i
end
end
end
if repsong then
timer_reg[repsong] = nil
send_command('timers delete "'..repsong..'"')
timer_reg[spell.name] = t+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 == 'Terpander' then mult = mult + 0.3 end -- change to 0.25 with 90 Daur
if player.equipment.range == "Gjallarhorn" then mult = mult + 0.4 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.1 end
if player.equipment.neck == "Aoidos' Matinee" then mult = mult + 0.1 end
if player.equipment.body == "Aoidos' Hngrln. +2" 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" then mult = mult + 0.1 end
if player.equipment.feet == "Brioso Slippers +1" then mult = mult + 0.11 end
if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet" then mult = mult + 0.1 end
if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet +1" then mult = mult + 0.1 end
if spellMap == 'Madrigal' and player.equipment.head == "Aoidos' Calot +2" then mult = mult + 0.1 end
if spellMap == 'Minuet' and player.equipment.body == "Aoidos' Hngrln. +2" then mult = mult + 0.1 end
if spellMap == 'March' and player.equipment.hands == 'Ad. Mnchtte. +2' then mult = mult + 0.1 end
if spellMap == 'Ballad' and player.equipment.legs == "Aoidos' Rhing. +2" then mult = mult + 0.1 end
if spellName == "Sentinel's Scherzo" and player.equipment.feet == "Aoidos' Cothrn. +2" 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
-- Tweak for inaccuracies in cast vs aftercast timing
mult = mult - 0.05
local totalDuration = mult*120
return totalDuration
end
function daur_song_gap()
if player.inventory.Terpander then
-- Figure out how many songs we can maintain.
local maxsongs = 2 + info.TerpanderSongs
local activesongs = table.length(timer_reg)
-- If we already have at least 2 songs on, but not enough to max out
-- on possible Daur songs, flag us as Daur-ready.
if activesongs >= 2 and activesongs < maxsongs then
return true
end
end
return false
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 = 'Dagger'
if S{'NIN','DNC'}:contains(player.sub_job) and brd_daggers:contains(player.equipment.sub) then
state.CombatForm = "DualWield"
else
state.CombatForm = nil
end
else
state.CombatWeapon = nil
state.CombatForm = nil
end
end
Hades.Triet
Serveur: Hades
Game: FFXI
Posts: 1615
By Hades.Triet 2014-05-25 23:54:25
Bump?
;_;
VIP
Serveur: Fenrir
Game: FFXI
Posts: 764
By Fenrir.Motenten 2014-05-26 00:16:21
You edited more than you should have. You should not be editing job_setup() if you don't have the skill to debug stuff on your own, since that function defines things that the job file as a whole depends on. You should only be editing values in user_setup() for personal adjustments.
You also managed to completely destroy the indenting, making it very difficult to determine whether you've messed up any of the processing logic.
Suggestion: scrap it, get a fresh copy, create a sidecar file (brd_gear.lua) and only copy over user_setup() and init_gear_sets(). Edit those functions in the sidecar file, test, and then get back with what your current situation is, if you're still having issues.
[+]
Sylph.Feary
Serveur: Sylph
Game: FFXI
Posts: 455
By Sylph.Feary 2014-05-26 00:35:16
i have one. i use different songs tho.
By Sieha1 2014-05-26 02:10:36
You edited more than you should have. You should not be editing job_setup() if you don't have the skill to debug stuff on your own, since that function defines things that the job file as a whole depends on. You should only be editing values in user_setup() for personal adjustments.
You also managed to completely destroy the indenting, making it very difficult to determine whether you've messed up any of the processing logic.
Suggestion: scrap it, get a fresh copy, create a sidecar file (brd_gear.lua) and only copy over user_setup() and init_gear_sets(). Edit those functions in the sidecar file, test, and then get back with what your current situation is, if you're still having issues.
I think he is wanting a derrrr solution, not a I understand and will do that, solution.
[+]
Alexander.Carrelo
Serveur: Alexander
Game: FFXI
Posts: 3706
By Alexander.Carrelo 2014-05-26 02:59:01
Hymnus will cause problems for you during Soul Voice because it gets a duration boost instead of potency. It's such a shame, that low casting time is so nice. ; ;
Hades.Triet
Serveur: Hades
Game: FFXI
Posts: 1615
By Hades.Triet 2014-05-26 14:48:19
Is there a better suggestion for dummy song? I noticed someone using Shining Fantasia, which I also use sometimes.
And yeah. The lua has Ghorn, which I don't have, so I removed it from all the sets and tried adjusting the midcast sets with the appropriate instruments (adding those that were missing. But I am now thinking that I should just remove Ghorn from all the sets and put "/equip range "(insert instrument here)" before each of the macros for each of the songs.
Shiva.Siral
Serveur: Shiva
Game: FFXI
Posts: 193
By Shiva.Siral 2014-05-26 17:20:27
Alexander.Carrelo said: »Hymnus will cause problems for you during Soul Voice because it gets a duration boost instead of potency. It's such a shame, that low casting time is so nice. ; ;
Usually when using soul voice you use night/troub so cast time should be instant.
So you can use hymnus for the dummy song for all normal times and then use paeon or something similar for the dummy song when night/troub/soul voice is active.
Pretty sure you can probably set a rule that when soul voice is active and you use hymnus it forces it to a paeon song or something so you don't have to worry about 2 seperate macros.
By Miang 2014-05-26 17:38:41
I use Fire Carol II as my dummy song, since it has a range of 10' with stringed, whereas most songs have a vast range that ends up overwriting melee or tank songs.
[+]
Alexander.Carrelo
Serveur: Alexander
Game: FFXI
Posts: 3706
By Alexander.Carrelo 2014-05-26 22:54:19
Alexander.Carrelo said: »Hymnus will cause problems for you during Soul Voice because it gets a duration boost instead of potency. It's such a shame, that low casting time is so nice. ; ;
Usually when using soul voice you use night/troub so cast time should be instant.
So you can use hymnus for the dummy song for all normal times and then use paeon or something similar for the dummy song when night/troub/soul voice is active.
Pretty sure you can probably set a rule that when soul voice is active and you use hymnus it forces it to a paeon song or something so you don't have to worry about 2 seperate macros. If you want to go to the trouble, of course. I just mentioned it as reasons the OP's rewriting might've been going wrong lol
Hades.Triet
Serveur: Hades
Game: FFXI
Posts: 1615
By Hades.Triet 2014-06-04 22:04:05
Did this, wrote in all my sets, changed nothing else but the 'Terpander' bit and maxsongs to 1. I have the macro for the dummysong
line 1: /console gs c set Terpander Dummy
line 2: /song "Shining Fantasia" <me>
and all it does is overwrites one of the 2 previous songs.
My way around this right now is to have a macro with /equip range "Terpander" and spam it as I am singing 3rd song. Trouble is when I use Nightingale/Troubadour that doesn't work so well. :P
Here is the code Code -------------------------------------------------------------------------------------------------------------------
-- Initialization function that defines sets and variables to be used.
-------------------------------------------------------------------------------------------------------------------
-- IMPORTANT: Make sure to also get the Mote-Include.lua file (and its supplementary files) to go with this.
--[[
Custom commands:
Daurdabla has a set of modes: None, Dummy, Daurdabla
You can set these via the standard 'set' and 'cycle' self-commands. EG:
gs c cycle daurdabla
gs c set daurdabla Dummy
The Dummy state will equip the Daurdabla and ensure non-duration gear is equipped.
The Daurdabla state will simply equip the Daurdabla on top of standard gear.
Use the Dummy version to put up dummy songs that can be overwritten by full-potency songs.
Use the Daurdabla version to simply put up additional songs without worrying about dummy songs.
Simple macro to cast a dummy Daurdabla song:
/console gs c set daurdabla Dummy
/ma "Shining Fantasia" <me>
There is also an auto-handling of Daurdabla songs, via the state.AutoDaurdabla flag:
If state.DaurdablaMode is None, and if currently tracked songs (via timers) is less
than the max we could sing while using the Daurdabla, and if the song is cast on
self (rather than Pianissimo on another player), then it will equip the Daurdabla on
top of standard duration gear.
--]]
-- Initialization function for this job file.
function get_sets()
-- Load and initialize the include file.
include('Mote-Include.lua')
end
-- Setup vars that are user-independent.
function job_setup()
state.Buff['Pianissimo'] = buffactive['pianissimo'] or false
options.DaurdablaModes = {'None','Dummy','Daurdabla'}
state.DaurdablaMode = 'None'
-- For tracking current recast timers via the Timers plugin.
timer_reg = {}
end
-- Setup vars that are user-dependent. Can override this function in a sidecar file.
function user_setup()
-- Options: Override default values
options.CastingModes = {'Normal', 'Resistant'}
options.OffenseModes = {'None', 'Normal'}
options.DefenseModes = {'Normal'}
options.WeaponskillModes = {'Normal'}
options.IdleModes = {'Normal', 'PDT'}
options.RestingModes = {'Normal'}
options.PhysicalDefenseModes = {'PDT'}
options.MagicalDefenseModes = {'MDT'}
state.Defense.PhysicalMode = 'PDT'
state.OffenseMode = 'None'
brd_daggers = S{'Izhiikoh', 'Vanir Knife', 'Atoyac', 'Aphotic Kukri'}
pick_tp_weapon()
-- Adjust this if using the Terpander (new +song instrument)
info.DaurdablaInstrument = 'Terpander'
-- How many extra songs we can keep from Daurdabla/Terpander
info.DaurdablaSongs = 1
-- Whether to try to automatically use Daurdabla when an appropriate gap in current vs potential
-- songs appears, and you haven't specifically changed state.DaurdablaMode.
state.AutoDaurdabla = false
-- Additional local binds
send_command('bind ^` input /ma "Chocobo Mazurka" <me>')
-- Default macro set/book
set_macro_page(1, 7)
end
-- Called when this job file is unloaded (eg: job change)
function file_unload()
if binds_on_unload then
binds_on_unload()
end
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.FC = {head="Nahtirah Hat",ear2="Loquac. Earring",
hands="Gendewitha Gages",ring1="Prolix Ring",
back="Swith Cape",waist="Witful Belt",legs="Orvail Pants +1"}
sets.precast.FC.Cure = set_combine(sets.precast.FC, {body="Heka's Kalasiris"})
sets.precast.FC.Stoneskin = set_combine(sets.precast.FC)
sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
sets.precast.FC.BardSong = {main="Felibre's Dague",
head="Aoidos' Calot +2",neck="Aoidos' Matinee",ear1="Aoidos' Earring",ear2="Loquac. Earring",
body="Sha'ir Manteel",hands="Gendewitha Gages",ring1="Prolix Ring",
back="Swith Cape",waist="Witful Belt",legs="Gendewitha Spats",feet="Bokwus Boots"}
sets.precast.FC.Daurdabla = set_combine(sets.precast.FC.BardSong, {range=info.DaurdablaInstrument})
-- Precast sets to enhance JAs
--sets.precast.JA.Nightingale = {feet="Bihu Slippers"}
--sets.precast.JA.Troubadour = {body="Bihu Justaucorps"}
--sets.precast.JA['Soul Voice'] = {legs="Bihu Cannions"}
-- Waltz set (chr and vit)
sets.precast.Waltz = {head="Nahtirah Hat",
body="Brioso Justaucorps",hands="Buremte Gloves",
legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
-- 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="Bihu Justaucorps",hands="Buremte Gloves",ring1="K'ayres Ring",ring2="Rajas Ring",
back="Atheling Mantle",waist="Windbuffet Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS['Evisceration'] = {
head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Bihu Justaucorps",hands="Buremte Gloves",ring1="K'ayres Ring",ring2="Rajas Ring",
back="Atheling Mantle",waist="Windbuffet Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
sets.precast.WS['Exenterator'] = {
head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Bihu Justaucorps",hands="Buremte Gloves",ring1="K'ayres Ring",ring2="Rajas Ring",
back="Atheling Mantle",waist="Windbuffet Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
sets.precast.WS['Mordant Rime'] = {range="Gjallarhorn",
head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Bihu Justaucorps",hands="Buremte Gloves",ring1="K'ayres Ring",ring2="Rajas Ring",
back="Atheling Mantle",waist="Windbuffet Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
-- Midcast Sets
-- General set for recast times.
sets.midcast.FastRecast = {range="Angel Lyre",
head="Nahtirah Hat",ear2="Loquacious Earring",
body="Anhur Robe",hands="Gendewitha Gages",ring1="Prolix Ring",
back="Swith Cape",waist="Goading Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
-- Gear to enhance certain classes of songs. No instruments added here since Gjallarhorn is being used.
sets.midcast.Ballad = {legs="Aoidos' Rhing. +2"}
sets.midcast.Lullaby = {hands="Brioso Cuffs"}
sets.midcast.Madrigal = {head="Aoidos' Calot +2"}
sets.midcast.March = {hands="Aoidos' Manchettes +2"}
sets.midcast.Minuet = {body="Aoidos' Hongreline +2"}
sets.midcast.Minne = {}
sets.midcast.Carol = {head="Aoidos' Calot +2",
body="Aoidos' Hongreline +2",hands="Aoidos' Manchettes +2",
legs="Aoidos' Rhing. +2",feet="Aoidos' Cothrn. +2"}
sets.midcast["Sentinel's Scherzo"] = {feet="Aoidos' Cothrn. +2"}
sets.midcast['Magic Finale'] = {neck="Wind Torque",legs="Aoidos' Rhing. +2"}
sets.midcast.Mazurka = {range=info.DaurdablaInstrument}
-- For song buffs (duration and AF3 set bonus)
sets.midcast.SongEffect = {main="Legato Dagger",
head="Aoidos' Calot +2",neck="Aoidos' Matinee",ear2="Loquacious Earring",
body="Aoidos' Hongreline +2",hands="Aoidos' Manchettes +2",ring1="Prolix Ring",
legs="Gendewitha Spats",feet="Brioso Slippers"}
-- For song defbuffs (duration primary, accuracy secondary)
sets.midcast.SongDebuff = {main="Soothsayer Staff",sub="Mephitis Grip",
head="Nahtirah Hat",neck="Aoidos' Matinee",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Aoidos' Hongreline +2",hands="Aoidos' Manchettes +2",ring1="Prolix Ring",ring2="Sangoma Ring",
back="Refraction Cape",waist="Goading Belt",legs="Orvail Pants +1",feet="Brioso Slippers"}
-- For song defbuffs (accuracy primary, duration secondary)
sets.midcast.ResistantSongDebuff = {main="Soothsayer Staff",sub="Mephitis Grip",
head="Nahtirah Hat",neck="Wind Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Brioso Justaucorps",hands="Aoidos' Manchettes +2",ring1="Prolix Ring",ring2="Sangoma Ring",
back="Refraction Cape",waist="Demonry Sash",legs="Brioso Cannions +1",feet="Bokwus Boots"}
-- Song-specific recast reduction
sets.midcast.SongRecast = {ear2="Loquacious Earring",
ring1="Prolix Ring",
legs="Aoidos' Rhing. +2"}
--sets.midcast.Daurdabla = set_combine(sets.midcast.FastRecast, sets.midcast.SongRecast, {range=info.DaurdablaInstrument})
-- Cast spell with normal gear, except using Daurdabla instead
sets.midcast.Daurdabla = {range=info.DaurdablaInstrument}
-- Dummy song with Daurdabla; minimize duration to make it easy to overwrite.
sets.midcast.DaurdablaDummy = {main="Izhiikoh",range=info.DaurdablaInstrument,
head="Nahtirah Hat",neck="Wind Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Brioso Justaucorps",hands="Aoidos' Manchettes +2",ring1="Prolix Ring",ring2="Sangoma Ring",
back="Swith Cape",waist="Goading Belt",legs="Gendewitha Spats",feet="Bokwus Boots"}
-- Other general spells and classes.
sets.midcast.Cure = {main="Arka IV",sub='Achaq Grip',
head="Gendewitha Caubeen",
body="Heka's Kalasiris",hands="Gendewitha Gages",
legs="Praeco Slacks",feet="Gendewitha Galoshes"}
sets.midcast.Curaga = sets.midcast.Cure
sets.midcast.Stoneskin = {
head="Nahtirah Hat",
body="Anhur Robe",hands="Gendewitha Gages",
legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
sets.midcast.Cursna = {
feet="Gendewitha Galoshes"}
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {
body="Heka's Kalasiris"}
-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
sets.idle = {main=gear.Staff.PDT, sub="Mephitis Grip",
head="Gendewitha Caubeen",neck="Twilight Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Heka's Kalasiris",hands="Gendewitha Gages",ring1="Paguroidea Ring",ring2="Sheltered Ring",
back="Shadow Mantle",waist="Flume Belt",legs="Gendewitha Spats",feet="Aoidos' Cothurnes +2"}
sets.idle.Town = {main=gear.Staff.PDT, sub="Mephitis Grip",
head="Gendewitha Caubeen",neck="Twilight Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Heka's Kalasiris",hands="Gendewitha Gages",ring1="Paguroidea Ring",ring2="Sheltered Ring",
back="Shadow Mantle",waist="Flume Belt",legs="Gendewitha Spats",feet="Aoidos' Cothurnes +2"}
sets.idle.Weak = {main=gear.Staff.PDT, sub="Mephitis Grip",
head="Gendewitha Caubeen",neck="Twilight Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Heka's Kalasiris",hands="Gendewitha Gages",ring1="Paguroidea Ring",ring2="Sheltered Ring",
back="Shadow Mantle",waist="Flume Belt",legs="Gendewitha Spats",feet="Aoidos' Cothurnes +2"}
-- Defense sets
sets.defense.PDT = {main=gear.Staff.PDT,sub="Mephitis Grip",
head="Gendewitha Caubeen",neck="Twilight Torque",
body="Heka's Kalasiris",hands="Gendewitha Gages",ring1='Dark Ring',ring2="Dark Ring",
back="Shadow Mantle",waist="Flume Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
sets.defense.MDT = {main=gear.Staff.PDT,sub="Mephitis Grip",
head="Nahtirah Hat",neck="Twilight Torque",
body="Gendewitha Bliaut",hands="Gendewitha Gages",ring1="Merman's Ring",ring2="Merman's Ring",
back="Mollusca Mantle",waist="Flume Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
sets.Kiting = {feet="Aoidos' Cothurnes +2"}
-- 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
-- Basic set for if no TP weapon is defined.
sets.engaged = {range="Angel Lyre",
head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Vanir Cotehardie",hands="Buremte Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Atheling Mantle",waist="Goading Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
-- Sets with weapons defined.
sets.engaged.Dagger = {range="Angel Lyre",
head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Vanir Cotehardie",hands="Buremte Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Atheling Mantle",waist="Goading Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
-- Set if dual-wielding
sets.engaged.DualWield = {range="Angel Lyre",
head="Nahtirah Hat",neck="Asperity Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
body="Vanir Cotehardie",hands="Buremte Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Atheling Mantle",waist="Goading Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job- versions of event handlers, allowing overriding default handling.
-------------------------------------------------------------------------------------------------------------------
-- 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 and not state.Buff['Pianissimo'] then
send_command('@input /ja "Pianissimo" <me>; wait 1.5; input /ma "'..spell.name..'" '..spell.target.name)
eventArgs.cancel = true
return
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
-- Default base equipment layer of fast recast.
equip(sets.midcast.FastRecast)
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.DaurdablaMode == 'Daurdabla' then
equip(sets.midcast.Daurdabla)
elseif state.DaurdablaMode == 'None' and spell.target.type == 'SELF' and state.AutoDaurdabla and daur_song_gap() then
equip(sets.midcast.Daurdabla)
end
state.DaurdablaMode = 'None'
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 not spell.interrupted then
if state.Buff[spell.name] ~= nil then
state.Buff[spell.name] = true
end
if spell.type == 'BardSong' then
if spell.target then
if spell.target.type and spell.target.type:upper() == 'SELF' then
adjust_Timers(spell, action, spellMap)
end
end
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- Hooks for other events that aren't handled by the include file.
-------------------------------------------------------------------------------------------------------------------
function job_buff_change(buff, gain)
if state.Buff[buff] ~= nil then
state.Buff[buff] = gain
end
end
-------------------------------------------------------------------------------------------------------------------
-- Hooks for Daurdabla mode handling.
-------------------------------------------------------------------------------------------------------------------
-- Request job-specific mode tables.
-- Return true on the third returned value to indicate an error: that we didn't recognize the requested field.
function job_get_mode_list(field)
if field == 'Daurdabla' then
if player.inventory[info.DaurdablaInstrument] or player.wardrobe[info.DaurdablaInstrument] then
return options.DaurdablaModes, state.DaurdablaMode
else
add_to_chat(123, info.DaurdablaInstrument..' is not in player inventory.')
end
end
end
-- Set job-specific mode values.
-- Return true if we recognize and set the requested field.
function job_set_mode(field, val)
if field == 'Daurdabla' then
state.DaurdablaMode = val
return true
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements self-commands.
-------------------------------------------------------------------------------------------------------------------
-- Called by the 'update' self-command.
function job_update(cmdParams, eventArgs)
pick_tp_weapon()
end
-- Handle notifications of general user state change.
function job_state_change(stateField, newValue)
if stateField == 'OffenseMode' then
if newValue == 'Normal' then
disable('main','sub')
else
enable('main','sub')
end
elseif stateField == 'Reset' then
if state.OffenseMode == 'None' then
enable('main','sub')
end
end
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 defenseString = ''
if state.Defense.Active then
local defMode = state.Defense.PhysicalMode
if state.Defense.Type == 'Magical' then
defMode = state.Defense.MagicalMode
end
defenseString = 'Defense: '..state.Defense.Type..' '..defMode..', '
end
local meleeString = ''
if state.OffenseMode == 'Normal' then
if state.CombatForm then
meleeString = 'Melee: Dual-wield, '
else
meleeString = 'Melee: Single-wield, '
end
end
add_to_chat(122,'Casting ['..state.CastingMode..'], '..meleeString..'Idle ['..state.IdleMode..'], '..defenseString..
'Kiting: '..on_off_names[state.Kiting])
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 == 'Resistant' then
return 'ResistantSongDebuff'
else
return 'SongDebuff'
end
elseif state.DaurdablaMode == '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, action, spellMap)
local t = os.time()
-- Eliminate songs that have already expired from our local list.
local tempreg = {}
for i,v in pairs(timer_reg) do
if v < t then tempreg[i] = true end
end
for i,v in pairs(tempreg) do
timer_reg[i] = nil
end
local dur = calculate_duration(spell.name, spellMap)
if timer_reg[spell.name] then
-- Can delete timers that have less than 120 seconds remaining, since
-- the new version of the song will overwrite the old one.
-- Otherwise create a new timer counting down til we can overwrite.
--if (timer_reg[spell.name] - t) <= 120 then
send_command('timers delete "'..spell.name..'"')
timer_reg[spell.name] = t + 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.DaurdablaInstrument then
maxsongs = maxsongs + info.DaurdablaSongs
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(timer_reg) then
maxsongs = table.length(timer_reg)
end
-- Create or update new song timers.
if table.length(timer_reg) < maxsongs then
timer_reg[spell.name] = t+dur
send_command('timers create "'..spell.name..'" '..dur..' down')
else
local rep,repsong
for i,v in pairs(timer_reg) do
if t+dur > v then
if not rep or rep > v then
rep = v
repsong = i
end
end
end
if repsong then
timer_reg[repsong] = nil
send_command('timers delete "'..repsong..'"')
timer_reg[spell.name] = t+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.3 end -- change to 0.25 with 90 Daur
if player.equipment.range == "Gjallarhorn" then mult = mult + 0.4 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.1 end
if player.equipment.neck == "Aoidos' Matinee" then mult = mult + 0.1 end
if player.equipment.body == "Aoidos' Hngrln. +2" 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" then mult = mult + 0.1 end
if player.equipment.feet == "Brioso Slippers +1" then mult = mult + 0.11 end
if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet" then mult = mult + 0.1 end
if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet +1" then mult = mult + 0.1 end
if spellMap == 'Madrigal' and player.equipment.head == "Aoidos' Calot +2" then mult = mult + 0.1 end
if spellMap == 'Minuet' and player.equipment.body == "Aoidos' Hngrln. +2" then mult = mult + 0.1 end
if spellMap == 'March' and player.equipment.hands == 'Ad. Mnchtte. +2' then mult = mult + 0.1 end
if spellMap == 'Ballad' and player.equipment.legs == "Aoidos' Rhing. +2" then mult = mult + 0.1 end
if spellName == "Sentinel's Scherzo" and player.equipment.feet == "Aoidos' Cothrn. +2" 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
-- Tweak for inaccuracies in cast vs aftercast timing
mult = mult - 0.05
local totalDuration = mult*120
return totalDuration
end
function daur_song_gap()
if player.inventory[info.DaurdablaInstrument] or player.wardrobe[info.DaurdablaInstrument] then
-- Figure out how many songs we can maintain.
local maxsongs = 2 + info.DaurdablaSongs
local activesongs = table.length(timer_reg)
-- If we already have at least 2 songs on, but not enough to max out
-- on possible Daur songs, flag us as Daur-ready.
if activesongs >= 2 and activesongs < maxsongs then
return true
end
end
return false
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 = 'Dagger'
if S{'NIN','DNC'}:contains(player.sub_job) and brd_daggers:contains(player.equipment.sub) then
state.CombatForm = "DualWield"
else
state.CombatForm = nil
end
else
state.CombatWeapon = nil
state.CombatForm = nil
end
end
**EDIT: Nevermind I fixed it.
Sylph.Ryogo
Serveur: Sylph
Game: FFXI
Posts: 27
By Sylph.Ryogo 2014-06-19 21:04:47
Is there an advantage to using a dummy song? I just got my Terpander and I've been planning on playing the least prioritized song using the harp with quickening, fast cast, haste, and song duration -, then replaying the same song immediately after using the ghorn and song duration +. For example, I might play two marches with the ghorn, then play minuet with the harp, then overwrite minuet with the horn right away. It sounds to me like bards are replaying all 3 songs with the harp and then playing over them with the ghorn when a song is dropped. What am I missing? Advice appreciated.
By Zephin 2014-06-19 21:06:34
i do 2 ghorn, 1 terp dummy song, then ghorn right after.
dummy song is to tell your DD's not to run off or outta range
Serveur: Bahamut
Game: FFXI
Posts: 451
By Bahamut.Greyfawkz 2014-06-19 21:20:36
Is there an advantage to using a dummy song? I just got my Terpander and I've been planning on playing the least prioritized song using the harp with quickening, fast cast, haste, and song duration -, then replaying the same song immediately after using the ghorn and song duration +. For example, I might play two marches with the ghorn, then play minuet with the harp, then overwrite minuet with the horn right away. It sounds to me like bards are replaying all 3 songs with the harp and then playing over them with the ghorn when a song is dropped. What am I missing? Advice appreciated.
You'll be waiting on the recast of your third song no?
I do march1, march2 with Ghorn, fantasia(for short duration and AoE) with harp, then third song with Ghorn for full potency for all songs.
Anyone casting 3 songs in harp then overwriting all 3 again is just wasting time.
Serveur: Sylph
Game: FFXI
Posts: 17
By Sylph.Balthamos 2014-06-24 06:37:12
I seem to be having a similar issue, I'm not sure if its because of the recent update but my Dummy Macro...
/console gs c set daurdabla Dummy
/ma "Shining Fantasia" <me>
doesn't seem to equip terpander, and Gearswap still swaps out precast and midcast sets (I'm using /gs showswaps)
I'm doing what people suggest, casting 2xwith Eminent Flute, 1xDummy song with Terpander and then overwriting with a 3rd song with Eminent Flute, it always overwrites the 1st song I cast
I'm wondering if I don't have sufficient gear yet to make a noticable difference in duration? if not could someone have a look at my .lua?
-------------------------------------------------------------------------------------------------------------------
-- Initialization function that defines sets and variables to be used.
-------------------------------------------------------------------------------------------------------------------
-- IMPORTANT: Make sure to also get the Mote-Include.lua file (and its supplementary files) to go with this.
--[[
Custom commands:
Daurdabla has a set of modes: None, Dummy, Daurdabla
You can set these via the standard 'set' and 'cycle' self-commands. EG:
gs c cycle daurdabla
gs c set daurdabla Dummy
The Dummy state will equip the Daurdabla and ensure non-duration gear is equipped.
The Daurdabla state will simply equip the Daurdabla on top of standard gear.
Use the Dummy version to put up dummy songs that can be overwritten by full-potency songs.
Use the Daurdabla version to simply put up additional songs without worrying about dummy songs.
Simple macro to cast a dummy Daurdabla song:
/console gs c set daurdabla Dummy
/ma "Shining Fantasia" <me>
There is also an auto-handling of Daurdabla songs, via the state.AutoDaurdabla flag:
If state.DaurdablaMode is None, and if currently tracked songs (via timers) is less
than the max we could sing while using the Daurdabla, and if the song is cast on
self (rather than Pianissimo on another player), then it will equip the Daurdabla on
top of standard duration gear.
--]]
-- Initialization function for this job file.
function get_sets()
-- Load and initialize the include file.
include('Mote-Include.lua')
end
-- Setup vars that are user-independent.
function job_setup()
state.Buff['Pianissimo'] = buffactive['pianissimo'] or false
options.DaurdablaModes = {'None','Dummy','Daurdabla'}
state.DaurdablaMode = 'None'
-- For tracking current recast timers via the Timers plugin.
timer_reg = {}
end
-- Setup vars that are user-dependent. Can override this function in a sidecar file.
function user_setup()
-- Options: Override default values
options.CastingModes = {'Normal', 'Resistant'}
options.OffenseModes = {'None', 'Normal'}
options.DefenseModes = {'Normal'}
options.WeaponskillModes = {'Normal'}
options.IdleModes = {'Normal', 'PDT'}
options.RestingModes = {'Normal'}
options.PhysicalDefenseModes = {'PDT'}
options.MagicalDefenseModes = {'MDT'}
state.Defense.PhysicalMode = 'PDT'
state.OffenseMode = 'None'
brd_daggers = S{'Izhiikoh', 'Vanir Knife', 'Atoyac', 'Aphotic Kukri'}
pick_tp_weapon()
-- Adjust this if using the Terpander (new +song instrument)
info.DaurdablaInstrument = 'Terpander'
-- How many extra songs we can keep from Daurdabla/Terpander
info.DaurdablaSongs =1
-- Whether to try to automatically use Daurdabla when an appropriate gap in current vs potential
-- songs appears, and you haven't specifically changed state.DaurdablaMode.
state.AutoDaurdabla = false
-- Additional local binds
send_command('bind ^` input /ma "Chocobo Mazurka" <me>')
-- Default macro set/book
set_macro_page()
end
-- Called when this job file is unloaded (eg: job change)
function file_unload()
if binds_on_unload then
binds_on_unload()
end
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.FC = {head="Aoidos' Calot +1",neck="Aoidos' matinee",ear2="Loquacious Earring",
ear1="Aoidos' Earring",body="Praeco Doublet",hands="Espial Bracers",ring1="Aquasoul Ring",
ring2="Aquasoul Ring",back="Swith Cape",waist="Witful Belt",legs="Espial hose",feet="Aoidos' cothurnes +1"}
sets.precast.FC.Cure = set_combine(sets.precast.FC, {main="Arka IV",sub="reign Grip",ammo="mana Ampulla",head="Wayfarer Circlet",neck="Fylgja Torque",ear2="Lifestorm Earring",
ear1="Aoidos' Earring",body="Wayfarer Robe",hands="Serpentes cuffs",ring1="Aquasoul Ring",
ring2="Aquasoul Ring",back="Swith Cape",waist="Pythia Sash",legs="Wayfarer slops",feet="Serpentes Sabots"})
sets.precast.FC.Stoneskin = set_combine(sets.precast.FC, {neck="Stone Gorget",ear1="Earthcry Earring",waist="Siegel Sash",legs="Haven Hose",})
sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {main="Arka IV",sub="Fulcio Grip",waist="Siegel Sash"})
sets.precast.FC.BardSong = {head="Aoidos' Calot +1",neck="Aoidos' matinee",ear2="Loquacious Earring",
ear1="Aoidos' Earring",body="Praeco Doublet",hands="Schellenband",ring1="Aquasoul Ring",
ring2="Aquasoul Ring",back="Swith Cape",waist="Aoidos' Belt",legs="Espial hose",feet="Aoidos' cothurnes +1"}
sets.precast.FC.Daurdabla = set_combine(sets.precast.FC.BardSong, {range=info.DaurdablaInstrument})
-- Precast sets to enhance JAs
sets.precast.JA.Nightingale = {}
sets.precast.JA.Troubadour = {}
sets.precast.JA['Soul Voice'] = {}
-- Waltz set (chr and vit)
sets.precast.Waltz = {ammo="mana Ampulla",head="Wayfarer Circlet",neck="Fylgja Torque",ear2="Lifestorm Earring",
ear1="Aoidos' Earring",body="Wayfarer Robe",hands="Serpentes cuffs",ring1="Aquasoul Ring",
ring2="Aquasoul Ring",back="Swith Cape",waist="Pythia Sash",legs="Wayfarer slops",feet="Serpentes Sabots"}
-- 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'] = {}
sets.precast.WS['Exenterator'] = {}
sets.precast.WS['Mordant Rime'] = {}
-- Midcast Sets
-- General set for recast times.
sets.midcast.FastRecast = {head="Espial Cap",neck="Aoidos' matinee",ear2="Loquacious Earring",
ear1="Aoidos' Earring",body="Espial gambison",hands="Espial Bracers",ring1="Aquasoul Ring",
ring2="Aquasoul Ring",back="Swith Cape",waist="Witful Belt",legs="Espial hose",feet="Espial Socks"}
-- Gear to enhance certain classes of songs. No instruments added here since Gjallarhorn is being used.
sets.midcast.Ballad = {body="Aoidos' Hongreline +2"}
sets.midcast.Lullaby = {body="Aoidos' Hongreline +2"}
sets.midcast.Madrigal = {body="Aoidos' Hongreline +2"}
sets.midcast.March = {body="Aoidos' Hongreline +2"}
sets.midcast.Minuet = {body="Aoidos' Hongreline +2"}
sets.midcast.Minne = {body="Aoidos' Hongreline +2"}
sets.midcast.Carol = {body="Aoidos' Hongreline +2"}
sets.midcast.Etude = {body="Aoidos' Hongreline +2"}
sets.midcast.Paeon = {body="Aoidos' Hongreline +2"}
sets.midcast.Mambo = {body="Aoidos' Hongreline +2"}
sets.midcast.Mazurka = {body="Aoidos' Hongreline +2"}
sets.midcast["Sentinel's Scherzo"] = {body="Aoidos' Hongreline +2"}
sets.midcast['Magic Finale'] = {body="Aoidos' Hongreline +2"}
sets.midcast['Shining Fantasia'] = {}
sets.midcast.Mazurka = {range=info.DaurdablaInstrument}
-- For song buffs (duration and AF3 set bonus)
sets.midcast.SongEffect = {}
-- For song defbuffs (duration primary, accuracy secondary)
sets.midcast.SongDebuff = {}
-- For song defbuffs (accuracy primary, duration secondary)
sets.midcast.ResistantSongDebuff = {head="Aoidos' Calot +1",neck="Noetic torque",ear2="Loquacious Earring",
body="Praeco Doublet",hands="Wayfarer Cuffs",ring1="Aquasoul Ring",
ring2="Aquasoul Ring",back="Swith Cape",waist="Witful Belt",legs="Espial hose",feet="Wayfarer clogs"}
-- Song-specific recast reduction
sets.midcast.SongRecast = {ear2="Loquacious Earring",legs="Aoidos' Rhing. +1"}
--sets.midcast.Daurdabla = set_combine(sets.midcast.FastRecast, sets.midcast.SongRecast, {range=info.DaurdablaInstrument})
-- Cast spell with normal gear, except using Daurdabla instead
sets.midcast.Daurdabla = {range=info.DaurdablaInstrument}
-- Dummy song with Daurdabla; minimize duration to make it easy to overwrite.
sets.midcast.DaurdablaDummy = {}
-- Other general spells and classes.
sets.midcast.Cure = {main="Arka IV",sub="reign Grip",ammo="mana Ampulla",head="Wayfarer Circlet",neck="Fylgja Torque",ear2="Lifestorm Earring",
ear1="Aoidos' Earring",body="Wayfarer Robe",hands="Serpentes cuffs",ring1="Aquasoul Ring",
ring2="Aquasoul Ring",back="Swith Cape",waist="Pythia Sash",legs="Wayfarer slops",feet="Serpentes Sabots"}
sets.midcast.Curaga = sets.midcast.Cure
sets.midcast.Stoneskin = {neck="Stone Gorget",ear1="Earthcry Earring",waist="Siegel Sash",legs="Haven Hose",}
sets.midcast.Cursna = {}
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {main="Dark Staff",sub="reign Grip",ammo="Mana Ampulla",head="Mirror Tiara",neck="Eidolon pendant",ear2="Loquacious Earring",
ear1="Moonshade Earring",body="Aoidos' hongreline +2",hands="Serpentes cuffs",ring1="Star Ring",
ring2="Star Ring",back="Swith Cape",waist="Pythia Sash",legs="Sagacity lappas",feet="Serpentes Sabots"}
-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
sets.idle = {ammo="Mana Ampulla",head="Mirror Tiara",neck="Eidolon pendant",ear2="Loquacious Earring",
ear1="Moonshade Earring",body="Aoidos' hongreline +2",hands="Serpentes cuffs",ring1="Star Ring",
ring2="Star Ring",back="Swith Cape",waist="Pythia Sash",legs="Stearc Subligar",feet="Serpentes Sabots"}
sets.idle.Town = {main="Eminent dagger",sub="Genbu's Shield",ammo="Mana Ampulla",head="Aoidos' calot +1",neck="Eidolon pendant",ear2="Loquacious Earring",
ear1="Moonshade Earring",body="Aoidos' hongreline +2",hands="Serpentes cuffs",ring1="Star Ring",
ring2="Star Ring",back="Swith Cape",waist="Pythia Sash",legs="Aoidos' Rhingrave +1",feet="Serpentes Sabots"}
sets.idle.Weak = {main="Eminent dagger",sub="Genbu's Shield",ammo="Mana Ampulla",head="Aoidos' calot +1",neck="Twilight torque",ear2="Loquacious Earring",
ear1="Moonshade Earring",body="Aoidos' hongreline +2",hands="Serpentes cuffs",ring1="Star Ring",
ring2="Star Ring",back="Swith Cape",waist="Pythia Sash",legs="Aoidos' Rhingrave +1",feet="Serpentes Sabots"}
-- Defense sets
sets.defense.PDT = {}
sets.defense.MDT = {}
sets.Kiting = {}
-- 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
-- Basic set for if no TP weapon is defined.
sets.engaged = {main="Eminent dagger",sub="Genbu's Shield",
head="Espial Cap",neck="Twilight Torque",ear1="Brutal Earring",ear2="Ethereal Earring",
body="Espial Gambison",hands="Espial Bracers",ring1="Rajas Ring",ring2="Keen Ring",
back="Atheling Mantle",waist="Headlong Belt",legs="Espial Hose",feet="Espial Socks"}
-- Sets with weapons defined.
sets.engaged.Dagger = {main="Eminent dagger",sub="Genbu's Shield",
head="Espial Cap",neck="Twilight Torque",ear1="Brutal Earring",ear2="Ethereal Earring",
body="Espial Gambison",hands="Espial Bracers",ring1="Rajas Ring",ring2="Keen Ring",
back="Atheling Mantle",waist="Headlong Belt",legs="Espial Hose",feet="Espial Socks"}
-- Set if dual-wielding
sets.engaged.DualWield = {main="Eminent dagger",sub="Thokcha",
head="Espial Cap",neck="Twilight Torque",ear1="Brutal Earring",ear2="Suppanomimi",
body="Espial Gambison",hands="Espial Bracers",ring1="Rajas Ring",ring2="Keen Ring",
back="Atheling Mantle",waist="Headlong Belt",legs="Espial Hose",feet="Espial Socks"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job- versions of event handlers, allowing overriding default handling.
-------------------------------------------------------------------------------------------------------------------
-- 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 and not state.Buff['Pianissimo'] then
send_command('@input /ja "Pianissimo" <me>; wait 1.5; input /ma "'..spell.name..'" '..spell.target.name)
eventArgs.cancel = true
return
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
-- Default base equipment layer of fast recast.
equip(sets.midcast.FastRecast)
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.DaurdablaMode == 'Daurdabla' then
equip(sets.midcast.Daurdabla)
elseif state.DaurdablaMode == 'None' and spell.target.type == 'SELF' and state.AutoDaurdabla and daur_song_gap() then
equip(sets.midcast.Daurdabla)
end
state.DaurdablaMode = 'None'
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 not spell.interrupted then
if state.Buff[spell.name] ~= nil then
state.Buff[spell.name] = true
end
if spell.type == 'BardSong' then
if spell.target then
if spell.target.type and spell.target.type:upper() == 'SELF' then
adjust_Timers(spell, action, spellMap)
end
end
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- Hooks for other events that aren't handled by the include file.
-------------------------------------------------------------------------------------------------------------------
function job_buff_change(buff, gain)
if state.Buff[buff] ~= nil then
state.Buff[buff] = gain
end
end
-------------------------------------------------------------------------------------------------------------------
-- Hooks for Daurdabla mode handling.
-------------------------------------------------------------------------------------------------------------------
-- Request job-specific mode tables.
-- Return true on the third returned value to indicate an error: that we didn't recognize the requested field.
function job_get_option_modes(field)
if field == 'Daurdabla' then
if player.inventory[info.DaurdablaInstrument] or player.wardrobe[info.DaurdablaInstrument] then
return options.DaurdablaModes, state.DaurdablaMode
else
add_to_chat(123, info.DaurdablaInstrument..' is not in player inventory.')
end
end
end
-- Set job-specific mode values.
-- Return true if we recognize and set the requested field.
function job_set_option_mode(field, val)
if field == 'Daurdabla' then
state.DaurdablaMode = val
return true
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements self-commands.
-------------------------------------------------------------------------------------------------------------------
-- Called by the 'update' self-command.
function job_update(cmdParams, eventArgs)
pick_tp_weapon()
end
-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
if stateField == 'OffenseMode' then
if newValue == 'Normal' then
disable('main','sub')
else
enable('main','sub')
end
elseif stateField == 'Reset' then
if state.OffenseMode == 'None' then
enable('main','sub')
end
end
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 defenseString = ''
if state.Defense.Active then
local defMode = state.Defense.PhysicalMode
if state.Defense.Type == 'Magical' then
defMode = state.Defense.MagicalMode
end
defenseString = 'Defense: '..state.Defense.Type..' '..defMode..', '
end
local meleeString = ''
if state.OffenseMode == 'Normal' then
if state.CombatForm then
meleeString = 'Melee: Dual-wield, '
else
meleeString = 'Melee: Single-wield, '
end
end
add_to_chat(122,'Casting ['..state.CastingMode..'], '..meleeString..'Idle ['..state.IdleMode..'], '..defenseString..
'Kiting: '..on_off_names[state.Kiting])
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 == 'Resistant' then
return 'ResistantSongDebuff'
else
return 'SongDebuff'
end
elseif state.DaurdablaMode == '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, action, spellMap)
local t = os.time()
-- Eliminate songs that have already expired from our local list.
local tempreg = {}
for i,v in pairs(timer_reg) do
if v < t then tempreg = true end
end
for i,v in pairs(tempreg) do
timer_reg = nil
end
local dur = calculate_duration(spell.name, spellMap)
if timer_reg[spell.name] then
-- Can delete timers that have less than 120 seconds remaining, since
-- the new version of the song will overwrite the old one.
-- Otherwise create a new timer counting down til we can overwrite.
--if (timer_reg[spell.name] - t) <= 120 then
send_command('timers delete "'..spell.name..'"')
timer_reg[spell.name] = t + 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.DaurdablaInstrument then
maxsongs = maxsongs + info.DaurdablaSongs
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(timer_reg) then
maxsongs = table.length(timer_reg)
end
-- Create or update new song timers.
if table.length(timer_reg) < maxsongs then
timer_reg[spell.name] = t+dur
send_command('timers create "'..spell.name..'" '..dur..' down')
else
local rep,repsong
for i,v in pairs(timer_reg) do
if t+dur > v then
if not rep or rep > v then
rep = v
repsong = i
end
end
end
if repsong then
timer_reg[repsong] = nil
send_command('timers delete "'..repsong..'"')
timer_reg[spell.name] = t+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.3 end -- change to 0.25 with 90 Daur
if player.equipment.range == "Gjallarhorn" then mult = mult + 0.4 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.1 end
if player.equipment.neck == "Aoidos' Matinee" then mult = mult + 0.1 end
if player.equipment.body == "Aoidos' Hngrln. +2" 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" then mult = mult + 0.1 end
if player.equipment.feet == "Brioso Slippers +1" then mult = mult + 0.11 end
if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet" then mult = mult + 0.1 end
if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet +1" then mult = mult + 0.1 end
if spellMap == 'Madrigal' and player.equipment.head == "Aoidos' Calot +2" then mult = mult + 0.1 end
if spellMap == 'Minuet' and player.equipment.body == "Aoidos' Hngrln. +2" then mult = mult + 0.1 end
if spellMap == 'March' and player.equipment.hands == 'Ad. Mnchtte. +2' then mult = mult + 0.1 end
if spellMap == 'Ballad' and player.equipment.legs == "Aoidos' Rhing. +2" then mult = mult + 0.1 end
if spellName == "Sentinel's Scherzo" and player.equipment.feet == "Aoidos' Cothrn. +2" 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
-- Tweak for inaccuracies in cast vs aftercast timing
mult = mult - 0.05
local totalDuration = mult*120
return totalDuration
end
function daur_song_gap()
if player.inventory[info.DaurdablaInstrument] or player.wardrobe[info.DaurdablaInstrument] then
-- Figure out how many songs we can maintain.
local maxsongs = 2 + info.DaurdablaSongs
local activesongs = table.length(timer_reg)
-- If we already have at least 2 songs on, but not enough to max out
-- on possible Daur songs, flag us as Daur-ready.
if activesongs >= 2 and activesongs < maxsongs then
return true
end
end
return false
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 = 'Dagger'
if S{'NIN','DNC'}:contains(player.sub_job) and brd_daggers:contains(player.equipment.sub) then
state.CombatForm = "DualWield"
else
state.CombatForm = nil
end
else
state.CombatWeapon = nil
state.CombatForm = nil
end
end
By fractalvoid 2014-07-10 19:25:10
nevermind
Necro Bump Detected!
[232 days between previous and next post]
Serveur: Fenrir
Game: FFXI
Posts: 183
By Fenrir.Brimstonefox 2015-02-27 21:45:03
For anyone using Mote's lua, I was having the same problem and it looked it was always equiping my other instruments during midcast.
I just added this it disables gear swapping midcast for the times when extrsong mode is not none. just search for job_midcast and add it at the top of the function.
Code
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
function job_midcast(spell, action, spellMap, eventArgs)
-- add_to_chat(121,'midcast ')
if state.ExtraSongsMode.value ~= 'None' then
-- add_to_chat(120,'NOQUIP '..state.ExtraSongsMode.value)
eventArgs.handled = true
end
Anyone have a decent working lua for Terpander?
Using Motenten's but songs are acting funky (I bet its something in the lua) even with specific song gearsets to remove the song duration+. Using Hymnus/Fantasia for dummy song. (Ghorn in progress)
I have +3 instruments for majority of songs. Ballad=+1 (Cithara&AF3 Legs), Scherzo=+1 (AF3 Feet), March=+4 (Langeleik&AF3 Hands), Minuet+4 (Apollo's&AF3 Body), Madrigal=+4 (Cantabank's&AF3 Head).
Code -------------------------------------------------------------------------------------------------------------------
-- Initialization function that defines sets and variables to be used.
-------------------------------------------------------------------------------------------------------------------
-- IMPORTANT: Make sure to also get the Mote-Include.lua file (and its supplementary files) to go with this.
--[[
Custom commands:
Terpander has a set of modes: None, Dummy, Terpander
You can set these via the standard 'set' and 'cycle' self-commands. EG:
gs c cycle Terpander
gs c set Terpander Dummy
The Dummy state will equip the Terpander and ensure non-duration gear is equipped.
The Terpander state will simply equip the Terpander on top of standard gear.
Use the Dummy version to put up dummy songs that can be overwritten by full-potency songs.
Use the Terpander version to simply put up additional songs without worrying about dummy songs.
Simple macro to cast a dummy Terpander song:
/console gs c set Terpander Dummy
/ma "Shining Fantasia" <me>
There is also an auto-handling of Terpander songs, via the state.AutoTerpander flag:
If state.TerpanderMode is None, and if currently tracked songs (via timers) is less
than the max we could sing while using the Terpander, and if the song is cast on
self (rather than Pianissimo on another player), then it will equip the Terpander on
top of standard duration gear.
--]]
-- Initialization function for this job file.
function get_sets()
-- Load and initialize the include file.
include('Mote-Include.lua')
end
-- Setup vars that are user-independent.
function job_setup()
state.Buff['Pianissimo'] = buffactive['pianissimo'] or false
options.TerpanderModes = {'None','Dummy','Terpander'}
state.TerpanderMode = 'Dummy'
-- For tracking current recast timers via the Timers plugin.
timer_reg = {}
end
-- Setup vars that are user-dependent. Can override this function in a sidecar file.
function user_setup()
-- Options: Override default values
options.CastingModes = {'Normal', 'Resistant'}
options.OffenseModes = {'None', 'Normal'}
options.DefenseModes = {'Normal'}
options.WeaponskillModes = {'Normal'}
options.IdleModes = {'Normal', 'PDT'}
options.RestingModes = {'Normal'}
options.PhysicalDefenseModes = {'PDT'}
options.MagicalDefenseModes = {'MDT'}
state.Defense.PhysicalMode = 'PDT'
state.OffenseMode = 'None'
brd_daggers = S{'Izhiikoh', 'Vanir Knife', 'Atoyac', 'Aphotic Kukri'}
pick_tp_weapon()
-- Adjust this is using Terpander (new +song instrument)
info.TerpanderInstrument = 'Terpander'
-- How many extra songs we can keep from Terpander
info.TerpanderSongs = 1
-- Whether to try to automatically use Terpander when an appropriate gap in current vs potential
-- songs appears, and you haven't specifically changed state.TerpanderMode.
state.AutoTerpander = true
-- Additional local binds
send_command('bind ^` input /ma "Chocobo Mazurka" <me>')
-- Default macro set/book
set_macro_page(1, 7)
end
-- Called when this job file is unloaded (eg: job change)
function file_unload()
if binds_on_unload then
binds_on_unload()
end
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.FC = {head="Nahtirah Hat",ear2="Loquacious Earring",
ring1="Prolix Ring",back="Swith Cape",waist="Witful Belt",legs="Orvail Pants +1"}
sets.precast.FC.Cure = set_combine(sets.precast.FC, {body="Heka's Kalasiris"})
sets.precast.FC.EnhancingMagic = set_combine(sets.precast.FC, {waist="Siegel Sash"})
sets.precast.FC.BardSong = {main="Felibre's Dague",
head="Aoidos' Calot +2",neck="Aoidos' Matinee",ear1="Aoidos' Earring",ear2="Loquacious Earring",
body="Sha'ir Manteel",hands="Schellenband",ring1="Prolix Ring",
back="Swith Cape",waist="Witful Belt",legs="Gendewitha Spats",feet="Bokwus Boots"}
sets.precast.FC.Terpander = {main="Felibre's Dague", range="Terpander",
head="Nahtirah Hat",neck="Jeweled Collar",ear1="Aoidos' Earring",ear2="Loquacious Earring",
body="Sha'ir Manteel",hands="Schellenband",ring1="Prolix Ring",
back="Swith Cape",waist="Witful Belt",legs="Gendewitha Spats",feet="Bokwus Boots"}
-- Precast sets to enhance JAs
--sets.precast.JA.Nightingale = {feet="Bard's Slippers +2"}
--sets.precast.JA.Troubadour = {body="Bard's Justaucorps +2"}
--sets.precast.JA['Soul Voice'] = {legs="Bard's 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 = {head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Bard's Justaucorps +2",hands="Buremte Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Atheling Mantle",waist="Caudata Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS['Evisceration'] = {
head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Bard's Justaucorps +2",hands="Buremte Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Atheling Mantle",waist="Caudata Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
sets.precast.WS['Exenterator'] = {
head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Bard's Justaucorps +2",hands="Buremte Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Atheling Mantle",waist="Caudata Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
sets.precast.WS['Mordant Rime'] = {
head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Bard's Justaucorps +2",hands="Buremte Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Atheling Mantle",waist="Caudata Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
-- Midcast Sets
-- General set for recast times.
sets.midcast.FastRecast = {head="Nahtirah Hat",ear2="Loquacious Earring",
body="Anhur Robe",hands="Magavan Mitts",ring1="Prolix Ring",
back="Swith Cape",waist="Witful Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
-- Gear to enhance certain classes of songs. No instruments added here since Gjallarhorn is being used.
sets.midcast.Ballad = {range="Crooner's Cithara",legs="Aoidos' Rhing. +2"}
sets.midcast.Lullaby = {range="Pan's Horn",hands="Brioso Cuffs"}
sets.midcast.Madrigal = {range="Cantabank's Horn",head="Aoidos' Calot +2"}
sets.midcast.March = {range="Langeleik",hands="Aoidos' Manchettes +2"}
sets.midcast.Minuet = {range="Apollo's Flute",body="Aoidos' Hongreline +2"}
sets.midcast.Etude = {range="Langeleik"}
sets.midcast.Carol = {head="Aoidos' Calot +2",body="Aoidos' Hongreline +2",hands="Aoidos' Manchettes +2",legs="Aoidos' Rhing. +2",feet="Aoidos' Cothrn. +2"}
sets.midcast.Elegy = {range="Syrinx"}
sets.midcast.Minne = {range="Syrinx"}
sets.midcast.Prelude = {range="Cantabank's Horn"}
sets.midcast.Mambo = {range="Vihuela"}
sets.midcast.Mazurka = {range="Vihuela"}
sets.midcast.Requiem = {range="Hamelin Flute"}
sets.midcast.Threnody = {range="Piccolo +1"}
sets.midcast.Hymnus = {main="Felibre's Dague", range="Terpander",
head="Nahtirah Hat",neck="Jeweled Collar",ear1="Aoidos' Earring",ear2="Loquacious Earring",
body="Sha'ir Manteel",hands="Schellenband",ring1="Prolix Ring",
back="Swith Cape",waist="Witful Belt",legs="Gendewitha Spats",feet="Bokwus Boots"}
sets.midcast.Fantasia = {main="Felibre's Dague", range="Terpander",
head="Nahtirah Hat",neck="Jeweled Collar",ear1="Aoidos' Earring",ear2="Loquacious Earring",
body="Sha'ir Manteel",hands="Schellenband",ring1="Prolix Ring",
back="Swith Cape",waist="Witful Belt",legs="Gendewitha Spats",feet="Bokwus Boots"}
sets.midcast["Sentinel's Scherzo"] = {feet="Aoidos' Cothrn. +2"}
sets.midcast['Magic Finale'] = {range="Pan's Horn",neck="Wind Torque",legs="Aoidos' Rhing. +2"}
-- For song buffs (duration and AF3 set bonus)
sets.midcast.SongEffect = {main="Legato Dagger",
head="Aoidos' Calot +2",neck="Aoidos' Matinee",ear2="Loquacious Earring",
body="Aoidos' Hongreline +2",hands="Aoidos' Manchettes +2",ring1="Prolix Ring",
legs="Aoidos' Rhing. +2",feet="Brioso Slippers"}
-- For song defbuffs (duration primary, accuracy secondary)
sets.midcast.SongDebuff = {main="Soothsayer Staff",sub="Mephitis Grip",
head="Nahtirah Hat",neck="Wind Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Aoidos' Hongreline +2",hands="Gendewitha Gages",ring1="Perception Ring",ring2="Sangoma Ring",
back="Balladeer's Cape",waist="Demonry Sash",legs="Gendewitha Spats",feet="Brioso Slippers"}
-- For song defbuffs (accuracy primary, duration secondary)
sets.midcast.ResistantSongDebuff = {main="Soothsayer Staff",sub="Mephitis Grip",
head="Nahtirah Hat",neck="Wind Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
body="Aoidos' Hongreline +2",hands="Gendewitha Gages",ring1="Perception Ring",ring2="Sangoma Ring",
back="Balladeer's Cape",waist="Demonry Sash",legs="Gendewitha Spats",feet="Brioso Slippers"}
-- Song-specific recast reduction
sets.midcast.SongRecast = {ear2="Loquacious Earring",
ring1="Prolix Ring",back="Harmony Cape",waist="Corvax Sash",legs="Aoidos' Rhinghrave +2"}
sets.midcast.Terpander = {main="Felibre's Dague", range="Terpander",
head="Nahtirah Hat",neck="Jeweled Collar",ear1="Aoidos' Earring",ear2="Loquacious Earring",
body="Sha'ir Manteel",hands="Schellenband",ring1="Prolix Ring",
back="Swith Cape",waist="Witful Belt",legs="Gendewitha Spats",feet="Bokwus Boots"}
-- Cast spell with normal gear, except using Terpander instead
sets.midcast.Terpander = {range="Terpander"}
-- Dummy song with Terpander; minimize duration to make it easy to overwrite.
sets.midcast.TerpanderDummy = {range="Terpander"}
--head="Nahtirah Hat",neck="Wind Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
--body="Brioso Justaucorps",hands="Aoidos' Manchettes +2",ring1="Prolix Ring",ring2="Sangoma Ring",
--back="Swith Cape",waist="Goading Belt",legs="Gendewitha Spats",feet="Bokwus Boots"
-- Other general spells and classes.
sets.midcast.Cure = {main="Arka IV",neck="Phalaina Locket",
head="Gendewitha Caubeen",body="Heka's Kalasiris",feet="Gendewitha Galoshes"}
sets.midcast.Stoneskin = {head="Nahtirah Hat",neck="Stone Gorget",
body="Anhur Robe",waist="Siegel Sash",legs="Haven Hose",feet="Gendewitha Galoshes"}
sets.midcast.Cursna = {feet="Gendewitha Galoshes"}
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {}
-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
sets.idle = {main="Legato Dagger",sub="Genbu's Shield",range="Terpander",head="Nahtirah Hat",
neck="Twilight Torque",ear1="Musical Earring",ear2="Aoidos' Earring",body="Heka's Kalasiris",
hands="Serpentes Cuffs",ring1="Dark Ring",ring2="Dark Ring",back="Shadow Mantle",
waist="Witful Belt",legs="Aoidos' Rhingrave +2",feet="Aoidos' Cothurnes +2"}
sets.idle.Town = {main="Legato Dagger",sub="Genbu's Shield",range="Terpander",head="Nahtirah Hat",
neck="Twilight Torque",ear1="Musical Earring",ear2="Aoidos' Earring",body="Heka's Kalasiris",
hands="Serpentes Cuffs",ring1="Dark Ring",ring2="Dark Ring",back="Shadow Mantle",
waist="Witful Belt",legs="Aoidos' Rhingrave +2",feet="Aoidos' Cothurnes +2"}
sets.idle.Weak = {main="Legato Dagger",sub="Genbu's Shield",range="Terpander",head="Nahtirah Hat",
neck="Twilight Torque",ear1="Musical Earring",ear2="Aoidos' Earring",body="Heka's Kalasiris",
hands="Serpentes Cuffs",ring1="Dark Ring",ring2="Dark Ring",back="Shadow Mantle",
waist="Witful Belt",legs="Aoidos' Rhingrave +2",feet="Aoidos' Cothurnes +2"}
-- Defense sets
sets.defense.PDT = {main=gear.Staff.PDT,sub="Quire Grip",
head="Gendewitha Caubeen",neck="Twilight Torque",
body="Gendewitha Bliaut",hands="Gendewitha Gages",ring1="Dark Ring",
back="Umbra Cape",waist="Flume Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
sets.defense.MDT = {main=gear.Staff.PDT,sub="Quire Grip",
head="Nahtirah Hat",neck="Twilight Torque",
body="Gendewitha Bliaut",hands="Gendewitha Gages",ring1="Merman's Ring",ring2="Merman's Ring",
back="Engulfer Cape",waist="Flume Belt",legs="Bokwus Slops",feet="Gendewitha Galoshes"}
sets.Kiting = {feet="Aoidos' Cothurnes +2"}
-- 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
-- Basic set for if no TP weapon is defined.
sets.engaged = {main="Izhiikoh",head="Espial Cap",neck="Asperity Necklace",
ear1="Bladeborn Earring",ear2="Steelflash Earring",body="Espial Gambison",
hands="Buremte Gloves",ring1="Tyrant's Ring",ring2="Rajas Ring",back="Atheling Mantle",
waist="Dynamic Belt",legs="Espial Hose",feet="Espial Socks"}
-- Sets with weapons defined.
sets.engaged.Dagger = {main="Izhiikoh",head="Espial Cap",neck="Asperity Necklace",
ear1="Bladeborn Earring",ear2="Steelflash Earring",body="Espial Gambison",
hands="Buremte Gloves",ring1="Tyrant's Ring",ring2="Rajas Ring",back="Atheling Mantle",
waist="Dynamic Belt",legs="Espial Hose",feet="Espial Socks"}
-- Set if dual-wielding
sets.engaged.DualWield = {main="Izhiikoh",sub="Eminent Dagger",head="Espial Cap",neck="Asperity Necklace",
ear1="Bladeborn Earring",ear2="Steelflash Earring",body="Espial Gambison",
hands="Buremte Gloves",ring1="Tyrant's Ring",ring2="Rajas Ring",back="Atheling Mantle",
waist="Dynamic Belt",legs="Espial Hose",feet="Espial Socks"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job- versions of event handlers, allowing overriding default handling.
-------------------------------------------------------------------------------------------------------------------
-- 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 and not state.Buff['Pianissimo'] then
cancel_spell()
send_command('@input /ja "Pianissimo" <me>; wait 1.25; input /ma "'..spell.name..'" '..spell.target.name)
eventArgs.cancel = true
return
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
-- Default base equipment layer of fast recast.
equip(sets.midcast.FastRecast)
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.TerpanderMode == 'Terpander' then
equip(sets.midcast.Terpander)
elseif state.TerpanderMode == 'None' and spell.target.type == 'SELF' and state.AutoTerpander and daur_song_gap() then
equip(sets.midcast.Terpander)
end
state.TerpanderMode = 'None'
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 not spell.interrupted then
if state.Buff[spell.name] ~= nil then
state.Buff[spell.name] = true
end
if spell.type == 'BardSong' then
if spell.target then
if spell.target.type and spell.target.type:upper() == 'SELF' then
adjust_Timers(spell, action, spellMap)
end
end
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- Hooks for other events that aren't handled by the include file.
-------------------------------------------------------------------------------------------------------------------
function job_buff_change(buff, gain)
if state.Buff[buff] ~= nil then
state.Buff[buff] = gain
end
end
-------------------------------------------------------------------------------------------------------------------
-- Hooks for Terpander mode handling.
-------------------------------------------------------------------------------------------------------------------
-- Request job-specific mode tables.
-- Return true on the third returned value to indicate an error: that we didn't recognize the requested field.
function job_get_mode_list(field)
if field == 'Terpander' and player.inventory.Terpander then
return options.TerpanderModes, state.TerpanderMode
end
end
-- Set job-specific mode values.
-- Return true if we recognize and set the requested field.
function job_set_mode(field, val)
if field == 'Terpander' then
state.TerpanderMode = val
return true
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements self-commands.
-------------------------------------------------------------------------------------------------------------------
-- Called by the 'update' self-command.
function job_update(cmdParams, eventArgs)
pick_tp_weapon()
end
-- Handle notifications of general user state change.
function job_state_change(stateField, newValue)
if stateField == 'OffenseMode' then
if newValue == 'Normal' then
disable('main','sub')
else
enable('main','sub')
end
elseif stateField == 'Reset' then
if state.OffenseMode == 'None' then
enable('main','sub')
end
end
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 defenseString = ''
if state.Defense.Active then
local defMode = state.Defense.PhysicalMode
if state.Defense.Type == 'Magical' then
defMode = state.Defense.MagicalMode
end
defenseString = 'Defense: '..state.Defense.Type..' '..defMode..', '
end
local meleeString = ''
if state.OffenseMode == 'Normal' then
if state.CombatForm then
meleeString = 'Melee: Dual-wield, '
else
meleeString = 'Melee: Single-wield, '
end
end
add_to_chat(122,'Casting ['..state.CastingMode..'], '..meleeString..'Idle ['..state.IdleMode..'], '..defenseString..
'Kiting: '..on_off_names[state.Kiting])
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)
if spell.targets:contains('Enemy') then
if state.CastingMode == 'Resistant' then
return 'ResistantSongDebuff'
else
return 'SongDebuff'
end
elseif state.TerpanderMode == 'Dummy' then
return 'TerpanderDummy'
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, action, spellMap)
local t = os.time()
-- Eliminate songs that have already expired from our local list.
local tempreg = {}
for i,v in pairs(timer_reg) do
if v < t then tempreg[i] = true end
end
for i,v in pairs(tempreg) do
timer_reg[i] = nil
end
local dur = calculate_duration(spell.name, spellMap)
if timer_reg[spell.name] then
-- Can delete timers that have less than 120 seconds remaining, since
-- the new version of the song will overwrite the old one.
-- Otherwise create a new timer counting down til we can overwrite.
if (timer_reg[spell.name] - t) <= 120 then
send_command('timers delete "'..spell.name..'"')
timer_reg[spell.name] = t + 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 == 'Terpander' then
maxsongs = maxsongs + info.TerpanderSongs
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(timer_reg) then
maxsongs = table.length(timer_reg)
end
-- Create or update new song timers.
if table.length(timer_reg) < maxsongs then
timer_reg[spell.name] = t+dur
send_command('timers create "'..spell.name..'" '..dur..' down')
else
local rep,repsong
for i,v in pairs(timer_reg) do
if t+dur > v then
if not rep or rep > v then
rep = v
repsong = i
end
end
end
if repsong then
timer_reg[repsong] = nil
send_command('timers delete "'..repsong..'"')
timer_reg[spell.name] = t+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 == 'Terpander' then mult = mult + 0.3 end -- change to 0.25 with 90 Daur
if player.equipment.range == "Gjallarhorn" then mult = mult + 0.4 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.1 end
if player.equipment.neck == "Aoidos' Matinee" then mult = mult + 0.1 end
if player.equipment.body == "Aoidos' Hngrln. +2" 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" then mult = mult + 0.1 end
if player.equipment.feet == "Brioso Slippers +1" then mult = mult + 0.11 end
if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet" then mult = mult + 0.1 end
if spellMap == 'Paeon' and player.equipment.head == "Brioso Roundlet +1" then mult = mult + 0.1 end
if spellMap == 'Madrigal' and player.equipment.head == "Aoidos' Calot +2" then mult = mult + 0.1 end
if spellMap == 'Minuet' and player.equipment.body == "Aoidos' Hngrln. +2" then mult = mult + 0.1 end
if spellMap == 'March' and player.equipment.hands == 'Ad. Mnchtte. +2' then mult = mult + 0.1 end
if spellMap == 'Ballad' and player.equipment.legs == "Aoidos' Rhing. +2" then mult = mult + 0.1 end
if spellName == "Sentinel's Scherzo" and player.equipment.feet == "Aoidos' Cothrn. +2" 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
-- Tweak for inaccuracies in cast vs aftercast timing
mult = mult - 0.05
local totalDuration = mult*120
return totalDuration
end
function daur_song_gap()
if player.inventory.Terpander then
-- Figure out how many songs we can maintain.
local maxsongs = 2 + info.TerpanderSongs
local activesongs = table.length(timer_reg)
-- If we already have at least 2 songs on, but not enough to max out
-- on possible Daur songs, flag us as Daur-ready.
if activesongs >= 2 and activesongs < maxsongs then
return true
end
end
return false
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 = 'Dagger'
if S{'NIN','DNC'}:contains(player.sub_job) and brd_daggers:contains(player.equipment.sub) then
state.CombatForm = "DualWield"
else
state.CombatForm = nil
end
else
state.CombatWeapon = nil
state.CombatForm = nil
end
end
|
|