Advertisement
Koelion

Karma

May 11th, 2013
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.98 KB | None | 0 0
  1. if GetMyHero().charName ~= "Karma" then return end
  2.  
  3. -- Setting
  4.  
  5. local QRange = 950
  6. local WRange = 675
  7. local ERange = 800
  8. local RRange = 0
  9. local NRange = 525
  10. local comborange = 800
  11.  
  12. local eren = 400
  13.  
  14. abilitySequence = {1,3,2,1,1,4,1,3,3,1,4,3,3,2,2,4,2,2}
  15.  
  16.  
  17. local travelDuration = 0
  18. local predic = nil
  19.  
  20. local ignite = nil
  21. local DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot, TMTSlot, RAHSlot, RNDSlot, STDSlot = nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil
  22. local QREADY, WREADY, EREADY, RREADY, DFGREADY, HXGREADY, BWCREADY, IREADY, TMTREADY, RAHREADY, RNDREADY, STDREADY, BRKREADY = false, false, false, false, false, false, false, false, false, false, false, false, false
  23.  
  24. local ts
  25.  
  26. function OnLoad()
  27.  
  28. ts = TargetSelector(TARGET_LOW_HP,WRange,DAMAGE_MAGIC)
  29. ts.name = "Karma"
  30. Config = scriptConfig("LX Karma 0.1", "LX-Karma")
  31. Config:addParam("combo", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  32. Config:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  33. Config:addParam("autolvl","Automatic Level",SCRIPT_PARAM_ONOFF, true)
  34. Config:addParam("spamQ","Spam Q Enemy",SCRIPT_PARAM_ONOFF, true)
  35. Config:addParam("autoE","Auto E",SCRIPT_PARAM_ONOFF, true)
  36. Config:addParam("autoW","Auto W",SCRIPT_PARAM_ONOFF, true)
  37. Config:addParam("move","Auto Move to mice",SCRIPT_PARAM_ONOFF, true)
  38.  
  39. Config:addTS(ts)
  40.  
  41.  
  42. if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  43. elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2
  44. end
  45.  
  46. enemyMinions = minionManager(MINION_ENEMY, QRange, player)
  47. end
  48.  
  49. function OnTick()
  50. if Config.autolvl then
  51. if myHero:GetSpellData(_Q).level + myHero:GetSpellData(_W).level + myHero:GetSpellData(_E).level + myHero:GetSpellData(_R).level - 1< myHero.level then
  52. local spellSlot = { SPELL_1, SPELL_2, SPELL_3, SPELL_4, }
  53. local level = { 0, 0, 0, 1 }
  54. for i = 1, myHero.level, 1 do
  55. level[abilitySequence[i]] = level[abilitySequence[i]] + 1
  56. end
  57. for i, v in ipairs({ myHero:GetSpellData(_Q).level, myHero:GetSpellData(_W).level, myHero:GetSpellData(_E).level, myHero:GetSpellData(_R).level }) do
  58. if v < level[i] then LevelSpell(spellSlot[i]) end
  59. end
  60. end
  61. end
  62. DFGSlot, BRKSlot, HXGSlot, BWCSlot = GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144)
  63. DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  64. HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  65. BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  66. BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
  67. TMTREADY = (TMTSlot ~= nil and myHero:CanUseSpell(TMTSlot) == READY)
  68. RAHREADY = (RAHSlot ~= nil and myHero:CanUseSpell(RAHSlot) == READY)
  69. RNDREADY = (RNDSlot ~= nil and myHero:CanUseSpell(RNDSlot) == READY)
  70. QREADY = (myHero:CanUseSpell(_Q) == READY)
  71. WREADY = (myHero:CanUseSpell(_W) == READY)
  72. EREADY = (myHero:CanUseSpell(_E) == READY)
  73. RREADY = (myHero:CanUseSpell(_R) == READY)
  74. iReady = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  75.  
  76. ts:update()
  77. enemyMinions:update()
  78.  
  79. if ts.target ~= nil then
  80. travelDuration = (50 + GetDistance(myHero, ts.target))
  81. ts:SetPrediction(travelDuration)
  82. predic = ts.nextPosition
  83. end
  84.  
  85. if Config.spamQ then
  86. if ts.target ~= nil and QREADY then
  87. if predic ~= nil and GetDistance(predic) < QRange and not minionCollision(predic, 75, QRange) then
  88. if RREADY then
  89. CastSpell(_R)
  90. end
  91. CastSpell(_Q, predic.x, predic.z)
  92. end
  93. end
  94. end
  95.  
  96. if Config.autoE then
  97. if ts.target ~= nil and EREADY then
  98. if predic ~= nil and GetDistance(predic) < 300 then
  99. if RREADY then
  100. CastSpell(_R)
  101. end
  102. CastSpell(_E,myHero)
  103. end
  104. end
  105. end
  106.  
  107. if Config.autoW then
  108. if ts.target ~= nil and WREADY then
  109. if predic ~= nil and GetDistance(predic) < WRange then
  110. if RREADY then
  111. CastSpell(_R)
  112. end
  113. CastSpell(_W,ts.target)
  114. end
  115. end
  116. end
  117.  
  118. if Config.combo then
  119.  
  120. if Config.move then
  121. myHero:MoveTo(mousePos.x, mousePos.z)
  122. end
  123.  
  124. if ts.target ~= nil and comborange <= GetDistance(ts.target) then
  125.  
  126. if GetDistance(ts.target) < 598 then
  127.  
  128. if DFGREADY then CastSpell(DFGSlot, ts.target) end
  129. if HXGREADY then CastSpell(HXGSlot, ts.target) end
  130. if BWCREADY then CastSpell(BWCSlot, ts.target) end
  131. if BRKREADY then CastSpell(BRKSlot, ts.target) end
  132. if TMTREADY and GetDistance(ts.target) < 275 then CastSpell(TMTSlot) end
  133. if RAHREADY and GetDistance(ts.target) < 275 then CastSpell(RAHSlot) end
  134. if RNDREADY and GetDistance(ts.target) < 275 then CastSpell(RNDSlot) end
  135.  
  136. end
  137.  
  138. if WREADY then
  139. if GetDistance(ts.target) < WRange then
  140.  
  141. CastSpell(_W,ts.target)
  142. end
  143. end
  144.  
  145. if QREADY then
  146. if predic ~= nil and GetDistance(predic) < QRange and not minionCollision(predic, 75, QRange) then
  147. if RREADY and eren > GetDistance(ts.target) then
  148. CastSpell(_R)
  149. end
  150. CastSpell(_Q, predic.x, predic.z)
  151.  
  152. end
  153. end
  154.  
  155. if EREADY then
  156. if RREADY and eren <= GetDistance(ts.target) then
  157. CastSpell(_R)
  158. end
  159. CastSpell(_E,myHero)
  160.  
  161. end
  162.  
  163.  
  164.  
  165. end
  166. end
  167.  
  168. if iReady then
  169. local ignitedmg = 0
  170. for i = 1, heroManager.iCount, 1 do
  171. local enemyhero = heroManager:getHero(i)
  172. if ValidTarget(enemyhero,600) then
  173. ignitedmg = 50 + 20 * myHero.level
  174. if enemyhero.health <= ignitedmg then
  175. CastSpell(ignite, enemyhero)
  176. end
  177. end
  178. end
  179. end
  180.  
  181. end
  182.  
  183. function minionCollision(predic, width, range)
  184. for _, minionObjectE in pairs(enemyMinions.objects) do
  185. if predic ~= nil and player:GetDistance(minionObjectE) < range then
  186. ex = player.x
  187. ez = player.z
  188. tx = predic.x
  189. tz = predic.z
  190. dx = ex - tx
  191. dz = ez - tz
  192. if dx ~= 0 then
  193. m = dz/dx
  194. c = ez - m*ex
  195. end
  196. mx = minionObjectE.x
  197. mz = minionObjectE.z
  198. distanc = (math.abs(mz - m*mx - c))/(math.sqrt(m*m+1))
  199. if distanc < width and math.sqrt((tx - ex)*(tx - ex) + (tz - ez)*(tz - ez)) > math.sqrt((tx - mx)*(tx - mx) + (tz - mz)*(tz - mz)) then
  200. return true
  201. end
  202. end
  203. end
  204. return false
  205. end
  206.  
  207. function OnDraw()
  208. if Config.drawcircles and not myHero.dead then
  209.  
  210. QREADY = (myHero:CanUseSpell(_Q) == READY)
  211. WREADY = (myHero:CanUseSpell(_W) == READY)
  212. EREADY = (myHero:CanUseSpell(_E) == READY)
  213. RREADY = (myHero:CanUseSpell(_R) == READY)
  214.  
  215. if QREADY then
  216. Q = QRange
  217. else
  218. Q = 0
  219. end
  220.  
  221. if WREADY then
  222. W = WRange
  223. else
  224. W = 0
  225. end
  226.  
  227. if EREADY then
  228. E = ERange
  229. else
  230. E = 0
  231. end
  232.  
  233. N = NRange
  234.  
  235. HighestRange = math.max(Q,W,E,N)
  236. DrawCircle(myHero.x, myHero.y, myHero.z, HighestRange, 0x099B2299)
  237.  
  238. local coloraqua=ARGB(0xFF,0x00,0xFF,0xFF)
  239. DrawCircle(myHero.x, myHero.y, myHero.z, comborange, coloraqua)
  240.  
  241. if ValidTarget(ts.target) then
  242. DrawText("Targetting: " .. ts.target.charName, 18, 750, 40, 0xFFFF0000)
  243. for i=0, 10 do
  244. DrawCircle(ts.target.x, ts.target.y, ts.target.z, 60 + i*1.5, coloraqua)
  245. end
  246. end
  247. end
  248. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement