Advertisement
hhaos

Untitled

Apr 22nd, 2023
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.75 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. echo("\naff = "..aff)
  209. echo("\nscore = "..score)
  210. echo("\naffstrack.score = "..affstrack.score[aff])
  211. if affstrack.score[aff] < score then
  212. local one = utils.instill.check_all(aff, false, target_looped)
  213. local two = utils.instill.check_all(aff, true, target_looped)
  214. -- if one then echo("\none: "..one) end
  215. -- if two then echo("\ntwo: "..two) end
  216. -- local three = utils.instill.check_all(aff, true, true)
  217. if one and not results.instill then
  218. if not (results.venom == "curare" and (one == "madness" or one == "depression")) then
  219. results.instill = one
  220. end
  221. elseif table.contains(venoms, aff) and not results.venom and not results.timeloop and not
  222. (aff == "paralysis" and (results.instill == "madness" or results.instill == "depression")) then
  223.  
  224. results.venom = venoms[aff]
  225.  
  226. elseif aff == "timeloop" and not results.venom and not results.timeloop and tonumber(string.sub(gmcp.Char.Vitals.charstats[4], 6)) <= 250 then
  227. elseif two and not results.instill and not results.venom then
  228. local affs = utils.instill.next_aff(two, true, target_looped)
  229. if table.size(affs) > 1 then
  230. for _,value in ipairs(affs) do
  231. if table.contains(venoms, value) then
  232.  
  233. results.venom = venoms[value]
  234. break
  235. end
  236. end
  237. end
  238. results.instill = utils.instill.check_all(aff, true, target_looped)
  239. end
  240. end
  241. end
  242.  
  243. display(results)
  244. if not results.instill then results.instill = "retribution" end
  245. return results
  246. end
  247.  
  248.  
  249.  
  250. xx._util.kills = xx._util.kills or {}
  251.  
  252. function xx._util.kills.damage_out()
  253.  
  254. local utils = xx._util
  255. local dagger = utils.dict.dagger
  256. local scythe = utils.dict.scythe
  257.  
  258. local hp = tonumber(ak.currenthealth)
  259. local maxhp = tonumber(ak.maxhealth)
  260.  
  261. local mutilate_damage = .40 * maxhp
  262. -- local tooros_damage = .07 * maxhp
  263. local cull_damage = .20 * maxhp
  264.  
  265. if affstrack.score["sensitivity"] > 90 then
  266. cull_damage = cull_damage * 0.25
  267. end
  268.  
  269. -- if not aa.self.bals.word.have then
  270. -- tooros_damage = 0
  271. -- end
  272.  
  273. -- if (hp <= cull_damage + tooros_damage) then
  274. if (hp <= cull_damage) then
  275.  
  276. return {
  277. "wield "..scythe,
  278. "intone tooros",
  279. "shadow instill scythe with madness",
  280. "shadow cull "..target.." delphinium",
  281. "assess "..target
  282. }
  283.  
  284. -- elseif (hp <= mutilate_damage + tooros_damage) and table.contains(ak.ShadowList, target) then
  285. elseif (hp <= mutilate_damage) and table.contains(ak.ShadowList, target) then
  286.  
  287. return {
  288. "wield "..dagger,
  289. "intone tooros",
  290. "shadow mutilate "..target.." aconite",
  291. "assess "..target
  292. }
  293.  
  294. end
  295.  
  296. -- Can't be damaged out
  297. return nil
  298. end
  299.  
  300. function xx._util.kills.dictate()
  301. local utils = xx._util
  302. local affs = utils.dict.dictate_affs
  303.  
  304. local threshold = .38
  305. local mp = tonumber(ak.currentmana)
  306. local maxmp = tonumber(ak.maxmana)
  307. -- local tooros_damage = .05
  308.  
  309. -- if not aa.self.bals.word.have then
  310. -- tooros_damage = 0
  311. -- end
  312.  
  313. for _,aff in ipairs(affs) do
  314. if affstrack.score[aff] > .8 then
  315. threshold = threshold + 0.05
  316. end
  317. end
  318.  
  319. -- if (mp/maxmp) <= (threshold + tooros_damage) then
  320. if (mp/maxmp) <= threshold then
  321. return {
  322. "intone tooros",
  323. "shadow dictate "..target,
  324. "contemplate "..target
  325. }
  326.  
  327. end
  328.  
  329. -- Can't be dictated
  330. return nil
  331. end
  332.  
  333. function xx._util.kill()
  334. -- Check for any available kill condition
  335. local kills = xx._util.kills
  336.  
  337. if kills.dictate() then
  338. return kills.dictate()
  339. elseif kills.damage_out() then
  340. return kills.damage_out()
  341. end
  342.  
  343. -- No kill condition available
  344. return nil
  345. end
  346. local aff_priority = {
  347. --"paralysis",
  348. "asthma",
  349. "shadowmadness",
  350. "anorexia",
  351. "slickness",
  352. "depression",
  353. "recklessness",
  354. "nausea",
  355. "darkshade",
  356. "sensitivity"
  357. }
  358.  
  359.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement