AnonymousBOL

Untitled

Feb 16th, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.70 KB | None | 0 0
  1. --[[
  2. Power Interrupt 1.1.2 by Klokje
  3. ========================================================================
  4.  
  5. Info
  6. Automatically interrupt channeled spells if your are in range and your spell isn't on cooldown. With a piority system.
  7. Example if you are Taric you want to stun Fiddlesticks lifedrain, but if you are malphite you don't want to waste ulti for that. But you still want to use it for Katarina ulti.
  8.  
  9. Supported Interrupt Champions (current version):
  10.  
  11. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  12.  
  13. Sion
  14. Alistar
  15. FiddleSticks
  16. Kassadin
  17. Cho'Gath
  18. Malzahar
  19. Pantheon
  20. Taric
  21. HeimerDinger
  22. Poppy
  23. Soraka
  24. Talon
  25. Draven
  26. Diana
  27. Sona
  28. Malphite
  29. Blitzcrank
  30. Fizz
  31. Galio
  32. Gragras
  33. Darius
  34. Maokai
  35. Garen
  36. Hecarim
  37. Leesin
  38. Leona
  39. Lulu
  40. Rammus
  41. Maokai
  42. Riven
  43. Shen
  44. Singed
  45. Viktor
  46. Udyr
  47. Vayne
  48. Tristana
  49. Volibear
  50. Warwick
  51. Wukong
  52. Janna
  53. Ziggs
  54. Urgot
  55. Renekton
  56. Ahri
  57. Hecarim
  58. Sejuani
  59. Nami
  60. Veigar
  61.  
  62. Supported Champions that need to interrupt (current version):
  63.  
  64. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  65.  
  66. Katarina
  67. Galio
  68. FiddleSticks
  69. Nunu
  70. Shen
  71. Urgot
  72. Malzahar
  73. Pantheon
  74. Karthus
  75. Varus
  76. Caitlyn
  77. MissFortune
  78. Warwick
  79.  
  80.  
  81. Changelog
  82. ~~~~~~~~~
  83.  
  84. 0.1 - Initial release
  85.  
  86. 0.2 - Added more champions
  87.  
  88. 0.3 - Added more champions
  89.  
  90. 0.3.1/0.3.2 - Fixed some bugs
  91. Addes more champions
  92.  
  93. 1.0 - Added champion Nami
  94. Rename to Power Interrupt
  95. Out of beta
  96.  
  97. 1.1 - Works with new version of bol
  98. Added champion Veigar
  99.  
  100. 1.1.1 - Rewrite some code
  101. ]]
  102.  
  103.  
  104. -- Config ----------------------------------------------------------------------
  105.  
  106. local ToStun = false
  107. local charStun = false
  108.  
  109. local stunSpells = {}
  110. local spellsToStun = {}
  111.  
  112. champsCanStun = {
  113. --Q
  114. { charName = "Sion", spellSlot = _Q, spellRange = 550, interrupttype = 0, interrupt = 0},
  115. { charName = "Alistar", spellSlot = _Q, spellRange = 365, interrupttype = 2, interrupt = 0},
  116. { charName = "FiddleSticks", spellSlot = _Q, spellRange = 575, interrupttype = 0, interrupt = 0},
  117. { charName = "Kassadin", spellSlot = _Q, spellRange = 650, interrupttype = 0, interrupt = 0},
  118. { charName = "Chogath", spellSlot = _Q, spellRange = 950, interrupttype = 1, interrupt = 0},
  119. { charName = "Malzahar", spellSlot = _Q, spellRange = 850, interrupttype = 1, interrupt = 0},
  120. { charName = "Garen", spellSlot = _Q, spellRange = 400, interrupttype = 3, interrupt = 0},
  121. { charName = "Leona", spellSlot = _Q, spellRange = 400, interrupttype = 3, interrupt = 0},
  122. { charName = "Maokai", spellSlot = _Q, spellRange = 200, interrupttype = 2, interrupt = 0},
  123. { charName = "Volibear", spellSlot = _Q, spellRange = 400, interrupttype = 3, interrupt = 0},
  124. { charName = "Janna", spellSlot = _Q, spellRange = 1100, interrupttype = 4, interrupt = 0},
  125. { charName = "Nami", spellSlot = _Q, spellRange = 825, interrupttype = 1, interrupt = 0},
  126.  
  127. --W
  128. { charName = "Pantheon", spellSlot = _W, spellRange = 600, interrupttype = 0, interrupt = 0},
  129. { charName = "Alistar", spellSlot = _W, spellRange = 650, interrupttype = 0, interrupt = 0},
  130. { charName = "Chogath", spellSlot = _W, spellRange = 700, interrupttype = 1, interrupt = 0},
  131. { charName = "Lulu", spellSlot = _W, spellRange = 650, interrupttype = 1, interrupt = 0},
  132. { charName = "Riven", spellSlot = _W, spellRange = 250, interrupttype = 2, interrupt = 0},
  133. { charName = "Viktor", spellSlot = _W, spellRange = 700, interrupttype = 1, interrupt = 0},
  134. { charName = "Ziggs", spellSlot = _W, spellRange = 1000, interrupttype = 4, interrupt = 0},
  135. { charName = "Renekton", spellSlot = _W, spellRange = 250, interrupttype = 3, interrupt = 0},
  136.  
  137. --E
  138. { charName = "Taric", spellSlot = _E, spellRange = 625, interrupttype = 0, interrupt = 0},
  139. { charName = "HeimerDinger", spellSlot = _E, spellRange = 925, interrupttype = 1, interrupt = 0},
  140. { charName = "Poppy", spellSlot = _E, spellRange = 525, interrupttype = 0, interrupt = 0},
  141. { charName = "Soraka", spellSlot = _E, spellRange = 725, interrupttype = 0, interrupt = 0},
  142. { charName = "FiddleSticks", spellSlot = _E, spellRange = 750, interrupttype = 0, interrupt = 0},
  143. { charName = "Talon", spellSlot = _E, spellRange = 700, interrupttype = 0, interrupt = 0},
  144. { charName = "Draven", spellSlot = _E, spellRange = 900, interrupttype = 1, interrupt = 0},
  145. { charName = "Diana", spellSlot = _E, spellRange = 250, interrupttype = 2, interrupt = 0},
  146. { charName = "Darius", spellSlot = _E, spellRange = 550, interrupttype = 1, interrupt = 0},
  147. { charName = "Hecarim", spellSlot = _E, spellRange = 400, interrupttype = 3, interrupt = 0},
  148. { charName = "Rammus", spellSlot = _E, spellRange = 325, interrupttype = 0, interrupt = 0},
  149. { charName = "Shen", spellSlot = _E, spellRange = 600, interrupttype = 1, interrupt = 0},
  150. { charName = "Singed", spellSlot = _E, spellRange = 400, interrupttype = 0, interrupt = 0},
  151. { charName = "Udyr", spellSlot = _E, spellRange = 400, interrupttype = 3, interrupt = 0},
  152. { charName = "Vayne", spellSlot = _E, spellRange = 450, interrupttype = 0, interrupt = 0},
  153. { charName = "Ahri", spellSlot = _E, spellRange = 975, interrupttype = 1, interrupt = 0},
  154. { charName = "Hecarim", spellSlot = _E, spellRange = 250, interrupttype = 3, interrupt = 0},
  155. { charName = "Veigar", spellSlot = _E, spellRange = 600, interrupttype = 5, interrupt = 0},
  156.  
  157. --ulti
  158. { charName = "Sona", spellSlot = _R, spellRange = 1000, interrupttype = 1, interrupt = 1},
  159. { charName = "Nami", spellSlot = _R, spellRange = 2550, interrupttype = 1, interrupt = 1},
  160. { charName = "Malphite", spellSlot = _R, spellRange = 1000, interrupttype = 1, interrupt = 1},
  161. { charName = "Blitzcrank", spellSlot = _R, spellRange = 600, interrupttype = 2, interrupt = 0},
  162. { charName = "Fizz", spellSlot = _R, spellRange = 1275, interrupttype = 1, interrupt = 1},
  163. { charName = "Galio", spellSlot = _R, spellRange = 600, interrupttype = 2, interrupt = 1},
  164. { charName = "Gragras", spellSlot = _R, spellRange = 1050, interrupttype = 1, interrupt = 1},
  165. { charName = "LeeSin", spellSlot = _R, spellRange = 375, interrupttype = 0, interrupt = 1},
  166. { charName = "Tristana", spellSlot = _R, spellRange = 700, interrupttype = 0, interrupt = 1},
  167. { charName = "Warwick", spellSlot = _R, spellRange = 700, interrupttype = 0, interrupt = 1},
  168. { charName = "MonkeyKing", spellSlot = _R, spellRange = 325, interrupttype = 2, interrupt = 1},
  169. { charName = "Leona", spellSlot = _R, spellRange = 1200, interrupttype = 1, interrupt = 1},
  170. { charName = "Janna", spellSlot = _R, spellRange = 725, interrupttype = 2, interrupt = 1},
  171. { charName = "Urgot", spellSlot = _R, spellRange = 600, interrupttype = 0, interrupt = 1},
  172. { charName = "Skarner", spellSlot = _R, spellRange = 350, interrupttype = 0, interrupt = 1},
  173. { charName = "Hecarim", spellSlot = _R, spellRange = 1000, interrupttype = 1, interrupt = 1},
  174. { charName = "Sejuani", spellSlot = _R, spellRange = 1150, interrupttype = 3, interrupt = 1}
  175. }
  176.  
  177.  
  178.  
  179. --Add here champs that need to be interrupt
  180. champsToStun = {
  181. --Important, how lower the number, how important it is to interrupt
  182. { charName = "Katarina", spellName = "KatarinaR" , important = 0},
  183. { charName = "Galio", spellName = "GalioIdolOfDurand" , important = 0},
  184. { charName = "FiddleSticks", spellName = "Crowstorm" , important = 1},
  185. { charName = "FiddleSticks", spellName = "DrainChannel" , important = 1},
  186. { charName = "Nunu", spellName = "AbsoluteZero" , important = 0},
  187. { charName = "Shen", spellName = "ShenStandUnited" , important = 0},
  188. { charName = "Urgot", spellName = "UrgotSwap2" , important = 0},
  189. { charName = "Malzahar", spellName = "AlZaharNetherGrasp" , important = 0},
  190. { charName = "Karthus", spellName = "FallenOne" , important = 0},
  191. { charName = "Pantheon", spellName = "Pantheon_GrandSkyfall_Jump" , important = 0},
  192. { charName = "Varus", spellName = "VarusQ" , important = 1},
  193. { charName = "Caitlyn", spellName = "CaitlynAceintheHole" , important = 1},
  194. { charName = "MissFortune", spellName = "MissFortuneBulletTime" , important = 1},
  195. { charName = "Warwick", spellName = "InfiniteDuress" , important = 0}
  196. }
  197.  
  198. local k = 1;
  199. for i,champCanStun in pairs(champsCanStun) do
  200. if (myHero.charName == champCanStun.charName) then
  201. charStun = true;
  202. stunSpells[k] = { spellSlot = champCanStun.spellSlot, spellRange = champCanStun.spellRange, interrupttype = champCanStun.interrupttype, interrupt = champCanStun.interrupt}
  203. k= k+1
  204. end
  205. end
  206.  
  207. if charStun == false then return end
  208.  
  209. local l = 1
  210. for i,champToStun in pairs(champsToStun) do
  211. for i=1, heroManager.iCount do
  212. local enemy = heroManager:GetHero(i)
  213. if enemy.team ~= myHero.team and (enemy.charName == champToStun.charName) then
  214. spellsToStun[l] = { spell = champToStun.spellName, important = champToStun.important }
  215. l=l+1
  216. ToStun = true
  217. end
  218. end
  219. end
  220.  
  221. if ToStun == false then return end
  222.  
  223.  
  224. -- Code ------------------------------------------------------------------------
  225.  
  226. function OnLoad()
  227. PrintChat(" >> Power Interrupt 1.1.2")
  228. end
  229.  
  230. function OnProcessSpell(unit, spell)
  231. local spellName = spell.name
  232.  
  233. if (unit and unit.team ~= myHero.team and unit.dead == false) then
  234. for i,spellToStun in pairs(spellsToStun) do
  235. if(spellName == spellToStun.spell) then
  236. for i,stunSpell in pairs(stunSpells) do
  237. if (CanUseSpell(stunSpell.spellSlot) == READY and GetDistance(unit) < stunSpell.spellRange) then
  238. if((stunSpell.interrupt == 0) or (stunSpell.interrupt == 1 and spellToStun.important == 0)) then
  239. if (stunSpell.interrupttype == 0) then
  240. CastSpell(stunSpell.spellSlot, unit)
  241. return
  242. elseif (stunSpell.interrupttype == 1) then
  243. CastSpell(stunSpell.spellSlot, unit.x, unit.z)
  244. return
  245. elseif (stunSpell.interrupttype == 2) then
  246. CastSpell(stunSpell.spellSlot)
  247. return
  248. elseif (stunSpell.interrupttype == 3) then
  249. CastSpell(stunSpell.spellSlot)
  250. player:Attack(unit)
  251. return
  252. elseif (stunSpell.interrupttype == 4) then
  253. CastSpell(stunSpell.spellSlot, unit.x, unit.z)
  254. CastSpell(stunSpell.spellSlot)
  255. return
  256. elseif (stunSpell.interrupttype == 5) then
  257. local stunLoc = getELoc(unit, stunSpell.spellRange)
  258. CastSpell(stunSpell.spellSlot, stunLoc.x, stunLoc.z)
  259. end
  260. end
  261. end
  262. end
  263. end
  264. end
  265. end
  266. end
  267.  
  268. function getELoc(target, range)
  269. myLoc = Vector(myHero.x, myHero.y, myHero.z)
  270. targetLoc = Vector(target.x, target.y, target.z)
  271. stunLoc = Vector(targetLoc) + (Vector(targetLoc)-Vector(myLoc)):normalized()*375
  272. if GetDistance(stunLoc) < range then return stunLoc end
  273. stunLoc = Vector(targetLoc) - (Vector(targetLoc)-Vector(myLoc)):normalized()*375
  274. return stunLoc
  275. end
Advertisement
Add Comment
Please, Sign In to add comment