Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function aftercast(spell)
- if not spell.interrupted then
- if spell.type and spell.type == 'BardSong' and spell.target and spell.target.type:upper() == 'SELF' then
- local t = os.time()
- -- Eliminate songs that have already expired
- 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
- 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
- local maxsongs = 2
- if player.equipment.range == 'Daurdabla' then
- maxsongs = maxsongs+2
- 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
- if player.status == 'Engaged' then
- equip(sets.aftercast.Engaged)
- else
- equip(sets.aftercast.Idle)
- end
- end
- function status_change(new,old)
- if new == 'Engaged' then
- equip(sets.aftercast.Engaged)
- elseif T{'Idle','Resting'}:contains(new) then
- equip(sets.aftercast.Idle)
- end
- end
- function equip_song_gear(spell)
- if DaurdSongs:contains(spell.english) then
- equip(sets.midcast.Base,sets.midcast.DBuff)
- else
- if spell.target.type == 'MONSTER' then
- equip(sets.midcast.Base,sets.midcast.Debuff,sets.midcast.GBuff)
- if buffactive.troubadour or buffactive['elemental seal'] then
- equip(sets.midcast.Duration)
- end
- if string.find(spell.english,'Foe Lullaby') then equip (sets.midcast.Lullaby) end
- if string.find(spell.english,'Horde Lullaby') then equip (sets.midcast.Lullaby,sets.midcast.DBuff,sets.midcast.Horde) end
- else
- equip(sets.midcast.Base,sets.midcast.Buff,sets.midcast.GBuff)
- if string.find(spell.english,'Ballad') then equip(sets.midcast.Ballad) end
- if string.find(spell.english,'Scherzo') then equip(sets.midcast.Scherzo) end
- 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 == "Fili Hongreline" then mult = mult + 0.11 end
- if player.equipment.legs == "Mdk. Shalwar +1" then mult = mult + 0.1 end
- if player.equipment.main == "Legato Dagger" then mult = mult + 0.05 end
- if player.equipment.sub == "Legato Dagger" then mult = mult + 0.05 end
- if player.equipment.main == "Carnwenhan" then mult = mult + 0.5 end
- if string.find(name,'March') and player.equipment.hands == "Fili Manchettes" then mult = mult + 0.1 end
- if string.find(name,'Minuet') and player.equipment.body == "Fili Hongreline" then mult = mult + 0.1 end
- if string.find(name,'Madrigal') and player.equipment.head == "Fili Calot +1" then mult = mult + 0.1 end
- if string.find(name,'Ballad') and player.equipment.legs == "Fili Rhingrave" then mult = mult + 0.1 end
- if string.find(name,'Paeon') and player.equipment.head == "Brioso Roundlet +1" then mult = mult + 0.1 end
- if string.find(name,'Scherzo') and player.equipment.feet == "Fili Cothurnes" 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