Guest User

Untitled

a guest
Nov 20th, 2014
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.32 KB | None | 0 0
  1. --[[
  2. Katarina Combo 2.15
  3. by eXtragoZ
  4.  
  5. Features:
  6. - Full combo: DFG -> E -> Q -> W -> Items -> R
  7. - Auto Ignite in the Full combo (by default off)
  8. - Supports: Deathfire Grasp, Liandry's Torment, Blackfire Torch, Bilgewater Cutlass, Hextech Gunblade, Blade of the Ruined King, Sheen, Trinity, Lich Bane, Iceborn Gauntlet, Shard of True Ice, Randuin's Omen and Ignite
  9. - Harass mode:
  10. - 0: Q
  11. - 1: Q -> W
  12. - 2: E -> Q -> W
  13. - Delay in W to process the mark of Q unless it going to use R
  14. - Stops the Ult if you can kill your target with basic skills
  15. - Mark killable target with a combo
  16. - Target configuration
  17. - Press shift to configure
  18.  
  19. Explanation of the marks:
  20. Green circle: Marks the current target to which you will do the combo
  21. Blue circle: Mark a target that can be killed with a combo, if all the skills were available
  22. Red circle: Mark a target that can be killed using items + 1 hits + Q x2 + Qmark x2 + W x2 + E x2 + R (full duration) + ignite
  23. 2 Red circles: Mark a target that can be killed using items + 1 hits + Q + Qmark + W + E + R (7/10 duration) + ignite
  24. 3 Red circles: Mark a target that can be killed using items (without on hit items) + Q + Qmark(if e is not on cd) + W(if e is not on cd) + E + R (3/10 duration)(if e is not on cd)
  25.  
  26. Stops the Ult: Q + Qmark + W + E
  27. ]]
  28. if myHero.charName ~= "Katarina" then return end
  29. --[[ Config ]]
  30. local HK = 32 --spacebar
  31. local HHK = 84 --T
  32. --[[ Code ]]
  33. local range = 700 --+65 BB
  34. --Qrange = 675 + BB
  35. --Wrange = 400 + BB
  36. --Erange = 700 + BB
  37. local ULTK = 82 --R (security method)
  38. local tick = nil
  39. -- Active
  40. local ultActive = false
  41. local timeult = 0
  42. local timeq = 0
  43. local lastqmark = 0
  44. local lastAnimation = ""
  45. -- draw
  46. local waittxt = {}
  47. local calculationenemy = 1
  48. local floattext = {"Skills are not available","Able to fight","Killable","Murder him!"}
  49. local killable = {}
  50. -- ts
  51. local ts
  52. local distancetarget = 0
  53. --
  54. local ID = {DFG = 3128, HXG = 3146, BWC = 3144, Sheen = 3057, Trinity = 3078, LB = 3100, IG = 3025, LT = 3151, BT = 3188, STI = 3092, RO = 3143, BRK = 3153}
  55. local Slot = {Q = _Q, W = _W, E = _E, R = _R, I = nil, DFG = nil, HXG = nil, BWC = nil, Sheen = nil, Trinity = nil, LB = nil, IG = nil, LT = nil, BT = nil, STI = nil, RO = nil, BRK = nil}
  56. local RDY = {Q = false, W = false, E = false, R = false, I = false, DFG = false, HXG = false, BWC = false, STI = false, RO = false, BRK = false}
  57.  
  58. function OnLoad()
  59. KCConfig = scriptConfig("Katarina Combo 2.15", "katarinacombo")
  60. KCConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, HK)
  61. KCConfig:addParam("harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, HHK)
  62. KCConfig:addParam("harasscombo", "Harass Combo", SCRIPT_PARAM_SLICE, 2, 0, 2, 0)
  63. KCConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  64. KCConfig:addParam("drawtext", "Draw Text", SCRIPT_PARAM_ONOFF, true)
  65. KCConfig:addParam("useult", "Use Ult", SCRIPT_PARAM_ONOFF, true)
  66. KCConfig:addParam("delayw", "Delay W", SCRIPT_PARAM_ONOFF, true)
  67. KCConfig:addParam("canstopult", "Can stop Ult", SCRIPT_PARAM_ONOFF, true)
  68. KCConfig:addParam("autoIgnite", "Auto Ignite", SCRIPT_PARAM_ONOFF, false)
  69. KCConfig:permaShow("scriptActive")
  70. KCConfig:permaShow("harass")
  71. ts = TargetSelector(TARGET_LESS_CAST_PRIORITY,range,DAMAGE_MAGIC)
  72. ts.name = "Katarina"
  73. KCConfig:addTS(ts)
  74. if myHero:GetSpellData(SUMMONER_1).name:lower():find("summonerdot") then Slot.I = SUMMONER_1
  75. elseif myHero:GetSpellData(SUMMONER_2).name:lower():find("summonerdot") then Slot.I = SUMMONER_2 end
  76. for i=1, heroManager.iCount do waittxt[i] = i*3 end
  77. PrintChat(" >> Katarina Combo 2.15 loaded!")
  78. end
  79. function OnTick()
  80. ts:update()
  81. for name,number in pairs(ID) do Slot[name] = GetInventorySlotItem(number) end
  82. for name,state in pairs(RDY) do RDY[name] = (Slot[name] ~= nil and myHero:CanUseSpell(Slot[name]) == READY) end
  83. if tick == nil or GetTickCount()-tick >= 100 then
  84. tick = GetTickCount()
  85. KCDmgCalculation()
  86. end
  87. ultActive = GetTickCount() <= timeult+GetLatency()+50 or lastAnimation == "Spell4"
  88. if KCConfig.canstopult and ultActive and ts.target ~= nil then
  89. if KCDmgCalculation2(ts.target) > ts.target.health then ultActive, timeult = false, 0 end
  90. end
  91. if ts.target ~= nil then distancetarget = GetDistance(ts.target) end
  92. if KCConfig.harass and ts.target ~= nil and not ultActive then
  93. if KCConfig.harasscombo == 2 and RDY.E then CastSpell(_E,ts.target) end
  94. if RDY.Q then CastSpell(_Q, ts.target) end
  95. if KCConfig.harasscombo >= 1 then
  96. if RDY.W and distancetarget<375 and (((GetTickCount()-timeq>650 or GetTickCount()-lastqmark<650) and not RDY.Q) or not KCConfig.delayw) then CastSpell(_W) end
  97. end
  98. end
  99. if KCConfig.scriptActive and ts.target ~= nil and KCConfig.autoIgnite and RDY.I then
  100. local QWEDmg = KCDmgCalculation2(ts.target)
  101. local RDmg = (RDY.R and KCConfig.useult and distancetarget<=325) and getDmg("R",ts.target,myHero)*5 or 0
  102. local IDmg = getDmg("IGNITE",ts.target,myHero)
  103. if distancetarget<=600 and ts.target.health > QWEDmg+RDmg and ts.target.health <= IDmg+QWEDmg+RDmg then CastSpell(Slot.I, ts.target) end
  104. end
  105. if KCConfig.scriptActive and ts.target ~= nil and not ultActive then
  106. if RDY.DFG then CastSpell(Slot.DFG, ts.target) end
  107. if RDY.E then CastSpell(_E,ts.target) end
  108. if RDY.Q then CastSpell(_Q, ts.target) end
  109. if RDY.W and distancetarget<400 and (((GetTickCount()-timeq>650 or GetTickCount()-lastqmark<650) and not RDY.Q) or not KCConfig.delayw or (KCConfig.useult and RDY.R)) then CastSpell(_W) end
  110. if RDY.HXG then CastSpell(Slot.HXG, ts.target) end
  111. if RDY.BWC then CastSpell(Slot.BWC, ts.target) end
  112. if RDY.BRK then CastSpell(Slot.BRK, ts.target) end
  113. if RDY.STI and distancetarget<=380 then CastSpell(Slot.STI, myHero) end
  114. if RDY.RO and distancetarget<=500 then CastSpell(Slot.RO) end
  115. if RDY.R and KCConfig.useult and not RDY.Q and not RDY.W and not RDY.E and not RDY.DFG and not RDY.HXG and not RDY.BWC and not RDY.BRK and not RDY.STI and not RDY.RO and distancetarget<275 then
  116. timeult = GetTickCount()
  117. CastSpell(_R)
  118. end
  119. end
  120. end
  121. function KCDmgCalculation2(enemy)
  122. local distanceenemy = GetDistance(enemy)
  123. local qdamage = getDmg("Q",enemy,myHero)
  124. local qdamage2 = getDmg("Q",enemy,myHero,2)
  125. local wdamage = getDmg("W",enemy,myHero)
  126. local edamage = getDmg("E",enemy,myHero)
  127. local combo5 = 0
  128. if RDY.Q then
  129. combo5 = combo5 + qdamage
  130. if RDY.E or (distanceenemy<400 and RDY.W) then
  131. combo5 = combo5 + qdamage2
  132. end
  133. end
  134. if RDY.W and (RDY.E or distanceenemy<400) then
  135. combo5 = combo5 + wdamage
  136. end
  137. if RDY.E then
  138. combo5 = combo5 + edamage
  139. end
  140. return combo5
  141. end
  142. function KCDmgCalculation()
  143. local enemy = heroManager:GetHero(calculationenemy)
  144. if ValidTarget(enemy) then
  145. local qdamage = getDmg("Q",enemy,myHero)
  146. local qdamage2 = getDmg("Q",enemy,myHero,2)
  147. local wdamage = getDmg("W",enemy,myHero)
  148. local edamage = getDmg("E",enemy,myHero)
  149. local rdamage = getDmg("R",enemy,myHero) --xdagger (champion can be hit by a maximum of 10 daggers (2 sec))
  150. local hitdamage = getDmg("AD",enemy,myHero)
  151. local dfgdamage = (Slot.DFG and getDmg("DFG",enemy,myHero) or 0)--amplifies all magic damage they take by 20%
  152. local hxgdamage = (Slot.HXG and getDmg("HXG",enemy,myHero) or 0)
  153. local bwcdamage = (Slot.BWC and getDmg("BWC",enemy,myHero) or 0)
  154. local brkdamage = (Slot.BRK and getDmg("RUINEDKING",enemy,myHero,2) or 0)
  155. local ignitedamage = (Slot.I and getDmg("IGNITE",enemy,myHero) or 0)
  156. local onhitdmg = (Slot.Sheen and getDmg("SHEEN",enemy,myHero) or 0)+(Slot.Trinity and getDmg("TRINITY",enemy,myHero) or 0)+(Slot.LB and getDmg("LICHBANE",enemy,myHero) or 0)+(Slot.IG and getDmg("ICEBORN",enemy,myHero) or 0)
  157. local onspelldamage = (Slot.LT and getDmg("LIANDRYS",enemy,myHero) or 0)+(Slot.BT and getDmg("BLACKFIRE",enemy,myHero) or 0)
  158. local onspelldamage2 = 0
  159. local combo1 = hitdamage + (qdamage*2 + qdamage2*2 + wdamage*2 + edamage*2 + rdamage*10)*(RDY.DFG and 1.2 or 1) + onhitdmg + onspelldamage*4 --0 cd
  160. local combo2 = hitdamage + onhitdmg
  161. local combo3 = hitdamage + onhitdmg
  162. local combo4 = 0
  163. if RDY.Q then
  164. combo2 = combo2 + (qdamage + qdamage2)*(RDY.DFG and 2.2 or 2)
  165. combo3 = combo3 + (qdamage + qdamage2)*(RDY.DFG and 1.2 or 1)
  166. combo4 = combo4 + qdamage + (RDY.E and qdamage2 or 0)
  167. onspelldamage2 = onspelldamage2+1
  168. end
  169. if RDY.W then
  170. combo2 = combo2 + wdamage*(RDY.DFG and 2.2 or 2)
  171. combo3 = combo3 + wdamage*(RDY.DFG and 1.2 or 1)
  172. combo4 = combo4 + (RDY.E and wdamage or 0)
  173. onspelldamage2 = onspelldamage2+1
  174. end
  175. if RDY.E then
  176. combo2 = combo2 + edamage*(RDY.DFG and 2.2 or 2)
  177. combo3 = combo3 + edamage*(RDY.DFG and 1.2 or 1)
  178. combo4 = combo4 + edamage
  179. onspelldamage2 = onspelldamage2+1
  180. end
  181. if myHero:CanUseSpell(_R) ~= COOLDOWN and not myHero.dead then
  182. combo2 = combo2 + rdamage*10*(RDY.DFG and 1.2 or 1)
  183. combo3 = combo3 + rdamage*7*(RDY.DFG and 1.2 or 1)
  184. combo4 = combo4 + (RDY.E and rdamage*3 or 0)
  185. onspelldamage2 = onspelldamage2+1
  186. end
  187. if RDY.DFG then
  188. combo1 = combo1 + dfgdamage
  189. combo2 = combo2 + dfgdamage
  190. combo3 = combo3 + dfgdamage
  191. combo4 = combo4 + dfgdamage
  192. end
  193. if RDY.HXG then
  194. combo1 = combo1 + hxgdamage*(RDY.DFG and 1.2 or 1)
  195. combo2 = combo2 + hxgdamage*(RDY.DFG and 1.2 or 1)
  196. combo3 = combo3 + hxgdamage*(RDY.DFG and 1.2 or 1)
  197. combo4 = combo4 + hxgdamage
  198. end
  199. if RDY.BWC then
  200. combo1 = combo1 + bwcdamage*(RDY.DFG and 1.2 or 1)
  201. combo2 = combo2 + bwcdamage*(RDY.DFG and 1.2 or 1)
  202. combo3 = combo3 + bwcdamage*(RDY.DFG and 1.2 or 1)
  203. combo4 = combo4 + bwcdamage
  204. end
  205. if RDY.BRK then
  206. combo1 = combo1 + brkdamage
  207. combo2 = combo2 + brkdamage
  208. combo3 = combo3 + brkdamage
  209. combo4 = combo4 + brkdamage
  210. end
  211. if RDY.I then
  212. combo1 = combo1 + ignitedamage
  213. combo2 = combo2 + ignitedamage
  214. combo3 = combo3 + ignitedamage
  215. end
  216. combo2 = combo2 + onspelldamage*onspelldamage2
  217. combo3 = combo3 + onspelldamage/2 + onspelldamage*onspelldamage2/2
  218. combo4 = combo4 + onspelldamage
  219. if combo4 >= enemy.health then killable[calculationenemy] = 4
  220. elseif combo3 >= enemy.health then killable[calculationenemy] = 3
  221. elseif combo2 >= enemy.health then killable[calculationenemy] = 2
  222. elseif combo1 >= enemy.health then killable[calculationenemy] = 1
  223. else killable[calculationenemy] = 0 end
  224. end
  225. if calculationenemy == 1 then calculationenemy = heroManager.iCount
  226. else calculationenemy = calculationenemy-1 end
  227. end
  228. local timerstart = 0
  229. function OnProcessSpell(unit, spell)
  230. if unit.isMe and spell.name == "KatarinaQ" then timeq = GetTickCount() end
  231. end
  232. function OnCreateObj(object)
  233. if object.name:find("katarina_daggered") then lastqmark = GetTickCount() end
  234. end
  235. function OnAnimation(unit,animationName)
  236. if unit.isMe and lastAnimation ~= animationName then lastAnimation = animationName end
  237. end
  238. function OnDraw()
  239. if KCConfig.drawcircles and not myHero.dead then
  240. DrawCircle3D(myHero.x, myHero.y, myHero.z, range, 1, ARGB(255,25,255,18))
  241. if ts.target ~= nil then
  242. DrawCircle3D(ts.target.x, ts.target.y, ts.target.z, ts.target.boundingRadius, 8, ARGB(200,255,155,0), 20)
  243. end
  244. end
  245. for i=1, heroManager.iCount do
  246. local enemydraw = heroManager:GetHero(i)
  247. if ValidTarget(enemydraw) then
  248. if KCConfig.drawcircles then
  249. if killable[i] == 1 then
  250. DrawCircle3D(enemydraw.x, enemydraw.y, enemydraw.z, 30, 6, ARGB(155,0,0,255), 16)
  251. elseif killable[i] == 2 then
  252. DrawCircle3D(enemydraw.x, enemydraw.y, enemydraw.z, 10, 6, ARGB(155,255,0,0), 16)
  253. elseif killable[i] == 3 then
  254. DrawCircle3D(enemydraw.x, enemydraw.y, enemydraw.z, 10, 6, ARGB(155,255,0,0), 16)
  255. DrawCircle3D(enemydraw.x, enemydraw.y, enemydraw.z, 30, 6, ARGB(155,255,0,0), 16)
  256. elseif killable[i] == 4 then
  257. DrawCircle3D(enemydraw.x, enemydraw.y, enemydraw.z, 10, 6, ARGB(155,255,0,0), 16)
  258. DrawCircle3D(enemydraw.x, enemydraw.y, enemydraw.z, 30, 6, ARGB(155,255,0,0), 16)
  259. DrawCircle3D(enemydraw.x, enemydraw.y, enemydraw.z, 50, 6, ARGB(155,255,0,0), 16)
  260. end
  261. end
  262. if KCConfig.drawtext and waittxt[i] == 1 and killable[i] ~= 0 then
  263. PrintFloatText(enemydraw,0,floattext[killable[i]])
  264. end
  265. end
  266. if waittxt[i] == 1 then waittxt[i] = 30
  267. else waittxt[i] = waittxt[i]-1 end
  268. end
  269. end
  270. function OnWndMsg(msg,key)
  271. if key == ULTK and msg == KEY_DOWN then timeult = GetTickCount() end
  272. end
Add Comment
Please, Sign In to add comment