Advertisement
H3stia

Untitled

Dec 1st, 2013
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.17 KB | None | 0 0
  1. --[[
  2. I'M Leesin 0.2.8 by Klokje
  3. ================================================================================
  4.  
  5. Change log:
  6. 0.1:
  7. - Initial release
  8. - Added basic functions
  9.  
  10. 0.1.1
  11. - Small change insec combo
  12.  
  13. 0.1.2
  14. - Ward Drawings
  15. - Delay ward jump
  16.  
  17. 0.2
  18. - Added R Collision Killes
  19. - Delete ward jump <- added to other script
  20. - Rewrite some code
  21. - Added Minion and Jungle farm
  22. - Fixed a bug with passive use
  23. - Rewrote core
  24. - require "ImLib"
  25.  
  26. 0.2.1
  27. - fix some bugs
  28. - improve herras??
  29.  
  30. 0.2.2
  31. - Small change
  32.  
  33. 0.2.3
  34. - bug on purple side
  35. 0.2.3b
  36.  
  37. 0.2.4
  38. - With auto lib updater
  39. - Change buff stuff
  40.  
  41. 0.2.6
  42. - bug fix
  43.  
  44. 0.2.7
  45. - new prediction information.
  46.  
  47. 0.2.8
  48. - Fix baron bug
  49. 0.2.8a
  50. - Lib update
  51. ]]
  52.  
  53. -- Library --------------------------------------------------------------------------
  54. if myHero.charName ~= "LeeSin" then return end
  55.  
  56. function UpdateLib()
  57. local URL = "https://bitbucket.org/Klokje/public-klokjes-bol-scripts/raw/master/Common/ImLib.lua"
  58. local LIB_PATH = BOL_PATH.."Scripts\\Common\\ImLib.lua"
  59. DownloadFile(URL, LIB_PATH, function()
  60. if FileExist(LIB_PATH) then
  61. PrintChat("<font color='#FF0000'> >> LIB IS UPDATED! PRESS F9 2 TIME PLZ! <<</font>")
  62. end
  63. end)
  64. bNeedRestart = true
  65. end
  66.  
  67. if FileExist(SCRIPT_PATH..'Common/ImLib.lua') then require "ImLib" end
  68. if getLibversion == nil or getLibversion() < 0.24 then UpdateLib() return end
  69.  
  70. require "Collision"
  71. require "Prodiction"
  72. require 'FastCollision'
  73.  
  74. -- Globals --------------------------------------------------------------------------
  75. enemyHeroes = {}
  76.  
  77. qRange = 975
  78. qRangeSecond = 1100
  79. wRange = 700
  80. eRange = 350
  81. eRangeSecond = 600
  82. rRange = 375
  83.  
  84. passive = {stack = 0, endT = 0}
  85.  
  86. local Prodict = ProdictManager.GetInstance()
  87. local ProdictQ, ProdictQCol
  88.  
  89. --Dashes
  90. dash = {
  91. [_Q] = nil,
  92. [_W] = nil
  93. }
  94.  
  95. eStack = {}
  96. extraDamage = {}
  97. visionList = {}
  98.  
  99. qTarget = nil
  100. ignite = nil
  101. flash = nil
  102.  
  103.  
  104. -- Code -----------------------------------------------------------------------------
  105. function OnLoad()
  106. PrintChat(" >> I'M Leesin 0.2.8 by Klokje")
  107.  
  108. OrbWalking.Instance("I'M Leesin")
  109. Jumper.ability = _W
  110.  
  111. ssLastHitting = LastHitting()
  112.  
  113. ConfigBasic = scriptConfig("I'M Leesin: Basic Settings", "LeeSinBasic")
  114. ConfigBasic:addParam("Harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, 84)
  115. ConfigBasic:addParam("Insec", "Insec Combo", SCRIPT_PARAM_ONKEYDOWN, false, 67)
  116. ConfigBasic:addParam("Insecflash", "Flash with insec", SCRIPT_PARAM_ONOFF, true)
  117. ConfigBasic:addParam("Prediction", "Hitchange Q", SCRIPT_PARAM_SLICE, 50, 0, 100, 0)
  118.  
  119. ConfigCombo = scriptConfig("I'M Leesin: Combo Settings", "LeeSinCombo")
  120. ConfigCombo:addParam("combo", "Combo Key", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  121. ConfigCombo:addParam("useQ", "Use Q ", SCRIPT_PARAM_ONOFF, true)
  122. ConfigCombo:addParam("autoQ","Auto Second Q", SCRIPT_PARAM_ONOFF, true)
  123. ConfigCombo:addParam("useW", "Use W", SCRIPT_PARAM_ONOFF, false)
  124. ConfigCombo:addParam("autoW","Auto Second W", SCRIPT_PARAM_ONOFF, true)
  125. ConfigCombo:addParam("useE", "Use E", SCRIPT_PARAM_ONOFF, true)
  126. ConfigCombo:addParam("autoE","Auto Second E", SCRIPT_PARAM_ONOFF, true)
  127. ConfigCombo:addParam("useAA", "Use Auto Attacks", SCRIPT_PARAM_ONOFF, true)
  128.  
  129. ConfigKillCombo = scriptConfig("I'M Leesin: Kill Combo Settings", "LeeSinKill")
  130. ConfigKillCombo:addParam("useR", "Auto R on kill", SCRIPT_PARAM_ONOFF, true)
  131. ConfigKillCombo:addParam("combokiller", "Combo Killer", SCRIPT_PARAM_ONOFF, true)
  132. ConfigKillCombo:addParam("combo", "Kill without combo key", SCRIPT_PARAM_ONOFF, false)
  133. ConfigKillCombo:addParam("rcollision", "R collision killer", SCRIPT_PARAM_ONOFF, true)
  134. ConfigKillCombo:addParam("ward", "Use ward", SCRIPT_PARAM_ONOFF, true)
  135.  
  136. ConfigFarm = scriptConfig("I'M Leesin: Farm", "farming")
  137. ConfigFarm:addParam("Farm", "Farm Key", SCRIPT_PARAM_ONKEYDOWN, false, GetKey("A"))
  138. ConfigFarm:addParam("jungle", "Jungle Creeps", SCRIPT_PARAM_ONOFF, true)
  139. ConfigFarm:addParam("minions", "Minions", SCRIPT_PARAM_ONOFF, true)
  140.  
  141. ConfigDraw = scriptConfig("I'M Leesin: Draw Settings", "LeeSinDraw")
  142. ConfigDraw:addParam("DrawQ", "Draw Q range", SCRIPT_PARAM_ONOFF, false)
  143. ConfigDraw:addParam("DrawQColor", "Q Color", SCRIPT_PARAM_COLOR, {40, 0, 0, 100})
  144. ConfigDraw:addParam("DrawW", "Draw W range", SCRIPT_PARAM_ONOFF, false)
  145. ConfigDraw:addParam("DrawWColor", "W Color", SCRIPT_PARAM_COLOR, {40, 0, 20, 100})
  146. ConfigDraw:addParam("DrawE", "Draw E range", SCRIPT_PARAM_ONOFF, false)
  147. ConfigDraw:addParam("DrawEColor", "E Color", SCRIPT_PARAM_COLOR, {0, 20, 0, 100})
  148. ConfigDraw:addParam("DrawR", "Draw R range", SCRIPT_PARAM_ONOFF, false)
  149. ConfigDraw:addParam("DrawRColor", "R Color", SCRIPT_PARAM_COLOR, {0, 20, 40, 100})
  150. ConfigDraw:addParam("DrawPassive", "Draw Passive Stack", SCRIPT_PARAM_ONOFF, true)
  151. ConfigDraw:addParam("DrawPassiveColor", "Passive Color", SCRIPT_PARAM_COLOR, ColorARGB.Linen:ToTable())
  152. ConfigDraw:addParam("DrawTarget", "Draw Target", SCRIPT_PARAM_ONOFF, true)
  153. ConfigDraw:addParam("DrawTargetColor", "Target Color", SCRIPT_PARAM_COLOR, ColorARGB.DarkRed:ToTable())
  154.  
  155. sp = Spells()
  156.  
  157. if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  158. elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end
  159. if myHero:GetSpellData(SUMMONER_1).name:find("SummonerFlash") then flash = SUMMONER_1
  160. elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerFlash") then flash = SUMMONER_2 end
  161.  
  162.  
  163. ProdictQ = Prodict:AddProdictionObject(_Q, qRange, 1800, 0.250, 60, myHero, CastQ)
  164. ProdictQCol = FastCol(ProdictQ)
  165. end
  166.  
  167. function OnTick()
  168. enemyHeroes = Heroes({team = {TEAM_ENEMY}, range = 2000})
  169. table.sort(enemyHeroes, EnemySort)
  170.  
  171. local currentTarget = GetTarget()
  172.  
  173. if currentTarget ~= nil and currentTarget.type == "obj_AI_Hero" and ValidTarget(currentTarget, 2000, true) then
  174. selected = currentTarget
  175. else
  176. selected = nil
  177. end
  178.  
  179. if KillCombo() then return
  180. elseif CollisionKiller() then return
  181. elseif InSecCombo() then return
  182. elseif Herras() then return
  183. elseif CollisionKiller() then return
  184. elseif Combo() then return
  185. elseif AutoAll() then return
  186. end
  187. end
  188.  
  189. function OnDraw()
  190. if selected and ConfigDraw.DrawTarget then
  191. DrawCircle(selected.x, selected.y, selected.z, 100, ColorARGB.FromTable(ConfigDraw.DrawTargetColor))
  192. DrawCircle(selected.x, selected.y, selected.z, 99, ColorARGB.DarkBlue:ToARGB())
  193. end
  194.  
  195. if ConfigDraw.DrawQ and not myHero.dead then
  196. if spell[_Q]:Ready() == 1 then
  197. DrawCircle(myHero.x, myHero.y, myHero.z, qRange+50, ColorARGB.FromTable(ConfigDraw.DrawQColor))
  198. elseif spell[_Q]:Ready(2) == 1 then
  199. DrawCircle(myHero.x, myHero.y, myHero.z, qRangeSecond+50, ColorARGB.FromTable(ConfigDraw.DrawQColor))
  200. end
  201. end
  202.  
  203. if ConfigDraw.DrawW and not myHero.dead and spell[_W]:Ready() == 1 then
  204. DrawCircle(player.x, player.y, player.z, wRange, ColorARGB.FromTable(ConfigDraw.DrawWColor))
  205. end
  206.  
  207. if ConfigDraw.DrawE and not myHero.dead then
  208. if spell[_E]:Ready() == 1 then
  209. DrawCircle(myHero.x, myHero.y, myHero.z, eRange, ColorARGB.FromTable(ConfigDraw.DrawEColor))
  210. elseif spell[_E]:Ready(2) == 1 then
  211. DrawCircle(myHero.x, myHero.y, myHero.z, eRangeSecond, ColorARGB.FromTable(ConfigDraw.DrawEColor))
  212. end
  213. end
  214.  
  215. if ConfigDraw.DrawR and not myHero.dead and spell[_R]:Ready() == 1 then
  216. DrawCircle(myHero.x, myHero.y, myHero.z, rRange, ColorARGB.FromTable(ConfigDraw.DrawRColor)) -- ColorARGB(0, 20, 40, 100):ToARGB() --ColorARGB.DarkRed:ToARGB()
  217. end
  218.  
  219. if ConfigDraw.DrawPassive and not myHero.dead and passive.stack ~= 0 then
  220. local pos = WorldToScreen(D3DXVECTOR3(myHero.x, myHero.y, myHero.z))
  221. Message.DrawTextWithBorder(tostring(passive.stack), 50, pos.x- 15, pos.y - 100, ColorARGB.FromTable(ConfigDraw.DrawPassiveColor), ColorARGB.Black:ToARGB())
  222. end
  223. end
  224.  
  225. function OnGainBuff(unit, buff)
  226. if unit == nil or buff == nil or buff.name == nil then return end
  227.  
  228. if unit.team ~= myHero.team and buff.name == "BlindMonkEOne"then
  229. eStack[unit.networkID] = unit
  230. end
  231.  
  232. if unit.isMe and buff.name == "blindmonkpassive_cosmetic" then
  233. passive.stack = buff.stack
  234. passive.endT = buff.endT
  235. end
  236.  
  237. if buff.source and buff.source.isMe and buff.name:lower():find("blindmonkqone") then
  238. qTarget = unit
  239. if p == true then
  240. spell[_Q]:Cast()
  241. p = false
  242. end
  243. end
  244.  
  245. if unit.isMe and buff.name == "blindmonkqtwodash" then
  246. dash[_Q] = buff.source
  247. end
  248.  
  249. if unit.isMe and buff.name == "blindmonkwonedash" then
  250. dash[_W] = buff.source
  251. end
  252. end
  253.  
  254. function OnUpdateBuff(unit, buff)
  255. if unit.isMe and buff.name == "blindmonkpassive_cosmetic" then
  256. passive.stack = buff.stack
  257. passive.endT = buff.endT
  258. end
  259. end
  260.  
  261. function OnLoseBuff(unit, buff)
  262. if unit == nil or buff == nil or buff.name == nil then return end
  263.  
  264. if unit.team ~= myHero.team and buff.name == "BlindMonkEOne" then
  265. eStack[unit.networkID] = nil
  266. end
  267.  
  268. if unit.isMe and buff.name == "blindmonkpassive_cosmetic" then
  269. passive.stack = 0
  270. passive.endT = 0
  271. end
  272.  
  273. if unit.team ~= myHero.team and buff.name:lower():find("blindmonkqone") then
  274. qTarget = nil
  275. end
  276.  
  277. if unit.isMe and buff.name == "blindmonkqtwodash" then
  278. dash[_Q] = nil
  279. end
  280.  
  281. if unit.isMe and buff.name == "blindmonkwonedash" then
  282. dash[_W] = nil
  283. end
  284. end
  285.  
  286. function IsValid(target)
  287. if visionList[target.networkID] == nil then
  288. return true
  289. elseif target.type == myHero.type and (GetGameTimer() - visionList[target.networkID] > 0.125) then
  290. return true
  291. else
  292. return false
  293. end
  294. end
  295. function OnLoseVision(unit)
  296. if unit and unit.type == myHero.type and unit.team ~= myHero.team then
  297. visionList[unit.networkID] = math.huge
  298. end
  299. end
  300. function OnGainVision(unit)
  301. if unit and unit.type == myHero.type and unit.team ~= myHero.team then
  302. visionList[unit.networkID] = GetGameTimer()
  303. end
  304. end
  305.  
  306.  
  307. -- Main Functions ----------------------------------------------------------------------
  308. function KillCombo()
  309. if not ConfigKillCombo.combokiller then return false end
  310.  
  311. OrbWalking.Enable(false)
  312. if ConfigKillCombo.combo or ConfigCombo.combo then
  313. if ComboHasQ() then OrbWalking.Enable(true) return true end
  314. if ComboHasNoQ() then OrbWalking.Enable(true) return true end
  315. end
  316.  
  317. for i, target in ipairs(enemyHeroes) do
  318. if ConfigKillCombo.useR then AutoR(target) end
  319. end
  320. OrbWalking.Enable(true)
  321. return false
  322. end
  323.  
  324. function ComboHasQ()
  325. if spell[_Q]:Ready(2) == 1 and qTarget~= nil and 30 <= myHero.mana then
  326. local rDmg = getDmg("R", qTarget, player)
  327. local qDmg = getDmg("Q", qTarget, player, 1)
  328. local aDmg = getDmg("AD",qTarget, player)
  329. local eDmg = getDmg("E", qTarget, player)
  330. local onhitDmg = aDmg
  331. local ignitedmg = 0
  332.  
  333. if ignite ~= nil and myHero:CanUseSpell(ignite) == READY then ignitedmg = getDmg("IGNITE", qTarget, player) end
  334.  
  335. local reg = 0
  336. local extra = 0
  337. for i, damage in pairs(extraDamage) do
  338. if damage.time > GetGameTimer() then
  339. if qTarget.networkID == damage.dtarget then
  340. extra = extra + (math.floor((damage.dmg/5)*(damage.time - GetGameTimer())) - (damage.dmg/5))
  341. extra = extra - ((qTarget.hpRegen/5) * (6 - (damage.time - GetGameTimer())))
  342. end
  343. else
  344. table.remove(extraDamage, i)
  345. i = i - 1
  346. end
  347. end
  348.  
  349. local health = qTarget.health + (((qTarget.hpRegen/5) * 3) - extra) + 50
  350. if health < 0 then health = math.huge end
  351.  
  352. if GetDistance(qTarget) <= qRange then
  353. if health <= QSecondDamage(0, qTarget) then spell[_Q]:Cast() return true
  354. elseif ignitedmg > 0 and health <= QSecondDamage(0, qTarget) + ignitedmg and GetDistance(qTarget) <= 600 then
  355. CastSpell(ignite, qTarget)
  356. table.insert(extraDamage, {dmg = ignitedmg, dtarget = qTarget, time = GetGameTimer() + 5})
  357. spell[_Q]:Cast()
  358. return true
  359. end
  360. end
  361.  
  362. if spell[_E]:Ready() == 1 and 80 <= myHero.mana then
  363. if health<= eDmg + QSecondDamage(eDmg, qTarget) and GetDistance(qTarget) <= eRange then
  364. spell[_E]:Cast()
  365. spell[_Q]:Cast()
  366. return true
  367. elseif health<= eDmg + QSecondDamage(0, qTarget) and GetDistance(qTarget) > eRange then
  368. spell[_Q]:Cast()
  369. return true
  370. elseif ignitedmg > 0 and health<= eDmg + QSecondDamage(eDmg, qTarget) + ignitedmg and GetDistance(qTarget) <= eRange then
  371. CastSpell(ignite, qTarget)
  372. table.insert(extraDamage, {dmg = ignitedmg, dtarget = qTarget, time = GetGameTimer() + 5})
  373. spell[_E]:Cast()
  374. spell[_Q]:Cast()
  375. return true
  376. elseif ignitedmg > 0 and health<= eDmg + QSecondDamage(0, qTarget) + ignitedmg and GetDistance(qTarget) > eRange then
  377. CastSpell(ignite, qTarget)
  378. table.insert(extraDamage, {dmg = ignitedmg, dtarget = qTarget, time = GetGameTimer() + 5})
  379. spell[_Q]:Cast()
  380. return true
  381. end
  382. end
  383.  
  384. if spell[_R]:Ready() == 1 then
  385. if health <= rDmg + QSecondDamage(rDmg, qTarget) and GetDistance(qTarget) <= rRange then
  386. spell[_R]:Cast(qTarget)
  387. spell[_Q]:Cast()
  388. return true
  389. elseif health<= rDmg + QSecondDamage(0, qTarget) and GetDistance(qTarget) > rRange then
  390. spell[_Q]:Cast()
  391. return true
  392. elseif ignitedmg > 0 and health<= rDmg + QSecondDamage(rDmg, qTarget) + ignitedmg and GetDistance(qTarget) <= rRange then
  393. CastSpell(ignite, qTarget)
  394. table.insert(extraDamage, {dmg = ignitedmg, dtarget = qTarget, time = GetGameTimer() + 5})
  395. spell[_R]:Cast(qTarget)
  396. spell[_Q]:Cast()
  397. return true
  398. elseif ignitedmg > 0 and health<= rDmg + QSecondDamage(0, qTarget) + ignitedmg and GetDistance(qTarget) > rRange and GetDistance(qTarget) <= 600 then
  399. CastSpell(ignite, qTarget)
  400. table.insert(extraDamage, {dmg = ignitedmg, dtarget = qTarget, time = GetGameTimer() + 5})
  401. spell[_Q]:Cast()
  402. return true
  403. end
  404. end
  405.  
  406. if spell[_E]:Ready() == 1 and spell[_R]:Ready() == 1 and 80 <= myHero.mana then
  407. if health<= eDmg + rDmg + QSecondDamage(eDmg+rDmg, qTarget) and GetDistance(qTarget) <= eRange then
  408. spell[_E]:Cast()
  409. spell[_R]:Cast(qTarget)
  410. spell[_Q]:Cast()
  411. return true
  412. elseif health<= eDmg + QSecondDamage(rDmg, qTarget) + rDmg and GetDistance(qTarget) <= rRange then
  413. spell[_R]:Cast(qTarget)
  414. spell[_Q]:Cast()
  415. return true
  416. elseif health<= eDmg + QSecondDamage(0, qTarget) + rDmg and GetDistance(qTarget) > rRange then
  417. spell[_Q]:Cast()
  418. return true
  419. elseif ignitedmg > 0 and health<= eDmg + QSecondDamage(eDmg+rDmg, qTarget) + rDmg + ignitedmg and GetDistance(qTarget) <= eRange then
  420. CastSpell(ignite, qTarget)
  421. table.insert(extraDamage, {dmg = ignitedmg, dtarget = qTarget, time = GetGameTimer() + 5})
  422. spell[_E]:Cast()
  423. spell[_R]:Cast(qTarget)
  424. spell[_Q]:Cast()
  425. return true
  426. elseif ignitedmg > 0 and health<= eDmg + QSecondDamage(rDmg, qTarget) + rDmg + ignitedmg and GetDistance(qTarget) <= rRange then
  427. CastSpell(ignite, qTarget)
  428. table.insert(extraDamage, {dmg = ignitedmg, dtarget = qTarget, time = GetGameTimer() + 5})
  429. spell[_R]:Cast(qTarget)
  430. spell[_Q]:Cast()
  431. return true
  432. elseif ignitedmg > 0 and health<= eDmg + QSecondDamage(0, qTarget) + rDmg + ignitedmg and GetDistance(qTarget) > rRange and GetDistance(qTarget) <= 600 then
  433. CastSpell(ignite, qTarget)
  434. table.insert(extraDamage, {dmg = ignitedmg, dtarget = qTarget, time = GetGameTimer() + 5})
  435. spell[_Q]:Cast()
  436. return true
  437. end
  438. end
  439. end
  440. end
  441.  
  442. function ComboHasNoQ()
  443. for i, target in ipairs(enemyHeroes) do
  444.  
  445. if OrbWalking.CanAttack() then
  446. local rDmg = getDmg("R", target, player)
  447. local qDmg = getDmg("Q", target, player, 1)
  448. local aDmg = getDmg("AD",target, player)
  449. local eDmg = getDmg("E", target, player)
  450.  
  451. local onhitDmg = aDmg
  452. local ignitedmg = 0
  453.  
  454. if ignite ~= nil and myHero:CanUseSpell(ignite) == READY then ignitedmg = getDmg("IGNITE", target, player) end
  455.  
  456. local reg = 0
  457. local extra = 0
  458. for i, damage in pairs(extraDamage) do
  459. if damage.time > GetGameTimer() then
  460. if target.networkID == damage.dtarget then
  461. extra = extra + (math.floor((damage.dmg/5)*(damage.time - GetGameTimer())) - (damage.dmg/5))
  462. extra = extra - ((target.hpRegen/5) * (1 - (damage.time - GetGameTimer())))
  463. end
  464. else
  465. table.remove(extraDamage, i)
  466. i = i - 1
  467. end
  468. end
  469.  
  470. local health = target.health + (((target.hpRegen/5) * 3) - extra) + 50
  471. if health < 0 then health = math.huge end
  472.  
  473. if spell[_E]:Ready() == 1 then
  474. if GetDistance(target) <= eRange then
  475. if health<= eDmg then spell[_E]:Cast() return true
  476. elseif ignitedmg > 0 and health <= eDmg + ignitedmg then spell[_E]:Cast() CastSpell(ignite, target) table.insert(extraDamage, {dmg = ignitedmg, dtarget = target, time = GetGameTimer() + 5}) return true end
  477. elseif spell[_W]:Ready() == 1 and GetDistance(target) <= 700 + eRange - 100 and (health<= eDmg or (ignitedmg > 0 and health <= eDmg + ignitedmg)) then
  478. local JCheck, obj = ComboJump(target, eRange - 100)
  479. if JCheck and GetDistance(obj) < 700 then
  480. spell[_W]:Cast(obj)
  481. return
  482. end
  483. end
  484. end
  485.  
  486. if spell[_R]:Ready() == 1 then
  487. if GetDistance(target) < rRange then
  488. if health<= rDmg then spell[_R]:Cast(target) return true end
  489. if ignitedmg > 0 and health<= rDmg + ignitedmg then CastSpell(ignite, target) spell[_R]:Cast(target) table.insert(extraDamage, {dmg = ignitedmg, dtarget = target, time = GetGameTimer() + 5}) return true end
  490. elseif spell[_W]:Ready() == 1 and GetDistance(target) <= 700 + rRange - 100 and (health<= rDmg or (ignitedmg > 0 and health<= rDmg + ignitedmg)) then
  491. local JCheck, obj = ComboJump(target, rRange - 100)
  492. if JCheck and GetDistance(obj) < 700 then
  493. spell[_W]:Cast(obj)
  494. return
  495. end
  496. end
  497. end
  498.  
  499. if spell[_E]:Ready() == 1 and spell[_R]:Ready() == 1 then
  500. if GetDistance(target) <= eRange then
  501. if health<= eDmg + rDmg then spell[_E]:Cast() spell[_R]:Cast(target) return true
  502. elseif ignitedmg > 0 and health <= eDmg + rDmg + ignitedmg then CastSpell(ignite, target) spell[_E]:Cast() spell[_R]:Cast(target) table.insert(extraDamage, {dmg = ignitedmg, dtarget = target, time = GetGameTimer() + 5}) return true end
  503. elseif spell[_W]:Ready() == 1 and GetDistance(target) <= 700 + eRange - 100 and (health<= eDmg + rDmg or (ignitedmg > 0 and health <= eDmg + rDmg + ignitedmg)) then
  504. local JCheck, obj = ComboJump(target, eRange - 100)
  505. if JCheck and GetDistance(obj) < 700 then
  506. spell[_W]:Cast(obj)
  507. return
  508. end
  509. end
  510. end
  511.  
  512.  
  513. if spell[_Q]:Ready() == 1 then
  514. if health <= qDmg + ignitedmg and 50 <= myHero.mana then CastQ(myHero, target) return true end
  515. if health <= qDmg + QSecondDamage(qDmg, target) + ignitedmg and 80 <= myHero.mana then CastQ(myHero, target) return true end
  516.  
  517. if spell[_E]:Ready() == 1 then
  518. if health<= qDmg + eDmg + ignitedmg and 100 <= myHero.mana and GetDistance(target) < eRange then spell[_E]:Cast() CastQ(myHero, target) return true end
  519. if health<= qDmg + eDmg + QSecondDamage(qDmg + eDmg, target) + ignitedmg and 130 <= myHero.mana and GetDistance(target) < eRange then spell[_E]:Cast() CastQ(myHero, target) return true end
  520. if health<= qDmg + eDmg + QSecondDamage(qDmg, target) + ignitedmg and 130 <= myHero.mana and GetDistance(target) >= eRange then CastQ(myHero, target) return true end
  521. end
  522. if spell[_R]:Ready() == 1 then
  523. if health<= qDmg + rDmg + ignitedmg and 50 <= myHero.mana and GetDistance(target) < rRange then CastQ(myHero, target) return true end
  524. if health<= qDmg + rDmg + QSecondDamage(qDmg + rDmg, target) + ignitedmg and 80 <= myHero.mana and GetDistance(target) < rRange then CastQ(myHero, target) return true end
  525. if health<= qDmg + rDmg + QSecondDamage(qDmg, target) + ignitedmg and 80 <= myHero.mana and GetDistance(target) < rRange then CastQ(myHero, target) return true end
  526. end
  527. if spell[_E]:Ready() == 1 and spell[_R]:Ready() == 1 then
  528. if health<= qDmg+eDmg+rDmg + QSecondDamage(qDmg+eDmg, target) + ignitedmg then CastQ(myHero, target) return true end
  529. if health<= qDmg+eDmg+rDmg + QSecondDamage(qDmg+rDmg, target) + ignitedmg then CastQ(myHero, target) return true end
  530. if health<= qDmg+eDmg+rDmg + QSecondDamage(qDmg+eDmg+rDmg, target) + ignitedmg then CastQ(myHero, target) return true end
  531. end
  532. end
  533. end
  534. end
  535. return false
  536. end
  537.  
  538. function Combo()
  539. AutoPassive()
  540. end
  541.  
  542. function InSecCombo()
  543. if not ConfigBasic.Insec then return false end
  544.  
  545. if myHero:GetSpellData(_R).level < 1 then Message.AddMassage("Error: R level to low.", ColorARGB.Red) return false end
  546.  
  547. champs = Heroes({team = {TEAM_ENEMY}, range = 2000})
  548. table.sort(champs, InsecSort)
  549. local target
  550. local flashtarget = nil
  551.  
  552. if selected and selected.bTargetable and not selected.dead then
  553. target = selected
  554. flashtarget = selected
  555. elseif #champs > 0 then
  556. target = champs[1]
  557. elseif target == nil then
  558. Message.AddMassage("Error: No Enemy Around.", ColorARGB.Red)
  559. return false
  560. else
  561. Message.AddMassage("Error: No Enemy Around.", ColorARGB.Red)
  562. return false
  563. end
  564.  
  565. if spell[_R]:Ready() ~= 1 then Message.AddMassage("Error: R on Cooldown", ColorARGB.Red) return false end
  566. local wardPos = GetWardPosition(target)
  567. if wardPos == nil then return false end
  568.  
  569. if GetDistance(wardPos) < 200 then spell[_R]:Cast(target) return true end
  570.  
  571. if spell[_Q]:Ready(2) == 1 and spell[_W]:Ready() == 1 and 80 <= myHero.mana and qTarget ~= nil and GetDistance(qTarget, wardPos) <= 600 and GetDistance(wardPos) > 600 then
  572. if Jumper.GetWardSlot() ~= nil or (InsecFlash() and GetDistance(qTarget, wardPos) <= 400) then
  573. spell[_Q]:Cast(nil,nil, 2)
  574. return true
  575. end
  576. end
  577.  
  578. if spell[_Q]:Ready() == 1 and spell[_W]:Ready() == 1 and 130 <= myHero.mana and qTarget == nil and GetDistance(wardPos) > 600 then
  579. local bCheck, pos = CanCastQ(myHero, target)
  580. if bCheck then spell[_Q]:Cast(pos.x,pos.z) return true end
  581. end
  582.  
  583. if spell[_W]:Ready() == 1 and GetDistance(wardPos) <= 600 and 130 <= myHero.mana then
  584. local jCheck, obj = CheckObject(wardPos, 200)
  585. if jCheck then
  586. if GetDistance(obj) <= 600 then
  587. spell[_W]:Cast(obj)
  588. return true
  589. end
  590. else
  591. if Jumper.GetWardSlot() ~= nil then
  592. Jumper.PlaceWard(wardPos.x, wardPos.z)
  593. return true
  594. end
  595. end
  596. elseif InsecFlash() and GetDistance(wardPos) <= 400 and dash[_W] ~= nil then
  597. CastSpell(flash, wardPos.x, wardPos.z)
  598. spell[_R]:Cast(target)
  599. end
  600.  
  601. end
  602.  
  603. function InsecFlash()
  604. return ConfigBasic.Insecflash and flash and myHero:CanUseSpell(flash) == READY
  605. end
  606.  
  607.  
  608. function CollisionKiller()
  609. if not ConfigKillCombo.rcollision then return true end
  610. for i, target in ipairs(enemyHeroes) do
  611. if GetDistance(target) < 375 then
  612. for i, unit in ipairs(enemyHeroes) do
  613. local rDmg = getDmg("R", target, player)
  614. if unit.networkID ~= target.networkID and unit.health < rDmg and GetDistance(target,unit) < 700 then
  615. local QPrediction = TargetPredictionVIP(1000, 1250, 0.25, getHitBox(target), target)
  616. local pos, t, vec = QPrediction:GetPrediction(unit)
  617. if pos then
  618. local V = Vector(target) - Vector(myHero)
  619. local k = V:normalized()
  620. local P = V:perpendicular2():normalized()
  621.  
  622. local t,i,u = k:unpack()
  623. local x,y,z = P:unpack()
  624.  
  625. local point1 = target.x + (x * (getHitBox(target))) + (t * 1000)
  626. local point2 = target.y + (y * (getHitBox(target))) + (i * 1000)
  627. local point3 = target.z + (z * (getHitBox(target))) + (u * 1000)
  628.  
  629. local point4 = target.x + (x *(getHitBox(target))) + (t * getHitBox(target))
  630. local point5 = target.y + (y *(getHitBox(target))) + (i * getHitBox(target))
  631. local point6 = target.z + (z * (getHitBox(target))) + (u *getHitBox(target))
  632.  
  633. local lpoint1 = target.x - (x * (getHitBox(target))) + (t * 1000)
  634. local lpoint2 = target.y - (y * (getHitBox(target)))+ (i * 1000)
  635. local lpoint3 = target.z - (z * (getHitBox(target)))+ (u * 1000)
  636.  
  637. local lpoint4 = target.x - (x * (getHitBox(target))) + (t * getHitBox(target))
  638. local lpoint5 = target.y - (y * (getHitBox(target))) + (i * getHitBox(target))
  639. local lpoint6 = target.z - (z * (getHitBox(target))) + (u * getHitBox(target))
  640.  
  641. local c = WorldToScreen(D3DXVECTOR3(point1, point2, point3))
  642. local l = WorldToScreen(D3DXVECTOR3(point4, point5, point6))
  643. local cl = WorldToScreen(D3DXVECTOR3(lpoint1, lpoint2, lpoint3))
  644. local ll = WorldToScreen(D3DXVECTOR3(lpoint4, lpoint5, lpoint6))
  645.  
  646. local poly = Polygon(Point(c.x, c.y), Point(l.x, l.y), Point(cl.x, cl.y), Point(ll.x, ll.y))
  647.  
  648.  
  649. local b = WorldToScreen(D3DXVECTOR3(pos.x, unit.y, pos.z))
  650. local po = Point(b.x, b.y)
  651. if poly:contains(po) and GetDistance(target) < 550 then
  652. CastSpell(_R, target)
  653. return true
  654. end
  655. end
  656. end
  657. end
  658. end
  659. end
  660. return false
  661. end
  662.  
  663. function Herras()
  664. if not ConfigBasic.Harass then return false end
  665.  
  666. if spell[_Q]:Ready(2) == 1 and 80 <= myHero.mana and qTarget ~= nil then
  667. if qTarget.type == myHero.type then
  668. local jCheck, objs = CanJump(target)
  669. if jCheck then
  670. spell[_Q]:Cast()
  671. return
  672. end
  673. end
  674. end
  675.  
  676. for i, target in ipairs(enemyHeroes) do
  677. if spell[_Q]:Ready() == 1 and spell[_W]:Ready() == 1 and 120 <= myHero.mana and qTarget == nil then
  678. local bCheck, pos = CanCastQ(myHero, target)
  679. if bCheck then
  680. local jCheck, obj = CanJump(target)
  681. if jCheck then
  682. spell[_Q]:Cast(pos.x, pos.z)
  683. return
  684. end
  685. end
  686. end
  687.  
  688. if spell[_Q]:Ready(1) == 0 and spell[_Q]:IsCasted(2) and spell[_W]:Ready() == 1 and not dash[_Q] and GetDistance(target) < 150 then
  689. local jCheck, objs = CanJump(target)
  690. if jCheck then
  691. spell[_W]:Cast(objs)
  692. return
  693. end
  694. end
  695. end
  696. end
  697.  
  698. function Farm()
  699. if not ConfigFarm.Farm then ssLastHitting:Enable(false) return end
  700.  
  701. if ConfigFarm.minions then ssLastHitting:Enable(true)
  702. else ssLastHitting:Enable(false) end
  703.  
  704. if ConfigFarm.jungle then
  705. jungle = Minions({team = {TEAM_NEUTRAL}, range = 450})
  706. table.sort(jungle, function(x, y)
  707. local aDmg = x:CalcDamage(myHero,x.totalDamage)
  708. local bDmg = y:CalcDamage(myHero,y.totalDamage)
  709. if aDmg == bDmg then return x.health < y.health end
  710. return aDmg > bDmg
  711. end)
  712. for i, target in ipairs(jungle) do
  713. --PrintChat(tostring(target.parType))
  714. if GetDistance(target) <= myHero.range + getHitBox(target) + 150 then
  715. if OrbWalking.Attack(target) then
  716. return true
  717. end
  718.  
  719. if spell[_E]:Ready() == 2 or spell[_Q]:Ready() == 2 or spell[_W]:Ready() == 2 then return false end
  720.  
  721. if spell[_E]:Ready() == 1 and HaveNoStack() and GetDistance(target) < 350 + getHitBoxRadius(target) then
  722. spell[_E]:Cast()
  723. return true
  724. end
  725.  
  726. if spell[_E]:Ready() == 2 or spell[_Q]:Ready() == 2 or spell[_W]:Ready() == 2 then return false end
  727. if AutoPassiveE() then return true end
  728.  
  729.  
  730. if spell[_E]:Ready(2) == 2 or spell[_Q]:Ready() == 2 then return false end
  731. if spell[_Q]:Ready() == 1 and passive.stack == 0 and GetDistance(target) > 100 then
  732. spell[_Q]:Cast(target.x, target.z)
  733. return true
  734. end
  735.  
  736. if spell[_Q]:Ready(2) == 1 and ((passive.stack == 0 or GetGameTimer() - spell[_Q].starttime > 3 - Delay()) or (qTarget and qTarget.health < QSecondDamage(0, qTarget))) then
  737. spell[_Q]:Cast()
  738. return true
  739. end
  740.  
  741. if spell[_E]:Ready() == 2 or spell[_Q]:Ready() == 2 or spell[_W]:Ready() == 2 then return false end
  742.  
  743. if spell[_W]:Ready() == 1 and passive.stack == 0 then
  744. spell[_W]:Cast(myHero)
  745. return true
  746. end
  747.  
  748. if spell[_W]:Ready(2) == 1 and (passive.stack == 0 or GetGameTimer() - spell[_W].starttime > 3 - Delay()) then
  749. spell[_W]:Cast()
  750. return true
  751. end
  752. end
  753. end
  754. end
  755. end
  756.  
  757. -- Functions -------------------------------------------------------------------------
  758. function AutoAll()
  759. if not ConfigCombo.combo and not ConfigFarm.Farm then OrbWalking.Enable(false) ssLastHitting:Enable(false) return end
  760. OrbWalking.Enable(true)
  761.  
  762. if ConfigCombo.combo then
  763. ssLastHitting:Enable(false)
  764. if selected and selected.bTargetable and not selected.dead then
  765. if not IsValid(selected) then return false end
  766. if ConfigCombo.useAA and GetDistance(selected) <= myHero.range + getHitBox(selected) + 50 and OrbWalking.Attack(selected) then
  767. return
  768. end
  769. if spell[_W]:Ready() == 2 or spell[_Q]:Ready() == 2 or spell[_E]:Ready() == 2 then return end
  770. if ConfigCombo.useE then AutoE(selected) end
  771. if ConfigCombo.useW then AutoW(selected) end
  772. if ConfigCombo.useQ then AutoQ(selected) end
  773. else
  774. for i, target in ipairs(enemyHeroes) do
  775. if IsValid(target) then
  776. if ConfigCombo.useAA and GetDistance(target) <= myHero.range + getHitBox(target)+ 50 and OrbWalking.Attack(target) then
  777. return
  778. end
  779. if spell[_W]:Ready() == 2 or spell[_Q]:Ready() == 2 or spell[_E]:Ready() == 2 then return end
  780. if ConfigCombo.useE then AutoE(target) end
  781. if ConfigCombo.useQ then AutoQ(target) end
  782. if ConfigCombo.useW then AutoW(target) end
  783. end
  784. end
  785. end
  786. else
  787. Farm()
  788. end
  789. end
  790.  
  791.  
  792. function AutoPassive()
  793. if not ConfigCombo.combo then return end
  794.  
  795. if spell[_W]:Ready(2) == 2 or spell[_Q]:Ready(2) == 2 or spell[_E]:Ready(2) == 2 then return end
  796.  
  797. if ConfigCombo.autoE then AutoPassiveE() end
  798. if ConfigCombo.autoW then AutoPassiveW() end
  799. if ConfigCombo.autoQ then AutoPassiveQ() end
  800. end
  801.  
  802. function AutoPassiveQ()
  803. if qTarget == nil or qTarget.type ~= "obj_AI_Hero" then return end
  804.  
  805. if spell[_Q]:Ready(2) == 1 then
  806. if HaveNoStack() or GetGameTimer() - spell[_Q].starttime > 3 - Delay() then
  807. spell[_Q]:Cast()
  808. elseif GetDistance(qTarget) > myHero.range + 250 + getHitBox(qTarget) then
  809. spell[_Q]:Cast()
  810. end
  811. end
  812. end
  813.  
  814. function AutoPassiveW()
  815. if spell[_W]:Ready(2) == 1 and (HaveNoStack() or GetGameTimer() - spell[_W].starttime > 3 - Delay()) then
  816. spell[_W]:Cast()
  817. end
  818. end
  819.  
  820. function AutoPassiveE()
  821. if spell[_E]:Ready(2) == 1 and (HaveNoStack() or GetGameTimer() - spell[_E].starttime > 3 - Delay()) then
  822. spell[_E]:Cast()
  823. end
  824.  
  825. for i, unit in pairs(eStack) do
  826. if unit and spell[_E]:Ready(2) == 1 and unit.valid and not unit.dead and unit.type == myHero.type and GetDistance(unit) > myHero.range + 100 + getHitBox(unit) then
  827. spell[_E]:Cast()
  828. end
  829. end
  830.  
  831. if spell[_E]:Ready() == 1 then
  832. for i, unit in pairs(eStack) do
  833. unit = nil
  834. end
  835. end
  836. end
  837.  
  838. function AutoE(target)
  839. if spell[_E]:Ready() == 1 and GetDistance(target) < 300 + getHitBox(target) and GetDistance(target) > myHero.range + 100 + getHitBox(target) then
  840. spell[_E]:Cast()
  841. elseif spell[_E]:Ready() == 1 and HaveNoStack() and GetDistance(target) < 300 + getHitBoxRadius(target) then
  842. spell[_E]:Cast()
  843. end
  844. end
  845.  
  846. function AutoW(target)
  847. if spell[_W]:Ready() == 1 and HaveNoStack() and GetDistance(target) < 250 + getHitBox(target) then
  848. spell[_W]:Cast()
  849. end
  850. end
  851.  
  852. function AutoQ(target)
  853. if spell[_Q]:Ready() == 1 and (HaveNoStack() or GetDistance(target) > myHero.range + getHitBox(target)) then
  854. CastQ(myHero, target)
  855. end
  856. end
  857.  
  858. function AutoR(target)
  859. local ultDmg = getDmg("R",target,myHero)
  860. if ultDmg>=target.health then
  861. if myHero:CanUseSpell(_R) == READY and GetDistance(target)<=rRange then
  862. spell[_R]:Cast(target)
  863. end
  864. end
  865. end
  866.  
  867. function HaveNoStack()
  868. local canAttack = OrbWalking.CanAttack()
  869. return passive.stack == 0 or (canAttack and GetGameTimer() > passive.endT - Delay()) or (canAttack and (passive.endT - Delay()) - GetGameTimer() < OrbWalking.WindUpTime()) or (not canAttack and (passive.endT-Delay()) < (OrbWalking.NextAttack() + OrbWalking.WindUpTime()))
  870. end
  871.  
  872. function Delay()
  873. return GetLatency()/2000 + 0.08
  874. end
  875.  
  876. function GetWardPosition(target)
  877. local tempLocation = nil
  878.  
  879. local Prediction = TargetPredictionVIP(2000, math.huge, 0.250)
  880. local pos, t, vec = Prediction:GetPrediction(target)
  881. if pos ~= nil and Prediction:GetHitChance(target) > 0.6 then
  882.  
  883. else
  884. pos = target
  885. end
  886. local allies = Heroes({team = {myHero.team}, range = 1200}) + Turrets({team = {myHero.team}}) --Turrets.GetObjects(ALLY, 1500, pos)
  887. table.sort(allies, function(x,y) return GetDistance(x, pos) < GetDistance(y, pos) end)
  888.  
  889. if #allies > 0 then
  890. local unit = allies[1]
  891. if allies[1].isMe then
  892. if #allies > 1 then
  893. unit = allies[2]
  894. else
  895. return nil
  896. end
  897. end
  898.  
  899. local x,y,z = (Vector(pos) - Vector(unit)):normalized():unpack()
  900. local posX = pos.x + (x * 250)
  901. local posY = pos.y + (y * 250)
  902. local posZ = pos.z + (z * 250)
  903. tempLocation = Vector(posX, posY, posZ)
  904. return tempLocation
  905. end
  906. return nil
  907. end
  908.  
  909. function CheckObject(target, range)
  910. local tempRange = range or 700
  911. allys = Heroes({team = {myHero.team}, range = tempRange, source = target}) + Minions({team = {myHero.team}, range = tempRange, source = target}) --Heroes.GetObjects(ALLY, tempRange, target)
  912. table.sort(allys, function(x,y) return GetDistance(x) < GetDistance(y) end)
  913. for i, ally in ipairs(allys) do
  914. if not ally.isMe then
  915. return true, ally
  916. end
  917. end
  918. return false, nil
  919. end
  920.  
  921. function CanJump(target, range)
  922. local tempRange = range or 700
  923. allys = Heroes({team = {myHero.team}, range = tempRange, source = target}) + Minions({team = {myHero.team}, range = tempRange, source = target})
  924. table.sort(allys, function(x,y) return GetDistance(x) > GetDistance(y) end)
  925. for i, ally in ipairs(allys) do
  926. if not ally.isMe and GetDistance(ally, target) > 300 then
  927. return true, ally
  928. end
  929. end
  930. return false, nil
  931. end
  932.  
  933. function ComboJump(target, range)
  934. local tempRange = 700
  935. allys = Heroes({team = {myHero.team}, range = tempRange}) + Minions({team = {myHero.team}, range = tempRange})
  936. table.sort(allys, function(x,y) return GetDistance(x, target) < GetDistance(y, target) end)
  937. for i, ally in pairs(allys) do
  938. if not ally.isMe and GetDistance(ally, target) < range then
  939. return true, ally
  940. end
  941. end
  942. return false, nil
  943. end
  944.  
  945. function BestDmgCombo(target, mana, dmg, tables, added)
  946. local endtable = {}
  947. for i, spells in ipairs(tables) do
  948. local tempadded = table.copy(added)
  949. local damage = dmg + spells.damage(target, target.health-dmg)
  950. local m = mana - spells.mana
  951.  
  952. if GetDistance(target, tables.range) <= spells.range then
  953. local temptable = table.copy(tables)
  954. if #temptable > 0 and target.health-1300 > damage and myHero.mana + m >= 0 then
  955. if temptable[i].afterRange ~= 0 then
  956. temptable.range = target
  957. end
  958. table.remove(temptable, i)
  959. table.insert(tempadded, spells)
  960. endtable = joinTables(endtable, BestDmgCombo(target, m, damage, temptable, tempadded))
  961. end
  962.  
  963. if target.health-1300 < damage and myHero.mana + m >= 0 then table.insert(endtable, {dmg = damage, table = tempadded}) end
  964. end
  965. end
  966. return endtable
  967. end
  968.  
  969. function joinTables(t1, t2)
  970. for k,v in ipairs(t2) do table.insert(t1, v) end return t1
  971. end
  972.  
  973. function QSecondDamage(dmg, target)
  974. if dmg == nil then dmg = 0 end
  975. local predHealth = target.health - dmg
  976. local Qdmg = ((myHero:GetSpellData(_Q).level*30) + 20) + (myHero.addDamage*0.9) + (0.08*(target.maxHealth-predHealth))
  977. return myHero:CalcDamage(target, Qdmg)
  978. end
  979.  
  980. function getHitBoxRadius(target)
  981. return GetDistance(target, target.minBBox)
  982. end
  983.  
  984. function CastQ(unit, pos, spell)
  985. if myHero:GetSpellData(_Q).mana < myHero.mana then
  986. if GetDistance(pos) - getHitBoxRadius(unit)/2 < qRange then
  987. local willCollide = ProdictQCol:GetMinionCollision(pos)
  988. if not willCollide then
  989. CastSpell(_Q, pos.x, pos.z)
  990. end
  991. end
  992. end
  993. return false
  994. end
  995.  
  996. function CanCastQ(from, to)
  997. if pos == nil then pos = to end
  998. if pos ~= nil and GetDistance(pos, from)<=qRange and not ProdictQCol:GetMinionCollision(pos) then
  999. return true, pos
  1000. end
  1001. return false, nil
  1002. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement