Advertisement
OTG

Select venom / song

OTG
Aug 20th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.30 KB | None | 0 0
  1. --select appropriate venom / curse / song
  2.  
  3. local asc = affstrack.score
  4. local akv = kln.ref.aff2venom
  5. local a2s = kln.ref.voicecraft.aff2song
  6.  
  7.  
  8. ak.nextVenom = function(class, stack)
  9.  
  10. if not class or not stack then
  11. if not ak.stacks.current then ak.getDefaultStack() end
  12. class = ak.stacks.current[1]
  13. stack = ak.stacks.current[2]
  14. end
  15.  
  16. scoreup()
  17.  
  18. if asc.asleep == 100 and vials.venoms[akv.asleep] > 0 then return akv.asleep end --keep them asleep!
  19.  
  20. if asc.prone == 100 and asc.crippledleg >= 100 and asc.anorexia <= 66 and vials.venoms[akv.anorexia] > 0 then return akv.anorexia end --time to lock!
  21.  
  22. if not ak.stacks.current then ak.getDefaultStack() end
  23.  
  24. local aks = ak.stacks[ak.stacks.current[1]][ak.stacks.current[2]]
  25. if ak.stacks.current[2] ~= "default" and string.sub(ak.stacks.current[2],1,3) ~= "alt" then --append default table
  26. for k, v in pairs(ak.stacks[ak.stacks.current[1]].default) do
  27. table.insert(aks,#aks+1,v)
  28. end
  29. end
  30.  
  31. for k,v in ipairs(aks) do
  32. if k%4 == 1 then --only take every fourth entry
  33. if affstrack.score[v] < aks[k+3] and aks[k+1] == 1 and
  34. (vials.venoms[akv[v]] or 0 > 0 or cVenom == vials.venoms[akv[v]])
  35. and ak.specAff ~= v then
  36. return akv[v] --use this venom
  37. end
  38. end
  39. end
  40.  
  41. return "voyria"
  42.  
  43. end --ak.nextVenom
  44.  
  45.  
  46.  
  47. ak.nextSpecialAttack = function(arg)
  48.  
  49. arg = arg or {}
  50. arg.aff = arg.aff or ak.venAff or "none"
  51.  
  52. if not arg.class or not arg.stack then
  53. if not ak.stacks.current then ak.getDefaultStack() end
  54. arg.class = ak.stacks.current[1]
  55. arg.stack = ak.stacks.current[2]
  56. end
  57.  
  58. scoreup()
  59.  
  60. local atk = "none"
  61. local aks = mmp.deepcopy(ak.stacks[ak.stacks.current[1]][ak.stacks.current[2]])
  62.  
  63. if ak.stacks.current[2] ~= "default" and string.sub(ak.stacks.current[2],1,3) ~= "alt" then --append default table
  64. for k, v in pairs(ak.stacks[ak.stacks.current[1]].default) do
  65. table.insert(aks,#aks+1,v)
  66. end
  67. end
  68.  
  69. if ak.stacks.current[1] == "bard" and olc.targeted then
  70. if (olc.bpart[olc.targeted] or 0) >= olc.breakpoint - 1 and string.find(olc.targeted,"leg") then
  71. if asc.impatience <= 66 and arg.aff ~= "impatience" then
  72. ak.specAff = "impatience"
  73. return a2s["impatience"]..target
  74.  
  75. elseif asc.anorexia or 0 <= 66 and arg.aff ~= "anorexia" then
  76. ak.specAff = "anorexia"
  77. return a2s["anorexia"]..target
  78.  
  79. end
  80.  
  81. elseif asc.prone == 100 and asc.crippledleg >= 100 then
  82. if asc.impatience <= 66 and arg.aff ~= "impatience" then
  83. ak.specAff = "imptience"
  84. return a2s["impatience"]..target
  85.  
  86. elseif asc.paralysis <= 66 and arg.aff ~="paralysis" then
  87. ak.specAff = "paralysis"
  88. return a2s["paralysis"]..target
  89.  
  90. end
  91.  
  92. end
  93.  
  94. end
  95.  
  96. if ak.stacks.current[1] == "bard" and tonumber(gmcp.Char.Vitals.mp) <= tonumber(gmcp.Char.Vitals.maxmp)*0.6 and table.contains(ssc.enabledClasses, "priest") then
  97. ak.specAff = "none"
  98. return "sing solo at "..target
  99. end
  100.  
  101. if table.contains(ssc.enabledClasses, "occultist") and affstrack.score.confusion < 66 and arg.aff ~= "confusion" then
  102. ak.specAff = "confusion"
  103. return a2s["confusion"]..target
  104. end
  105.  
  106. for k, v in ipairs(aks) do
  107. if k%4 == 1 then
  108. if affstrack.score[v] < aks[k+3] and aks[k+2] == 1 and arg.aff ~= v then
  109. if ak.stacks.current[1] == "dragon" then
  110. return "dragoncurse "..target.." "..v.." 1"
  111. elseif ak.stacks.current[1] == "bard" then
  112. if (rebounding == true or shielded == true) and not table.contains(kln.affs,"impaled") == false then
  113. return "sing cantata at "..target
  114. else
  115. return a2s[v]..target
  116. end
  117. end
  118. end
  119. end
  120. end
  121.  
  122. if atk == "none" then --use default
  123. if ak.stacks.current[1] == "bard" then
  124. ak.specAff = "defstrip"
  125. return "sing chant at "..target
  126. end
  127. end
  128.  
  129. end --ak.nextSpecialAttack
  130.  
  131.  
  132.  
  133. ak.getDefaultStack = function()
  134.  
  135. local class = "unknown"
  136.  
  137. if not gmcp.Char then
  138. class = "dragon"
  139. elseif gmcp.Char.Status.race:find("Dragon") then
  140. class = "dragon"
  141. else
  142. class = gmcp.Char.Status.class:lower()
  143. end
  144.  
  145. if class == "bard" then
  146. ak.stacks.current = {class, "goldenseal"}
  147. else
  148. ak.stacks.current = {class, "default"}
  149. end
  150.  
  151. scoreup()
  152.  
  153. end --ak.getDefaultStack
  154.  
  155. registerAnonymousEventHandler("svo got dragonform","ak.getDefaultStack")
  156. registerAnonymousEventHandler("svo lost dragonform","ak.getDefaultStack")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement