Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Dancer Waltz Potency Claculator
- DNC = {}
- function DNC.waltz_potency(s)
- local potency = 100
- local tpreduction = 0
- local received_pot = 100
- local waltz_pot = {["Sonia's Plectrum"]=(allied_tags and 10 or 1),["ソニアプレクトラム"]=(allied_tags and 10 or 1),
- ["Dnc. Casaque +1"]=10,["DRカザク+1"]=10,
- ["Dancer's Casaque"]=10,["ダンサーカザク"]=10,
- ["Roundel Earring"]=5,["ラウンデルピアス"]=5,
- ["Etoile Tiara"]=5,["エトワールティアラ"]=5,
- ["Etoile Tiara +1"]=5,["ETティアラ+1"]=5,
- ["Etoile Tiara +2"]=7,["ETティアラ+2"]=7,
- ["Phurba"]=10,["フルバー"]=10,
- ["Valseur's Ring"]=3,["ヴァルスールリング"]=3,
- ["Kheper Bonnet"]=5,["ケペルボンネット"]=5,
- ["Khepri Bonnet"]=8,["ケプリボンネット"]=8,
- ["Toetapper Mantle"]=5,["トータッパーマント"]=5,
- ["Asklepian Ring"]=3,["アスクレピアリング"]=3,
- ["Maxixi Casaque"]=20,["マシシカザク"]=20,
- ["Maxixi Casaque +1"]=21,["MXカザク+1"]=21,
- ["Maxixi Shoes"]=10,["マシシトーシュー"]=10,
- ["Maxixi Shoes +1"]=10,["MXトーシュー+1"]=10,
- ["Blitto Needle"]=3,["ブリットニードル"]=3,
- ["Slither Gloves +1"]=5,["スリザーグローブ+1"]=5,
- ["Horos Tiara"]=9,["ホロスティアラ"]=9,
- ["Horos Tiara +1"]=11,["HOティアラ+1"]=11,
- ["Rhadamanthus"]=7,["ラダマントゥス"]=7,}
- local waltz_received_pot = {["Maxixi Casaque"]=5,["マシシカザク"]=5,
- ["Maxixi Casaque +1"]=6,["MXカザク+1"]=6,
- ["Asklepian Ring"]=3,["アスクレピアリング"]=3,}
- for _,v2 in pairs(s) do
- if type(v2) == "table" then
- potency = potency + (waltz_pot[v2.name] or 0) received_pot = received_pot + (waltz_received_pot[v2.name] or 0)
- for _,v in ipairs(v2.augments) do
- potency = potency + tonumber(v:startswith('"Waltz" potency') and string.match(v, '%d+') or '0')
- tpreduction = tpreduction + tonumber(v:startswith('"Waltz" TP cost') and string.match(v, '%d+') or '0')
- end
- else
- potency = potency + (waltz_pot[v2] or 0) received_pot = received_pot + (waltz_received_pot[v2] or 0)
- end
- end
- if potency > 130 then
- potency = 130
- end
- return s,potency,received_pot,tpreduction
- end
- function DNC.select_waltz(bpotency,received_pot,tpreduction) -- returns the most usable Waltz for use on your player
- local potency = (bpotency + (player.main_job == "DNC" and (player.job_points.dnc.waltz_potency*2) or 0) + Contradance_potency)
- local hp_dif = (player.max_hp - player.hp)
- local abilitys = res.job_abilities
- local base = (Player['VIT'] + Player['VIT+']) + (Player['CHR'] + Player['CHR+'])
- local dnc_type
- local h_waltz
- local h_hp
- if hp_dif == 0 then
- return nil,0
- end
- local waltz = {main_job={[1]=0.250,[2]=0.500,[3]=0.750,[4]=1.000,[5]=1.25,},
- sub_job={[1]=0.125,[2]=0.250,[3]=0.375,},
- default={[1]={c=60,tp=200,lvl=15,id=190},
- [2]={c=130,tp=350,lvl=30,id=191},
- [3]={c=270,tp=500,lvl=45,id=192},
- [4]={c=450,tp=650,lvl=75,id=193},
- [5]={c=600,tp=800,lvl=80,id=311},},}
- if player.main_job == "DNC" then
- dnc_type = 'main_job'
- elseif player.sub_job == "DNC" then
- dnc_type = 'sub_job'
- end
- for i,v in ipairs(waltz.default) do
- if player[dnc_type..'_level'] >= v.lvl then
- local hHP=math.floor((((base*waltz[dnc_type][i])+v.c)*(potency/100))*(received_pot/100))
- local hTP=(v.tp-tpreduction)
- if hHP >= hp_dif and player.tp >= hTP then
- return abilitys[v.id][gearswap.language]
- elseif player.tp >= hTP then
- h_waltz = v.id
- end
- end
- end
- if h_waltz then
- return abilitys[h_waltz][gearswap.language]
- end
- end
- --my code used to get the correct healing of waltz (self only)
- -- Contradance_potency = 0
- -- allied_tags = false
- -- function precast(spell)
- -- if spell.type == 'Waltz' then
- -- if spell.target.type == "SELF" and spell.en:startswith('Curing Waltz') then
- -- local set,potency,received_pot,tpreduction = DNC.waltz_potency(sets["Waltz"])
- -- local new_waltz,h_total = DNC.select_waltz(potency,received_pot,tpreduction)
- -- if new_waltz and spell.name ~= new_waltz then
- -- send_command('input /ja "'..new_waltz..'" <me>')
- -- cancel_spell()
- -- return
- -- elseif h_total == 0 then
- -- add_to_chat(7, 'Canceling '..spell.name..' HP Loss At 0')
- -- cancel_spell()
- -- return
- -- else
- -- if s_waltz_h_a and not showed then
- -- add_to_chat(7, 'Waltz Set To '..new_waltz)
- -- end
- -- end
- -- end
- -- end
- -- end
- -- function buff_change(name,gain,buff_table)
- -- if buff_table.id == 582 then
- -- Contradance_potency = (gain and 100 or 0)
- -- elseif buff_table.id == 267 then
- -- allied_tags = (gain and true or false)
- -- end
- -- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement