Guest User

Untitled

a guest
Jun 10th, 2013
19,536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.87 KB | None | 0 0
  1. --[[
  2.     Blitzcrank Combo 1.7 by burn
  3.  
  4.     -Full combo: Q -> W -> E
  5.     -Target configuration, Press shift to configure
  6.     -Option to autoignite killable enemy
  7.     -Option to auto ks with R
  8.     -Option to use R to stop enemy ultimates
  9.     -Option to auto level up
  10. ]]
  11. if myHero.charName ~= "Blitzcrank" then return end
  12. local attackrange = 175
  13. local qrange = 1050
  14. local ultirange = 590
  15. local ignite = nil
  16. local QREADY, WREADY, EREADY, RREADY, IREADY = false, false, false, false, false
  17. local abilitySequence = {1,3,2,1,1,4,1,3,1,2,4,3,3,2,2,4,3,2}
  18. --Q normal prediction
  19. local delay = 250
  20. local speed = 1.8
  21. local QWidth = 120
  22. local travelDuration = 0
  23. local predic = nil
  24. --Q VIP prediction
  25. local qPredict = TargetPredictionVIP(qrange, 1800, .25, QWidth)
  26.  
  27. function OnLoad()
  28.     PrintChat(">> Blitzcrank Combo 1.7 loaded!")
  29.     BlitzcrankConfig = scriptConfig("Blitzcrank", "blitzcrankcombo")
  30.     BlitzcrankConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  31.     BlitzcrankConfig:addParam("grabQ", "Grab Q", SCRIPT_PARAM_ONKEYDOWN, false, 65) --A
  32.     BlitzcrankConfig:addParam("silenceR", "Use R to stop enemy ultimates", SCRIPT_PARAM_ONOFF, true)       
  33.     BlitzcrankConfig:addParam("drawcircles", "Draw our range", SCRIPT_PARAM_ONOFF, true)
  34.     BlitzcrankConfig:addParam("autolvl", "Auto level skill sequence", SCRIPT_PARAM_ONOFF, true)    
  35.     BlitzcrankConfig:addParam("autoks", "Auto Kill Steal with R", SCRIPT_PARAM_ONOFF, false)   
  36.     BlitzcrankConfig:addParam("autoignite", "Auto Ignite killable enemy", SCRIPT_PARAM_ONOFF, false)
  37.     if VIP_USER == true then
  38.         BlitzcrankConfig:addParam("UseVIP", "Use Q VIP Prediction", SCRIPT_PARAM_ONOFF, true)
  39.         BlitzcrankConfig:addParam("QHitChance", "Q VIP min Hit Chance", SCRIPT_PARAM_SLICE, 50, 0, 100, 0)
  40.     end
  41.     BlitzcrankConfig:permaShow("scriptActive")
  42.     BlitzcrankConfig:permaShow("silenceR") 
  43.     ts = TargetSelector(TARGET_LOW_HP,qrange,DAMAGE_MAGIC or DAMAGE_PHYSICAL)
  44.     ts.name = "Blitzcrank"
  45.     BlitzcrankConfig:addTS(ts)
  46.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  47.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end
  48.     enemyMinions = minionManager(MINION_ENEMY, 1050, player)
  49. end
  50.  
  51. function OnProcessSpell(unit, spell)
  52.     if BlitzcrankConfig.silenceR and unit ~= nil and unit.valid and unit.team == TEAM_ENEMY and CanUseSpell(_R) == READY and GetDistance(unit) <= ultirange then
  53.         if spell.name=="KatarinaR" or spell.name=="GalioIdolOfDurand" or spell.name=="Crowstorm" or spell.name=="DrainChannel"
  54.         or spell.name=="AbsoluteZero" or spell.name=="ShenStandUnited" or spell.name=="UrgotSwap2" or spell.name=="AlZaharNetherGrasp"
  55.         or spell.name=="FallenOne" or spell.name=="Pantheon_GrandSkyfall_Jump" or spell.name=="CaitlynAceintheHole"
  56.         or spell.name=="MissFortuneBulletTime" or spell.name=="InfiniteDuress" or spell.name=="Teleport" or spell.name=="Meditate" then
  57.             CastSpell(_R, unit)
  58.         end
  59.     end
  60. end
  61.  
  62. function OnTick()
  63.     ts:update()
  64.     enemyMinions:update()
  65.    
  66.     if ts.target ~= nil then
  67.         travelDuration = (delay + GetDistance(myHero, ts.target)/speed)
  68.         ts:SetPrediction(travelDuration)
  69.         predic = ts.nextPosition
  70.     end
  71.        
  72.     if BlitzcrankConfig.autolvl then --auto level up
  73.         if myHero:GetSpellData(_Q).level + myHero:GetSpellData(_W).level + myHero:GetSpellData(_E).level + myHero:GetSpellData(_R).level < myHero.level then
  74.             local spellSlot = { SPELL_1, SPELL_2, SPELL_3, SPELL_4, }
  75.             local level = { 0, 0, 0, 0 }
  76.             for i = 1, myHero.level, 1 do
  77.                 level[abilitySequence[i]] = level[abilitySequence[i]] + 1
  78.             end
  79.             for i, v in ipairs({ myHero:GetSpellData(_Q).level, myHero:GetSpellData(_W).level, myHero:GetSpellData(_E).level, myHero:GetSpellData(_R).level }) do
  80.                 if v < level[i] then LevelSpell(spellSlot[i]) end
  81.             end
  82.         end
  83.     end    
  84.        
  85.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  86.     WREADY = (myHero:CanUseSpell(_W) == READY)
  87.     EREADY = (myHero:CanUseSpell(_E) == READY)
  88.     RREADY = (myHero:CanUseSpell(_R) == READY)
  89.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  90.    
  91.     if BlitzcrankConfig.autoignite then    
  92.         if IREADY then
  93.             local ignitedmg = 0    
  94.             for j = 1, heroManager.iCount, 1 do
  95.                 local enemyhero = heroManager:getHero(j)
  96.                 if ValidTarget(enemyhero,600) then
  97.                     ignitedmg = 50 + 20 * myHero.level
  98.                     if enemyhero.health <= ignitedmg then
  99.                             CastSpell(ignite, enemyhero)
  100.                     end
  101.                 end
  102.             end
  103.         end
  104.     end
  105.    
  106.     if BlitzcrankConfig.autoks and ts.target and RREADY then
  107.         if RREADY and GetDistance(ts.target) < ultirange and getDmg("R",ts.target,myHero) > ts.target.health then CastSpell(_R,ts.target) end
  108.     end    
  109.    
  110.     if BlitzcrankConfig.grabQ and ts.target ~= nil and QREADY then
  111.         if BlitzcrankConfig.UseVIP and VIP_USER == true then
  112.             QPrediction()
  113.         else
  114.             if predic ~= nil and GetDistance(predic) < qrange and not minionCollision(predic, QWidth, qrange) then
  115.                 CastSpell(_Q, predic.x, predic.z)
  116.             end
  117.         end
  118.     end
  119.    
  120.     if BlitzcrankConfig.scriptActive and ts.target ~= nil then
  121.         ts:update()
  122.         if BlitzcrankConfig.UseVIP and VIP_USER == true and QREADY then
  123.             QPrediction()
  124.         else
  125.             if QREADY and predic ~= nil and GetDistance(predic) < qrange and not minionCollision(predic, QWidth, qrange) then
  126.                 CastSpell(_Q, predic.x, predic.z)
  127.             end
  128.         end    
  129.         if (WREADY or EREADY) and (GetDistance(ts.target) < attackrange) then
  130.             CastSpell(_W)
  131.             CastSpell(_E)
  132.         end
  133.         if GetDistance(ts.target) <= attackrange then
  134.             myHero:Attack(ts.target)
  135.         end
  136.     end
  137. end
  138.  
  139. function QPrediction()
  140.     local hitChance = qPredict:GetHitChance(ts.target)
  141.     local pos = qPredict:GetPrediction(ts.target)
  142.     local minionblocking = qPredict:GetCollision(ts.target)
  143.     if hitChance > BlitzcrankConfig.QHitChance/100 and minionblocking == false then
  144.         if pos ~= nil and GetDistance(pos) < qrange then
  145.             CastSpell(_Q, pos.x, pos.z)
  146.         end
  147.     end
  148. end
  149.  
  150. function OnDraw()
  151.     if BlitzcrankConfig.drawcircles and not myHero.dead then
  152.         DrawCircle(myHero.x, myHero.y, myHero.z, qrange, 0xc2743c)
  153.         DrawCircle(myHero.x, myHero.y, myHero.z, ultirange+10, 0xFF6600)
  154.         if ts.target ~= nil then
  155.             DrawText("Targetting: " .. ts.target.charName, 15, 100, 100, 0xFFFF0000)
  156.             DrawCircle(ts.target.x, ts.target.y, ts.target.z, 100, 0x00FF00)
  157.         end
  158.     end
  159. end
  160.  
  161. function OnSendChat(msg)
  162.     ts:OnSendChat(msg, "pri")
  163. end
  164.  
  165. function minionCollision(predic, width, range)
  166.     for _, minionObjectE in pairs(enemyMinions.objects) do
  167.         if predic ~= nil and player:GetDistance(minionObjectE) < range then
  168.             ex = player.x
  169.             ez = player.z
  170.             tx = predic.x
  171.             tz = predic.z
  172.             dx = ex - tx
  173.             dz = ez - tz
  174.             if dx ~= 0 then
  175.                 m = dz/dx
  176.                 c = ez - m*ex
  177.             end
  178.             mx = minionObjectE.x
  179.             mz = minionObjectE.z
  180.             distanc = (math.abs(mz - m*mx - c))/(math.sqrt(m*m+1))
  181.             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
  182.                 return true
  183.             end
  184.         end
  185.     end
  186.     return false
  187. end
Advertisement
Add Comment
Please, Sign In to add comment