Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Simple BRD LUA for Daurdabla and Gjallarhorn
- -- Auto Pianissimo
- -- Gearswaps Precast(w/ occ. quick cast gear), Midcast (Empy set / +Duration Set)
- -- Pending: PDT/MDT set, Healing Set
- -- For Daurdabla use a macro /console gs c Daurdabla, it will equip Daurdabla, and lock the instrument for the next song,
- function get_sets()
- timer_reg = {}
- debuff = S{"Carnage Elegy", "Battlefield Elegy", "Foe Requiem IV", "Foe Requiem V", "Foe Requiem VI", "Foe Requiem VII", "Horde Lullaby", "Horde Lullaby II",
- "Magic Finale", "Foe Lullaby II", "Foe Lullaby", "Dark Threnody", "Light Threnody", "Water Threnody", "Ltng. Threnody",
- "Earth Threnody", "Wind Threnody", "Fire Threnody", "Ice Threnody", "Pining Nocture", "Magic Finale", "Maiden's Virelai"}
- dummy = S{"Army's Paeon", "Army's Paeon II", "Army's Paeon III", "Army's Paeon V", "Army's Paeon VI", "Army's Paeon IV"}
- autopianext = 0
- sets.DBuff = {range="Daurdabla"}
- sets.precast = {}
- sets.precast.JA = {}
- sets.precast.JA.Nightingale = {feet="Bihu Slippers"}
- sets.precast.JA.Troubadour = {body="Bard's Justaucorps +2"}
- sets.precast.JA['Soul Voice'] = {legs="Bihu Cannions"}
- -- Precast Sets
- sets.precast.FC = {}
- sets.precast.FC.Song = {
- head="Aoidos' Calot +2",
- body="Marduk's Jubbah +1",
- hands="Gendewitha Gages",
- legs="Gendewitha Spats",
- feet="Bihu Slippers",
- neck="Aoidos' Matinee",
- waist="Witful Belt",
- left_ear="Aoidos' Earring",
- right_ear="Loquac. Earring",
- left_ring="Prolix Ring",
- right_ring="Veneficium Ring",
- back="Ogapepo Cape",
- range=empty,
- ammo="Impatiens",
- main="Felibre's Dague",
- sub=empty,
- }
- sets.Dummy = {
- head="Aoidos' Calot +2",
- body="Marduk's Jubbah +1",
- hands="Gendewitha Gages",
- legs="Gendewitha Spats",
- feet="Bihu Slippers",
- neck="Twilight Torque",
- waist="Witful Belt",
- left_ear="Aoidos' Earring",
- right_ear="Loquac. Earring",
- left_ring="Prolix Ring",
- right_ring="Veneficium Ring",
- back="Ogapepo Cape",
- range=empty,
- ammo="Impatiens",
- main="Felibre's Dague",
- sub=empty,
- }
- sets.precast.FC.Thunder = {main='Apamajas I'}
- sets.precast.FC.Fire = {main='Atar I'}
- -- Midcast Sets
- sets.midcast = {}
- sets.midcast.BuffSet = {
- ammo=empty,
- head="Aoidos' Calot +2",
- body="Aoidos' Hngrln. +2",
- hands="Ad. Mnchtte. +2",
- legs="Aoidos' Rhing. +2",
- feet="Aoidos' Cothrn. +2",
- neck="Aoidos' Matinee",
- waist="Witful Belt",
- range="Gjallarhorn",
- left_ear="Aoidos' Earring",
- right_ear="Loquac. Earring",
- left_ring="Prolix Ring",
- right_ring="Balrahn's Ring",
- back="Swith Cape",
- main="Legato Dagger",
- sub="Genbu's Shield",
- }
- sets.midcast.Sentinel = {
- feet="Aoidos' Cothrn. +2",
- }
- sets.midcast.Ballad = {
- legs="Aoidos' Rhing. +2",
- }
- sets.midcast.BuffDuration = {
- ammo=empty,
- range="Gjallarhorn",
- main="Legato Dagger",
- sub="Genbu's Shield",
- head="Aoidos' Calot +2",
- body="Aoidos' Hngrln. +2",
- hands="Ad. Mnchtte. +2",
- legs="Mdk. Shalwar +1",
- feet="Brioso Slippers +1",
- neck="Aoidos' Matinee",
- waist="Witful Belt",
- left_ear="Aoidos' Earring",
- right_ear="Loquac. Earring",
- left_ring="Prolix Ring",
- right_ring="Balrahn's Ring",
- back="Swith Cape",
- }
- sets.midcast.Debuff = {
- ammo=empty,
- main="Lehbrailg +2",
- range="Gjallarhorn",
- head="Brioso Roundlet +1",
- body="Brioso Just. +1",
- hands="Ad. Mnchtte. +2",
- legs="Brioso Cann. +1",
- feet="Brioso Slippers +1",
- neck="Aoidos' Matinee",
- waist="Witful Belt",
- left_ear="Psystorm Earring",
- right_ear="Lifestorm Earring",
- left_ring="Prolix Ring",
- right_ring="Balrahn's Ring",
- back="Rhapsode's Cape",
- }
- sets.midcast.cure = {
- main="Arka IV",
- sub=empty,
- ammo="Impatiens",
- head="Aoidos' Calot +2",
- body="Heka's Kalasiris",
- hands="Serpentes Cuffs",
- legs="Nares Trews",
- feet="Serpentes Sabots",
- neck="Twilight Torque",
- waist="Witful Belt",
- left_ear="Aoidos' Earring",
- right_ear="Loquac. Earring",
- left_ring="Veneficium Ring",
- right_ring="Prolix Ring",
- back="Ogapepo Cape",
- }
- sets.midcast.Buff = sets.midcast.BuffSet
- --Aftercast Sets
- sets.aftercast={
- main="Legato Dagger",
- sub="Genbu's Shield",
- range="Daurdabla",
- head="Nefer Khat",
- body="Heka's Kalasiris",
- hands="Serpentes Cuffs",
- legs="Nares Trews",
- feet="Serpentes Sabots",
- neck="Twilight Torque",
- waist="Witful Belt",
- left_ear="Aoidos' Earring",
- right_ear="Loquac. Earring",
- left_ring="Dark Ring",
- right_ring="Defending Ring",
- back="Umbra Cape",
- }
- sets.ac={
- range="Daurdabla",
- neck="Twilight Torque",
- left_ring="Dark Ring",
- right_ring="Defending Ring",
- back="Umbra Cape",
- feet="Aoidos' Cothrn. +2",
- head="Aoidos' Calot +2",
- body="Aoidos' Hngrln. +2",
- hands="Ad. Mnchtte. +2",
- legs="Aoidos' Rhing. +2",
- }
- end
- function pretarget(spell)
- if spell.type == 'BardSong' and not debuff:contains(spell.name) then
- if player.target.type == "MONSTER" then
- change_target('<me>')
- return
- end
- if player.target.type == "NPC" then
- change_target('<me>')
- return
- end
- end
- if spell.type == 'BardSong' and spell.target.type and spell.target.type == 'PLAYER' and autopianext == 0 and not spell.target.charmed then
- cancel_spell()
- autopianext = 1
- aptarget = spell.target.name
- apspell = spell.name
- send_command('input /ja "Pianissimo" <me>;')
- return
- end
- end
- function precast(spell,action)
- if spell.type == 'BardSong' then
- equip(sets.precast.FC.Song)
- elseif sets.precast.JA[spell.english] then
- equip(sets.precast.JA[spell.english])
- else
- equip(sets.midcast.cure)
- end
- if sets.precast.FC[tostring(spell.element)] then
- equip(sets.precast.FC[tostring(spell.element)])
- end
- end
- function midcast(spell,action)
- if spell.type == 'BardSong' then
- if debuff:contains(spell.name) then
- equip(sets.midcast.Debuff)
- else
- equip(sets.midcast.Buff)
- end
- end
- if job_post_midcast then
- job_post_midcast(spell, action)
- end
- end
- function job_post_midcast(spell,action)
- if string.find(spell.english,'Ballad')then
- equip(sets.midcast.Ballad)
- elseif spell.name == "Sentinel's Scherzo" then
- equip(sets.midcast.Sentinel)
- end
- if dummy:contains(spell.name) and player.equipment.range == 'Daurdabla' then
- equip(sets.Dummy)
- add_to_chat(100, 'Dummy Song')
- end
- end
- function aftercast(spell,action)
- if player.mpp < 70 then
- enable('range', 'ammo')
- equip(sets.aftercast)
- else
- enable('range', 'ammo')
- equip(sets.ac)
- end
- if spell.interrupted then
- if spell.type == 'BardSong' then
- return
- else
- autopianext = 0
- end
- end
- if autopianext == 1 and spell.type == 'BardSong' then
- add_to_chat(100, spell.type)
- local t = os.time()
- local dur = calculate_duration(apspell)-30
- send_command('timers delete "'..aptarget..'"')
- send_command('timers create "'..aptarget..'" '..dur..' down')
- end
- if spell.type and spell.type == 'BardSong' and spell.target and spell.target.type:upper() == 'SELF' then
- local t = os.time()
- 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)
- if timer_reg[spell.name] then
- send_command('timers delete "'..spell.name..'"')
- timer_reg[spell.name] = t + dur
- send_command('timers create "'..spell.name..'" '..dur..' down')
- else
- local maxsongs = 2
- if player.equipment.range == 'Daurdabla' then
- maxsongs = maxsongs+1 -- 1 if Daurdabla 90/95 2 if Daurdabla 99
- end
- if buffactive['Clarion Call'] then
- maxsongs = maxsongs+1
- end
- if maxsongs < table.length(timer_reg) then
- maxsongs = table.length(timer_reg)
- end
- 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
- end
- function buff_change(status,gain_or_loss)
- if status == "Pianissimo" and autopianext == 1 then
- if gain_or_loss then
- send_command('input /ma "'..apspell..'" '..aptarget..';')
- else
- autopianext = 0
- end
- end
- end
- function self_command(cmd)
- if cmd == 'unlock' then
- enable('main','sub')
- end
- if cmd == 'Daurdabla' then
- equip(sets.DBuff)
- send_command('@wait .5;gs disable range; gs disable ammo')
- add_to_chat(100, 'Daurdabla Next Song!!!!')
- end
- if cmd == 'midcast' then
- if sets.midcast.Buff == sets.midcast.BuffSet then
- sets.midcast.Buff = sets.midcast.BuffDuration
- add_to_chat(100, 'Midcast set to Duration!!!!')
- else
- sets.midcast.Buff = sets.midcast.BuffSet
- add_to_chat(100, 'Midcast set to Empy Set!!!!')
- end
- end
- end
- function calculate_duration(name)
- local mult = 1
- if player.equipment.range == 'Daurdabla' then mult = mult + 0.3 end
- if player.equipment.range == "Gjallarhorn" then mult = mult + 0.4 end
- if player.equipment.neck == "Aoidos' Matinee" then mult = mult + 0.1 end
- if player.equipment.feet == "Brioso Slippers +1" then mult = mult + 0.11 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.main == "Carnwenhan" then mult = mult + 0.5 end
- if player.equipment.main == "Legato Dagger" then mult = mult + 0.05 end
- if string.find(name,'March') and player.equipment.hands == 'Ad. Mnchtte. +2' then mult = mult + 0.1 end
- if string.find(name,'Minuet') and player.equipment.body == "Aoidos' Hngrln. +2" then mult = mult + 0.1 end
- if string.find(name,'Madrigal') and player.equipment.head == "Aoidos' Calot +2" then mult = mult + 0.1 end
- if string.find(name,'Ballad') and player.equipment.legs == "Aoidos' Rhing. +2" then mult = mult + 0.1 end
- if string.find(name,'Scherzo') and player.equipment.feet == "Aoidos' Cothrn. +2" then mult = mult + 0.1 end
- if buffactive.Troubadour then
- mult = mult*2
- end
- if string.find(name,'Scherzo') and buffactive['Soul Voice'] then
- mult = mult*2
- elseif string.find(name,'Scherzo') and buffactive.marcato then
- mult = mult*1.5
- end
- return mult*120
- end
Advertisement
Add Comment
Please, Sign In to add comment