Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------------------------------------------------------------------------
- -- 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.
- -- Initialization function for this job file.
- function get_sets()
- -- Load and initialize the include file.
- include('Mote-Include.lua')
- include('Mote-Include.lua')
- end
- -- Called when this job file is unloaded (eg: job change)
- function file_unload()
- if binds_on_unload then
- binds_on_unload()
- end
- windower.send_command('unbind ^`')
- end
- -- Define sets and vars used by this job file.
- function init_gear_sets()
- -- Default macro set/book
- set_macro_page(1, 4)
- timerIcon_Mode = true
- -- Additional local binds
- windower.send_command('bind ^` input /ma "Chocobo Mazurka" <me>')
- windower.send_command('bind ^d` gs c song3')
- windower.send_command('bind ^q input /ja "Nightingale" <me>')
- windower.send_command('bind ^g input /ja "Pianissimo" <me>')
- windower.send_command('bind !q input /ja "Magic Finale" <t>')
- windower.send_command('bind !g input /ja "Clarion Call" <me>')
- -- Options: Override default values
- options.CastingModes = {'Normal', 'Resistant'}
- options.OffenseModes = {'Normal','Melee'}
- 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'
- state.Buff['Pianissimo'] = buffactive['pianissimo'] or false
- -- For tracking current recast timers via the Timers plugin.
- timer_reg = {}
- player_reg = {}
- -- Some vars. Define at the top so that the sets can make use of them.
- DaurdSongs = S{'Water Carol','Water Carol II','Ice Carol','Ice Carol II','Herb Pastoral','Goblin Gavotte','Army\'s Paeon'}
- --------------------------------------
- -- Start defining the sets
- --------------------------------------
- -- Precast Sets
- -- Fast cast sets for spells
- sets.precast.FC = {head="Nahtirah Hat",ear2="Loquac. Earring", neck = "Jeweled collar",
- hands="Gendewitha Gages",ring1="Prolix Ring", body="Anhur Robe",
- back="Swith Cape",waist="Witful Belt",legs="Orvail pants +1",feet="Bokwus Boots"}
- sets.precast.FC.Cure = set_combine(sets.precast.FC, {body="Heka's Kalasiris",back="Pahtli Cape",legs="Nabu's Shalwar"})
- sets.precast.FC.EnhancingMagic = set_combine(sets.precast.FC, {waist="Siegel Sash"})
- sets.precast.FC.BardSong = {main="Felibre's Dague", sub="Genbu's Shield",
- head="Aoidos' Calot +2",neck="Aoidos' Matinee",ear1="Aoidos' Earring",ear2="Loquac. Earring",
- body="Marduk's Jubbah +1",hands="Gendewitha Gages",ring1="Prolix Ring",
- back="Swith Cape",waist="Aoidos' Belt",legs="Gendewitha Spats",feet="Bihu Slippers"}
- sets.precast.FC.Daurdabla = set_combine(sets.precast.FC.BardSong, {range="Terpander"})
- -- 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 +11"}
- -- Waltz set (chr and vit)
- sets.precast.Waltz = {range="Gjallarhorn",
- head="Nahtirah Hat",
- body="Gendewitha Bliaut",hands="Buremte Gloves",
- back="Refraction Cape",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
- -- Weaponskill sets
- -- Default set for any weaponskill that isn't any more specifically defined
- sets.precast.WS = {range="Gjallarhorn",
- 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'] = {range="Gjallarhorn",
- 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 = {range="Angel Lyre",
- head="Gendewitha caubeen",ear2="Loquacious Earring",
- body="Anhur Robe",hands="Gendewitha Gages",ring1="Prolix Ring",
- back="Swith Cape",waist="Corvax Sash",legs="Aoidos' rhingrave +2",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.Madrigal = {head="Aoidos' Calot +2"}
- sets.midcast.Mazurka = {range = "Gjallarhorn"}
- sets.midcast.March = {hands="Aoidos' Manchettes +2"}
- sets.midcast.Minuet = {body="Aoidos' Hongreline +2"}
- 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",waist="Corvax Sash",legs="Aoidos' Rhing. +2"}
- sets.midcast.song3 = {main= "Felibre's Dague", range="Terpander",
- head="Aoidos' Calot +2",neck="Aoidos' Matinee",ear2="Loquacious Earring",
- body="Marduk's Jubbah +1",hands="Gendewitha Gages",ring1="Prolix Ring",
- back="Swith Cape",waist="Aoidos' Belt",legs="Gendewitha Spats",feet="Bihu Slippers"}
- -- 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",
- back="Harmony Cape",waist="Corvax Sash",legs="Mdk. Shalwar +1",feet="Brioso Slippers +1"}
- -- For song debuffs
- sets.midcast.SongDebuff = {main="Venabulum", sub="Mephitis Grip",
- head="Bihu Roundlet +1",neck="Wind Torque",ear1="Gwati Earring",ear2="Musical Earring",
- body="Brioso Just. +1",hands="Lurid Mitts",ring1="Omega ring",ring2="Sangoma Ring",
- back="Kumbira Cape",waist="Demonry Sash",legs="Bihu Cannions +1",feet="Artsieq Boots"}
- sets.midcast.Lullaby =set_combine(sets.midcast.SongDebuff, { range = "Gjallarhorn", hands="Brioso Cuffs"})
- -- Song-specific recast reduction
- sets.midcast.SongRecast = {ear2="Loquacious Earring",
- ring1="Prolix Ring",
- back="Harmony Cape",waist="Corvax Sash",legs="Aoidos' Rhing. +2"}
- sets.midcast['Magic Finale'] = sets.midcast.SongDebuff
- sets.midcast.Daurdabla = set_combine(sets.midcast.FastRecast, sets.midcast.SongRecast, {range="Terpander"})
- -- Other general spells and classes.
- sets.midcast.Cure = {main="Arka IV",
- head="Gendewitha Caubeen",neck="Colossus's Torque",
- body="Heka's Kalasiris",hands="Bokwus Gloves",ring1="Haoma's Ring",ring2="Sirona's Ring",
- legs="Gendewitha Spats",feet="Brioso Slippers +1"}
- sets.midcast.Stoneskin = {
- head="Nahtirah Hat",
- body="Gendewitha Bliaut",hands="Gendewitha Gages",
- legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
- sets.midcast.Cursna = {
- neck="Malison Medallion",
- hands="Hieros Mittens",ring1="Ephedra Ring",ring2="Haoma's Ring"}
- -- Sets to return to when not performing an action.
- -- Resting sets
- sets.resting = {main=gear.Staff.HMP,
- body="Gendewitha Bliaut",
- legs="Nares Trews",feet="Chelona Boots +1"}
- -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
- sets.idle = {main="Terra's Staff", range="Gjallarhorn",
- head="Wivre Hairpin",neck="Twilight Torque",ear1="Musical Earring",ear2="Moonshade Earring",
- body="Artsieq Jubbah",hands="Serpentes Cuffs",ring1="Dark Ring",ring2="Dark Ring",
- back="Kumbira Cape",waist="Fucho-no-obi",legs="Nares Trews",feet="Aoidos' cothurnes +2"}
- sets.idle.Town = {main="Terra's Staff", range="Gjallarhorn",
- head="Wivre Hairpin",neck="Twilight Torque",ear1="Musical Earring",ear2="Moonshade Earring",
- body="Artsieq Jubbah",hands="Serpentes Cuffs",ring1="Dark Ring",ring2="Dark Ring",
- back="Kumbira Cape",waist="Fucho-no-obi",legs="Nares Trews",feet="Aoidos' cothurnes +2"}
- sets.idle.Weak = {main="Terra's Staff", range="Gjallarhorn",
- head="Wivre Hairpin",neck="Twilight Torque",ear1="Musical Earring",ear2="Moonshade Earring",
- body="Artsieq Jubbah",hands="Serpentes Cuffs",ring1="Dark Ring",ring2="Dark Ring",
- back="Kumbira Cape",waist="Fucho-no-obi",legs="Nares Trews",feet="Aoidos' cothurnes +2"}
- -- Defense sets
- sets.defense.PDT = {main="Terra's Staff",sub="Quire Grip",
- head="Gendewitha Caubeen",neck="Twilight Torque",
- body="Artsieq Jubbah",hands="Gendewitha Gages",ring1='Dark Ring',
- back="Iximulew Cape",waist="Flume Belt",legs="Gendewitha Spats",feet="Gendewitha Galoshes"}
- sets.defense.MDT = {main=gear.Staff.PDT,sub="Quire Grip", ammo="Sihirik",
- head="Nahtirah Hat",neck="Twilight Torque",
- body="Gendewitha Bliaut",hands="Gendewitha Gages",ring1='Dark Ring',
- back="Mubvum. 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 = {
- head="Gendewitha Caubeen",neck="Veisa collar",ear1="Aoidos' earring",ear2="Loquacious Earring",
- body="Gendewitha Bliaut",hands="Serpentes Cuffs",ring1="Dark Ring",ring2="Dark Ring",
- back="Swith Cape",waist="Aoidos' Belt",legs="Orvail Pants",feet="Aoidos' cothurnes +2"}
- -- Sets with weapons defined.
- sets.engaged.Melee = { range = "Gjallarhorn",
- head="Espial cap",neck="Asperity Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
- body="Kirin's Osode",hands="Espial Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
- back="Atheling Mantle",waist="Cetl Belt",legs="Espial hose",feet="Espial socks"}
- sets.engaged.DWDagger = {
- head="Nahtirah Hat",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
- body="Kirin's Osode",hands="Espial Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
- back="Atheling Mantle",waist="Cetl 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()
- windower.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
- -- 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') or (spell.target.type and spell.target.type:upper() == 'PLAYER') 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
- -------------------------------------------------------------------------------------------------------------------
- -- User code that supplements self-commands.
- -------------------------------------------------------------------------------------------------------------------
- function job_self_command(cmdParams, eventArgs)
- if cmdParams[1]:lower() == 'song3' then
- sing_song3()
- eventArgs.handled = true
- end
- end
- -- Called by the 'update' self-command.
- function job_update(cmdParams, eventArgs)
- pick_tp_weapon()
- if player.equipment.main == 'Izhiikoh' and state.OffenseMode == 'None' then
- send_command('gs c set OffenseMode Normal')
- end
- 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
- -------------------------------------------------------------------------------------------------------------------
- -- Utility functions specific to this job.
- -------------------------------------------------------------------------------------------------------------------
- -- Determine the custom class to use for the given song.
- function get_song_class(spell)
- if DaurdSongs[spell.english] then
- return 'Terpander'
- elseif spell.target.type == 'MONSTER' then
- return 'SongDebuff'
- else
- return 'SongEffect'
- end
- end
- 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
- del_cmd = 'timers delete "'..spell.name..' ['..spell.target.name..']"'
- -- 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(del_cmd)
- timer_reg[spell.name] = t + dur
- local rep_timer = 'timers c "'..spell.name..' ['..spell.target.name..']" '..dur..' down'
- if timerIcon_Mode then
- rep_timer = rep_timer..' spells/00'..spell.id..'.png'
- end
- send_command(rep_timer)
- --end
- else
- -- Figure out how many songs we can maintain.
- local maxsongs = 2
- if player.equipment.range == 'Terpander' then
- maxsongs = maxsongs+1 -- +2 for 99 Daur
- 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')
- local timer_cmd = 'timers c "'..spell.name..' ['..spell.target.name..']" '..dur..' down'
- if timerIcon_Mode then
- timer_cmd = timer_cmd..' spells/00'..spell.id..'.png'
- end
- send_command( timer_cmd )
- 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.25 end -- change to 0.3 with 95/99 Daur
- if player.equipment.range == "Gjallarhorn" then mult = mult + 0.4 end -- change to 0.4 with 99 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
- -- Examine equipment to determine what our current TP weapon is.
- function pick_tp_weapon()
- if player.equipment.main then
- if string.find(player.equipment.main, 'Staff') then
- TPWeapon = 'Staff'
- elseif player.equipment.sub == empty or string.find(player.equipment.sub, 'Shield') then
- TPWeapon = 'Dagger'
- elseif T{'NIN','DNC'}:contains(player.sub_job) then
- TPWeapon = 'DWDagger'
- else
- TPWeapon = 'Dagger'
- end
- else
- TPWeapon = 'None'
- end
- end
- function sing_song3()
- windower.send_command('input /ma "Army\'s Paeon" <stpc>')
- --windower.send_command('input /ma "Goddess\'s Hymnus" <stpc>')
- end
- function shallowcopy(orig)
- local orig_type = type(orig)
- local copy
- if orig_type == 'table' then
- copy = {}
- for orig_key, orig_value in pairs(orig) do
- copy[orig_key] = orig_value
- end
- else -- number, string, boolean, etc
- copy = orig
- end
- return copy
- end
Advertisement
Add Comment
Please, Sign In to add comment