Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetBestCombo(target)
- if not ValidTarget(target) or champ == nil then return false, false, false, false, 0 end
- local q = {false}
- local w = {false}
- local e = {false}
- local r = {false}
- local damagetable = PredictedDamage[target.networkID]
- if damagetable ~= nil then
- local time = damagetable[6]
- if os.clock() - time <= RefreshTime then
- return damagetable[1], damagetable[2], damagetable[3], damagetable[4], damagetable[5]
- else
- if champ.Q and champ.Q.IsReady() then q = {false, true} end
- if champ.W and champ.W.IsReady() then w = {false, true} end
- if champ.E and champ.E.IsReady() then e = {false, true} end
- if champ.R and champ.R.IsReady() then r = {false, true} end
- local bestdmg = 0
- local best = {champ.Q.IsReady(), champ.W.IsReady(), champ.E.IsReady(), champ.R.IsReady()}
- local dmg, mana = champ:GetComboDamage(target, champ.Q.IsReady(), champ.W.IsReady(), champ.E.IsReady(), champ.R.IsReady())
- bestdmg = dmg
- if dmg > target.health then
- for qCount = 1, #q do
- for wCount = 1, #w do
- for eCount = 1, #e do
- for rCount = 1, #r do
- local d, m = champ:GetComboDamage(target, q[qCount], w[wCount], e[eCount], r[rCount])
- if d >= target.health and myHero.mana >= m then
- if d < bestdmg then
- bestdmg = d
- best = {q[qCount], w[wCount], e[eCount], r[rCount]}
- end
- end
- end
- end
- end
- end
- --return best[1], best[2], best[3], best[4], bestdmg
- damagetable[1] = best[1]
- damagetable[2] = best[2]
- damagetable[3] = best[3]
- damagetable[4] = best[4]
- damagetable[5] = bestdmg
- damagetable[6] = os.clock()
- else
- local table2 = {false,false,false,false}
- local bestdmg, mana = champ:GetComboDamage(target, false, false, false, false)
- for qCount = 1, #q do
- for wCount = 1, #w do
- for eCount = 1, #e do
- for rCount = 1, #r do
- local d, m = champ:GetComboDamage(target, q[qCount], w[wCount], e[eCount], r[rCount])
- if d > bestdmg and myHero.mana >= m then
- table2 = {q[qCount],w[wCount],e[eCount],r[rCount]}
- bestdmg = d
- end
- end
- end
- end
- end
- --return table2[1],table2[2],table2[3],table2[4], bestdmg
- damagetable[1] = table2[1]
- damagetable[2] = table2[2]
- damagetable[3] = table2[3]
- damagetable[4] = table2[4]
- damagetable[5] = bestdmg
- damagetable[6] = os.clock()
- end
- return damagetable[1], damagetable[2], damagetable[3], damagetable[4], damagetable[5]
- end
- else
- PredictedDamage[target.networkID] = {false, false, false, false, 0, os.clock() - RefreshTime * 2}
- return GetBestCombo(target)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement