Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- xx = xx or {}
- xx._util = xx._util or {}
- xx._util.dict = {
- venoms = {
- addiction = "vardrax",
- anorexia = "slike",
- asthma = "kalmia",
- clumsiness = "xentio",
- crippledarm = "epteth",
- crippledleg = "epseth",
- darkshade = "darkshade",
- deafblind = "colocasia",
- disloyalty = "monkshood",
- dizziness = "larkspur",
- haemophilia = "notechis",
- nausea = "euphorbia",
- paralysis = "curare",
- recklessness = "eurypteria",
- scytherus = "scytherus",
- selarnia = "selarnia",
- sensitivity = "prefarar",
- shyness = "digitalis",
- sleep = "delphinium",
- slickness = "gecko",
- stupidity = "aconite",
- voyria = "voyria",
- weariness = "vernalius"
- },
- dictate_affs = {
- "depression",
- "shadowmadness",
- "retribution",
- "parasite"
- },
- scythe = "scythe413232",
- dagger = "dagger308566",
- shield = "shield174808"
- }
- xx._util.dict.instill = xx._util.dict.instill or {
- degeneration = {
- affs = {
- "clumsiness",
- "weariness",
- "paralysis"
- },
- capstone = {
- "damage"
- }
- },
- depression = {
- affs = {
- "depression",
- "nausea",
- "hypochondria",
- },
- capstone = {
- "anorexia",
- "masochism"
- }
- },
- madness = {
- affs = {
- "shadowmadness",
- "vertigo",
- "hallucinations"
- },
- capstone = {
- "stun"
- }
- },
- retribution = {
- affs = {
- "justice",
- "retribution"
- },
- capstone = {
- "mana_damage"
- }
- },
- leach = {
- affs = {
- "parasite",
- "healthleech",
- "manaleech"
- },
- capstone = {
- "shadow"
- }
- }
- }
- xx._util.instill = xx._util.instill or {
- depression = "depression",
- retribution = "retribution",
- shadowmadness = "madness",
- parasite = "leach"
- }
- function xx._util.instill.next_aff(instill, venom, loop)
- local utils = xx._util
- local dict = utils.dict
- -- this score is the AK score threshold. modify as needed
- local score = 80
- -- don't touch this stuff
- local num_affs = 1
- local index = 0
- local next_aff = { }
- if affstrack.score.timeloop > score then
- loop = true
- end
- -- main loop
- for _,aff in ipairs(dict.instill[instill].affs) do
- -- if they don't have the aff
- if affstrack.score[aff] < score then
- -- then it will be delivered by this instill
- table.insert(next_aff, aff)
- index = index + 1
- -- if the aff can be delivered by a venom, then you can instead envenom and go further down the list
- if venom and table.contains(dict.venoms, aff) then
- num_affs = num_affs + 1
- -- table.insert(next_aff, aff)
- venom = false
- -- table.remove(next_aff)
- end
- -- if they have timeloop or you have manually overridden it (for boost loop etc) then you get to proceed further down the list
- if loop then
- num_affs = num_affs + 1
- loop = false
- end
- -- if all hits have been used up, then we can proceed no further
- if index >= num_affs then
- break
- end
- end
- end
- -- if we have finished checking the instill's affs and still have remaining hits
- -- then we can also proc the capstone, so add that to the table
- if index < num_affs then
- next_aff = table.combine_ordered(next_aff, dict.instill[instill].capstone)
- index = index + 1
- end
- -- if we have procced the capstone and still have hits remaining, add a flag
- -- to indicate we have a spare_hit. This can be used to choose whether to use the venom
- -- or whether to use a different instill for max efficiency
- if index < num_affs then
- table.insert(next_aff, "spare_hit")
- end
- -- return the affs
- --return next_aff
- end
- function xx._util.instill.check_all(aff, venom, loop)
- local dict = xx._util.dict
- local utils = xx._util.instill
- local results
- for instill,info in pairs(dict.instill) do
- if table.contains(info.affs, aff) or table.contains(info.capstone, aff) then
- if table.contains(utils.next_aff(instill, venom, loop), aff) then
- results = instill
- end
- end
- end
- return results
- end
- function xx._util.instill.capstone_available(instill)
- local utils = xx._util
- if utils.instill.next_aff(instill) then
- return true
- end
- end
- function xx._util.aff_select(aff_priority, score)
- score = score or 67
- local utils = xx._util
- local venoms = utils.dict.venoms
- local results = {
- instill,
- venom,
- timeloop
- }
- local target_looped = true and affstrack.score["timeloop"] > 67 or false
- for _, aff in ipairs(aff_priority) do
- if affstrack.score[aff] < score then
- local one = utils.instill.check_all(aff, false, target_looped)
- local two = utils.instill.check_all(aff, true, target_looped)
- -- if one then echo("\none: "..one) end
- -- if two then echo("\ntwo: "..two) end
- -- local three = utils.instill.check_all(aff, true, true)
- if one and not results.instill then
- if not (results.venom == "curare" and (one == "madness" or one == "depression")) then
- results.instill = one
- end
- elseif table.contains(venoms, aff) and not results.venom and not results.timeloop and not
- (aff == "paralysis" and (results.instill == "madness" or results.instill == "depression")) then
- results.venom = venoms[aff]
- elseif aff == "timeloop" and not results.venom and not results.timeloop and tonumber(string.sub(gmcp.Char.Vitals.charstats[4], 6)) <= 250 then
- elseif two and not results.instill and not results.venom then
- local affs = utils.instill.next_aff(two, true, target_looped)
- if table.size(affs) > 1 then
- for _,value in ipairs(affs) do
- if table.contains(venoms, value) then
- results.venom = venoms[value]
- break
- end
- end
- end
- results.instill = utils.instill.check_all(aff, true, target_looped)
- end
- end
- end
- display(results)
- if not results.instill then results.instill = "retribution" end
- return results
- end
- xx._util.kills = xx._util.kills or {}
- function xx._util.kills.damage_out()
- local utils = xx._util
- local dagger = utils.dict.dagger
- local scythe = utils.dict.scythe
- local hp = tonumber(ak.currenthealth)
- local maxhp = tonumber(ak.maxhealth)
- local mutilate_damage = .40 * maxhp
- -- local tooros_damage = .07 * maxhp
- local cull_damage = .20 * maxhp
- if affstrack.score["sensitivity"] > 90 then
- cull_damage = cull_damage * 0.25
- end
- -- if not aa.self.bals.word.have then
- -- tooros_damage = 0
- -- end
- -- if (hp <= cull_damage + tooros_damage) then
- if (hp <= cull_damage) then
- return {
- "wield "..scythe,
- "intone tooros",
- "shadow instill scythe with madness",
- "shadow cull "..target.." delphinium",
- "assess "..target
- }
- -- elseif (hp <= mutilate_damage + tooros_damage) and table.contains(ak.ShadowList, target) then
- elseif (hp <= mutilate_damage) and table.contains(ak.ShadowList, target) then
- return {
- "wield "..dagger,
- "intone tooros",
- "shadow mutilate "..target.." delphinium",
- "assess "..target
- }
- end
- -- Can't be damaged out
- return nil
- end
- function xx._util.kills.dictate()
- local utils = xx._util
- local affs = utils.dict.dictate_affs
- local threshold = .38
- local mp = tonumber(ak.currentmana)
- local maxmp = tonumber(ak.maxmana)
- -- local tooros_damage = .05
- -- if not aa.self.bals.word.have then
- -- tooros_damage = 0
- -- end
- for _,aff in ipairs(affs) do
- if affstrack.score[aff] > .8 then
- threshold = threshold + 0.05
- end
- end
- -- if (mp/maxmp) <= (threshold + tooros_damage) then
- if (mp/maxmp) <= threshold then
- return {
- "intone tooros",
- "shadow dictate "..target,
- "contemplate "..target
- }
- end
- -- Can't be dictated
- return nil
- end
- function xx._util.kill()
- -- Check for any available kill condition
- local kills = xx._util.kills
- if kills.dictate() then
- return kills.dictate()
- elseif kills.damage_out() then
- return kills.damage_out()
- end
- -- No kill condition available
- return nil
- end
- local aff_priority = {
- --"paralysis",
- "asthma",
- "shadowmadness",
- "anorexia",
- "slickness",
- "depression",
- "recklessness",
- "nausea",
- "darkshade",
- "sensitivity"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement