Advertisement
hhaos

Untitled

Apr 22nd, 2023
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.65 KB | None | 0 0
  1. xx = xx or {}
  2. xx._util = xx._util or {}
  3. xx._util.dict = {
  4. venoms = {
  5. addiction = "vardrax",
  6. anorexia = "slike",
  7. asthma = "kalmia",
  8. clumsiness = "xentio",
  9. crippledarm = "epteth",
  10. crippledleg = "epseth",
  11. darkshade = "darkshade",
  12. deafblind = "colocasia",
  13. disloyalty = "monkshood",
  14. dizziness = "larkspur",
  15. haemophilia = "notechis",
  16. nausea = "euphorbia",
  17. paralysis = "curare",
  18. recklessness = "eurypteria",
  19. scytherus = "scytherus",
  20. selarnia = "selarnia",
  21. sensitivity = "prefarar",
  22. shyness = "digitalis",
  23. sleep = "delphinium",
  24. slickness = "gecko",
  25. stupidity = "aconite",
  26. voyria = "voyria",
  27. weariness = "vernalius"
  28. },
  29. dictate_affs = {
  30. "depression",
  31. "shadowmadness",
  32. "retribution",
  33. "parasite"
  34. },
  35. scythe = "scythe413232",
  36. dagger = "dagger308566",
  37. shield = "shield174808"
  38. }
  39.  
  40. xx._util.dict.instill = xx._util.dict.instill or {
  41. degeneration = {
  42. affs = {
  43. "clumsiness",
  44. "weariness",
  45. "paralysis"
  46. },
  47. capstone = {
  48. "damage"
  49. }
  50. },
  51. depression = {
  52. affs = {
  53. "depression",
  54. "nausea",
  55. "hypochondria",
  56. },
  57. capstone = {
  58. "anorexia",
  59. "masochism"
  60. }
  61. },
  62. madness = {
  63. affs = {
  64. "shadowmadness",
  65. "vertigo",
  66. "hallucinations"
  67. },
  68. capstone = {
  69. "stun"
  70. }
  71. },
  72. retribution = {
  73. affs = {
  74. "justice",
  75. "retribution"
  76. },
  77. capstone = {
  78. "mana_damage"
  79. }
  80. },
  81. leach = {
  82. affs = {
  83. "parasite",
  84. "healthleech",
  85. "manaleech"
  86. },
  87. capstone = {
  88. "shadow"
  89. }
  90. }
  91. }
  92.  
  93. xx._util.instill = xx._util.instill or {
  94. depression = "depression",
  95. retribution = "retribution",
  96. shadowmadness = "madness",
  97. parasite = "leach"
  98. }
  99.  
  100. function xx._util.instill.next_aff(instill, venom, loop)
  101. local utils = xx._util
  102. local dict = utils.dict
  103.  
  104. -- this score is the AK score threshold. modify as needed
  105. local score = 80
  106.  
  107. -- don't touch this stuff
  108. local num_affs = 1
  109. local index = 0
  110.  
  111. local next_aff = { }
  112.  
  113. if affstrack.score.timeloop > score then
  114. loop = true
  115. end
  116.  
  117. -- main loop
  118. for _,aff in ipairs(dict.instill[instill].affs) do
  119.  
  120. -- if they don't have the aff
  121. if affstrack.score[aff] < score then
  122.  
  123. -- then it will be delivered by this instill
  124. table.insert(next_aff, aff)
  125. index = index + 1
  126.  
  127. -- if the aff can be delivered by a venom, then you can instead envenom and go further down the list
  128. if venom and table.contains(dict.venoms, aff) then
  129. num_affs = num_affs + 1
  130. -- table.insert(next_aff, aff)
  131. venom = false
  132. -- table.remove(next_aff)
  133. end
  134.  
  135. -- if they have timeloop or you have manually overridden it (for boost loop etc) then you get to proceed further down the list
  136. if loop then
  137. num_affs = num_affs + 1
  138. loop = false
  139. end
  140.  
  141. -- if all hits have been used up, then we can proceed no further
  142. if index >= num_affs then
  143. break
  144. end
  145. end
  146. end
  147.  
  148. -- if we have finished checking the instill's affs and still have remaining hits
  149. -- then we can also proc the capstone, so add that to the table
  150. if index < num_affs then
  151. next_aff = table.combine_ordered(next_aff, dict.instill[instill].capstone)
  152. index = index + 1
  153. end
  154.  
  155. -- if we have procced the capstone and still have hits remaining, add a flag
  156. -- to indicate we have a spare_hit. This can be used to choose whether to use the venom
  157. -- or whether to use a different instill for max efficiency
  158. if index < num_affs then
  159. table.insert(next_aff, "spare_hit")
  160. end
  161.  
  162. -- return the affs
  163. --return next_aff
  164.  
  165. end
  166.  
  167. function xx._util.instill.check_all(aff, venom, loop)
  168. local dict = xx._util.dict
  169. local utils = xx._util.instill
  170.  
  171. local results
  172.  
  173. for instill,info in pairs(dict.instill) do
  174. if table.contains(info.affs, aff) or table.contains(info.capstone, aff) then
  175. if table.contains(utils.next_aff(instill, venom, loop), aff) then
  176. results = instill
  177. end
  178. end
  179. end
  180.  
  181. return results
  182. end
  183.  
  184. function xx._util.instill.capstone_available(instill)
  185. local utils = xx._util
  186.  
  187. if utils.instill.next_aff(instill) then
  188. return true
  189. end
  190.  
  191. end
  192.  
  193. function xx._util.aff_select(aff_priority, score)
  194. score = score or 67
  195.  
  196. local utils = xx._util
  197. local venoms = utils.dict.venoms
  198.  
  199. local results = {
  200. instill,
  201. venom,
  202. timeloop
  203. }
  204.  
  205. local target_looped = true and affstrack.score["timeloop"] > 67 or false
  206.  
  207. for _, aff in ipairs(aff_priority) do
  208. if affstrack.score[aff] < score then
  209. local one = utils.instill.check_all(aff, false, target_looped)
  210. local two = utils.instill.check_all(aff, true, target_looped)
  211. -- if one then echo("\none: "..one) end
  212. -- if two then echo("\ntwo: "..two) end
  213. -- local three = utils.instill.check_all(aff, true, true)
  214. if one and not results.instill then
  215. if not (results.venom == "curare" and (one == "madness" or one == "depression")) then
  216. results.instill = one
  217. end
  218. elseif table.contains(venoms, aff) and not results.venom and not results.timeloop and not
  219. (aff == "paralysis" and (results.instill == "madness" or results.instill == "depression")) then
  220.  
  221. results.venom = venoms[aff]
  222.  
  223. elseif aff == "timeloop" and not results.venom and not results.timeloop and tonumber(string.sub(gmcp.Char.Vitals.charstats[4], 6)) <= 250 then
  224. elseif two and not results.instill and not results.venom then
  225. local affs = utils.instill.next_aff(two, true, target_looped)
  226. if table.size(affs) > 1 then
  227. for _,value in ipairs(affs) do
  228. if table.contains(venoms, value) then
  229.  
  230. results.venom = venoms[value]
  231. break
  232. end
  233. end
  234. end
  235. results.instill = utils.instill.check_all(aff, true, target_looped)
  236. end
  237. end
  238. end
  239.  
  240. display(results)
  241. if not results.instill then results.instill = "retribution" end
  242. return results
  243. end
  244.  
  245.  
  246.  
  247. xx._util.kills = xx._util.kills or {}
  248.  
  249. function xx._util.kills.damage_out()
  250.  
  251. local utils = xx._util
  252. local dagger = utils.dict.dagger
  253. local scythe = utils.dict.scythe
  254.  
  255. local hp = tonumber(ak.currenthealth)
  256. local maxhp = tonumber(ak.maxhealth)
  257.  
  258. local mutilate_damage = .40 * maxhp
  259. -- local tooros_damage = .07 * maxhp
  260. local cull_damage = .20 * maxhp
  261.  
  262. if affstrack.score["sensitivity"] > 90 then
  263. cull_damage = cull_damage * 0.25
  264. end
  265.  
  266. -- if not aa.self.bals.word.have then
  267. -- tooros_damage = 0
  268. -- end
  269.  
  270. -- if (hp <= cull_damage + tooros_damage) then
  271. if (hp <= cull_damage) then
  272.  
  273. return {
  274. "wield "..scythe,
  275. "intone tooros",
  276. "shadow instill scythe with madness",
  277. "shadow cull "..target.." delphinium",
  278. "assess "..target
  279. }
  280.  
  281. -- elseif (hp <= mutilate_damage + tooros_damage) and table.contains(ak.ShadowList, target) then
  282. elseif (hp <= mutilate_damage) and table.contains(ak.ShadowList, target) then
  283.  
  284. return {
  285. "wield "..dagger,
  286. "intone tooros",
  287. "shadow mutilate "..target.." delphinium",
  288. "assess "..target
  289. }
  290.  
  291. end
  292.  
  293. -- Can't be damaged out
  294. return nil
  295. end
  296.  
  297. function xx._util.kills.dictate()
  298. local utils = xx._util
  299. local affs = utils.dict.dictate_affs
  300.  
  301. local threshold = .38
  302. local mp = tonumber(ak.currentmana)
  303. local maxmp = tonumber(ak.maxmana)
  304. -- local tooros_damage = .05
  305.  
  306. -- if not aa.self.bals.word.have then
  307. -- tooros_damage = 0
  308. -- end
  309.  
  310. for _,aff in ipairs(affs) do
  311. if affstrack.score[aff] > .8 then
  312. threshold = threshold + 0.05
  313. end
  314. end
  315.  
  316. -- if (mp/maxmp) <= (threshold + tooros_damage) then
  317. if (mp/maxmp) <= threshold then
  318. return {
  319. "intone tooros",
  320. "shadow dictate "..target,
  321. "contemplate "..target
  322. }
  323.  
  324. end
  325.  
  326. -- Can't be dictated
  327. return nil
  328. end
  329.  
  330. function xx._util.kill()
  331. -- Check for any available kill condition
  332. local kills = xx._util.kills
  333.  
  334. if kills.dictate() then
  335. return kills.dictate()
  336. elseif kills.damage_out() then
  337. return kills.damage_out()
  338. end
  339.  
  340. -- No kill condition available
  341. return nil
  342. end
  343. local aff_priority = {
  344. --"paralysis",
  345. "asthma",
  346. "shadowmadness",
  347. "anorexia",
  348. "slickness",
  349. "depression",
  350. "recklessness",
  351. "nausea",
  352. "darkshade",
  353. "sensitivity"
  354. }
  355.  
  356.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement