16HeX16

Corki - Death from Above

Jun 6th, 2013
4,752
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.27 KB | None | 0 0
  1. ---------------------#####################################################---------------------
  2. ---------------------##                                      Corki                                              ##---------------------
  3. ---------------------##                             Death from Above                                    ##---------------------
  4. ---------------------#####################################################---------------------
  5. if myHero.charName ~= "Corki" then return end
  6.  
  7. if VIP_USER then
  8.     require "Collision"
  9.     col = Collision(1300, 2000, 0.175, 60)
  10.     qp = TargetPredictionVIP(600, math.huge, 0.200, 475)
  11.     rp = TargetPredictionVIP(1300, 2000, 0.175, 60)
  12.     PrintChat("<font color='#CCCCCC'> >> VIP Corki - Death from Above loaded! <<</font>")
  13. else
  14.     qp = TargetPrediction(600, math.huge, 200, 475)
  15.     rp = TargetPrediction(1300, 2.0, 175, 75)
  16.     PrintChat("<font color='#CCCCCC'> >> Basic Corki - Death from Above loaded! <<</font>")
  17. end
  18.  
  19. local qRange, eRange, rRange, igniteRange = 600, 600, 1225, 600
  20. local QREADY, WREADY, RREADY, IREADY = false, false, false, false
  21. local igniteSlot = nil
  22.  
  23. function OnLoad()
  24.     --> Combo Menu
  25.     comboMenu()
  26.     --> Main Menu
  27.     mainMenu()
  28.     --> Item Menu
  29.     itemMenu()
  30.     --> Minion Manager
  31.     enemyMinions = minionManager(MINION_ENEMY, rRange+150, myHero)
  32.     --> Target Selector
  33.     qTS = TargetSelector(TARGET_LOW_HP_PRIORITY, qRange+50, DAMAGE_PHYSICAL)
  34.     rTS = TargetSelector(TARGET_LOW_HP_PRIORITY, rRange+50, DAMAGE_MAGIC)
  35.     qTS.name = "Basic Ability Target"
  36.     rTS.name = "Missile Barrage Target"
  37.     CorkiCombo:addTS(qTS)
  38.     CorkiCombo:addTS(rTS)
  39.     --> Ignite
  40.     igniteSlot = ((myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") and SUMMONER_1) or (myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") and SUMMONER_2) or nil)
  41. end
  42.  
  43. function OnTick()
  44.     Checks()
  45.     muramanaToggle(rTS.target)
  46.     --> Barrage
  47.     if CorkiCombo.scriptActive then
  48.         if qTS.target then
  49.             itemTick(qTS.target)
  50.             if QREADY and CorkiDAConfig.useQ then castQ(qTS.target) end
  51.             if EREADY and CorkiDAConfig.useE then castE(qTS.target) end
  52.         end
  53.         if rTS.target and RREADY and CorkiDAConfig.useR then castR(rTS.target) end
  54.     end
  55.     --> Harass
  56.     if CorkiCombo.harassActive and RREADY and rTS.target then castR(rTS.target) end
  57.     --> Auto Ignite
  58.     if CorkiCombo.autoIgnite and IREADY then autoIgnite() end
  59.     --> Missile KS
  60.     if CorkiCombo.missileKS and RREADY then missileKS() end
  61. end
  62.  
  63. function OnDraw()
  64.     --> Ranges
  65.     if not myHero.dead then
  66.         if QREADY and CorkiDAConfig.drawQ then
  67.             DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0x00FFFF)
  68.         end
  69.         if RREADY and CorkiDAConfig.drawR then
  70.             DrawCircle(myHero.x, myHero.y, myHero.z, rRange, 0x00FF00)
  71.         end
  72.     end
  73.     --> Text
  74.     if CorkiDAConfig.textQ and CorkiDAConfig.useQ and QREADY then
  75.         DrawText("Phosphorus Bombs Loaded", 16, 40, 40, 0xFF00FF00)
  76.     elseif CorkiDAConfig.textQ and CorkiDAConfig.useQ then
  77.         DrawText("Phosphorus Bombs Loading", 16, 40, 40, 0xFFFF0000)
  78.     end
  79.     if CorkiDAConfig.textE and CorkiDAConfig.useE and EREADY then
  80.         DrawText("Gatling Gun Ready", 16, 40, 60, 0xFF00FF00)
  81.     elseif CorkiDAConfig.textE and CorkiDAConfig.useE then
  82.         DrawText("Gatling Gun Starting Up", 16, 40, 60, 0xFFFF0000)
  83.     end
  84.     if CorkiDAConfig.textR and CorkiDAConfig.useR and RREADY then
  85.         DrawText("Missile Barrage Preped", 16, 40, 80, 0xFF00FF00)
  86.     elseif CorkiDAConfig.textR and CorkiDAConfig.useR then
  87.         DrawText("Missile Barrage Preping", 16,40, 80, 0xFFFF0000)
  88.     end
  89. end
  90.  
  91. --> Phosphorus Bomb Cast
  92. function castQ(target)
  93.     local qPred = qp:GetPrediction(target)
  94.     if qPred and GetDistance(qPred) <= qRange then
  95.         CastSpell(_Q, qPred.x, qPred.z)
  96.     end
  97. end
  98.  
  99. --> Gatling Gun Cast
  100. function castE(target)
  101.     if GetDistance(target) <= eRange then
  102.         CastSpell(_E)
  103.     end
  104. end
  105.  
  106. --> Missile Barrage Cast
  107. function castR(target)
  108.     if VIP_USER then
  109.         local rPred, rTime, rVec = rp:GetPrediction(target)
  110.         if rPred and GetDistance(rPred) <= rRange --[[and rp:GetHitChance(target) >= CorkiDAConfig.hitChance/100]] then
  111.             if not col:GetMinionCollision(myHero, rPred) then
  112.                 CastSpell(_R, rPred.x, rPred.z)
  113.             end
  114.         end
  115.     elseif not VIP_USER then
  116.         local rPred = rp:GetPrediction(target)
  117.         if rPred and not willHitMinion(rPred, 80) then
  118.             CastSpell(_R, rPred.x, rPred.z)
  119.         end
  120.     end
  121. end
  122.  
  123. --> Missile KS
  124. function missileKS()
  125.     for i, enemy in ipairs(GetEnemyHeroes()) do
  126.         local rDmg = nil
  127.         if CorkiDAConfig.bigOneCheck and BigOne() then
  128.             rDmg = (getDmg("R", enemy, myHero)*1.5)
  129.         else rDmg = getDmg("R", enemy, myHero) end
  130.         if enemy and not enemy.dead and enemy.health < rDmg then
  131.             castR(enemy)
  132.         end
  133.     end
  134. end
  135.  
  136. --> Auto Ignite
  137. function autoIgnite()
  138.     for i, enemy in ipairs(GetEnemyHeroes()) do
  139.         local igniteDmg = getDmg("IGNITE", enemy, myHero)
  140.         if GetDistance(enemy) <= igniteRange and enemy.health < igniteDmg then
  141.             CastSpell(igniteSlot, enemy)
  142.         end
  143.     end
  144. end
  145.  
  146. --> Checks
  147. function Checks()
  148.     qTS:update()
  149.     rTS:update()
  150.     enemyMinions:update()
  151.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  152.     EREADY = (myHero:CanUseSpell(_E) == READY)
  153.     RREADY = (myHero:CanUseSpell(_R) == READY)
  154.     IREADY = (igniteSlot and myHero:CanUseSpell(igniteSlot))
  155. end
  156.  
  157. --> Big One Check
  158. function BigOne()
  159.     buffCount = player.buffCount
  160.     for i = 1, buffCount, 1 do
  161.         local buff = player:getBuff(i)
  162.         if buff.valid and buff.name == "mbcheck2" then
  163.             return true
  164.         end
  165.     end
  166. return false
  167. end
  168.  
  169. --> Basic Collision
  170. function willHitMinion(predic, width)
  171.     for _, minion in pairs(enemyMinions.objects) do
  172.         if minion ~= nil and minion.valid and string.find(minion.name,"Minion_") == 1 and minion.team ~= player.team and minion.dead == false then
  173.             if predic ~= nil then
  174.                 ex = player.x
  175.                 ez = player.z
  176.                 tx = predic.x
  177.                 tz = predic.z
  178.                 dx = ex - tx
  179.                 dz = ez - tz
  180.                 if dx ~= 0 then
  181.                     m = dz/dx
  182.                     c = ez - m*ex
  183.                 end
  184.                 mx = minion.x
  185.                 mz = minion.z
  186.                 distanc = (math.abs(mz - m*mx - c))/(math.sqrt(m*m+1))
  187.                 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
  188.                     return true
  189.                 end
  190.             end
  191.         end
  192.     end
  193. return false
  194. end
  195.  
  196. --> Items Adapted from Sida's Auto Carry
  197. --> Item Table
  198. local items =
  199.     {
  200.         {name = "Blade of the Ruined King", menu = "BRK", id=3153, range = 500, reqTarget = true, slot = nil },
  201.         {name = "Bilgewater Cutlass", menu = "BWC", id=3144, range = 400, reqTarget = true, slot = nil },
  202.         {name = "Deathfire Grasp", menu = "DFG", id=3128, range = 750, reqTarget = true, slot = nil },
  203.         {name = "Hextech Gunblade", menu = "HGB", id=3146, range = 400, reqTarget = true, slot = nil },
  204.     }
  205.    
  206. --> Item Menu
  207. function itemMenu()
  208.     CorkiItemMenu = scriptConfig("Corki - Item Load out", "CorkiDAItemMenu")
  209.     for _, item in ipairs(items) do
  210.         CorkiItemMenu:addParam(item.menu, "Use "..item.name, SCRIPT_PARAM_ONOFF, true)
  211.     end
  212.     CorkiItemMenu:addParam("muraMana", "Use Muramana", SCRIPT_PARAM_ONOFF, true)
  213. end
  214.  
  215. --> Combo Menu
  216. function comboMenu()
  217.     CorkiCombo = scriptConfig("Corki - Combo Menu", "CorkiDAComboMenu")
  218.     CorkiCombo:addParam("sep", "-- Combo Options --", SCRIPT_PARAM_INFO, "")
  219.     CorkiCombo:addParam("scriptActive", "Death from Above", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  220.     CorkiCombo:addParam("harassActive", "Missile Harass", SCRIPT_PARAM_ONKEYDOWN, false, 71)
  221.     CorkiCombo:addParam("autoIgnite", "Auto Ignite Killable", SCRIPT_PARAM_ONOFF, true)
  222.     CorkiCombo:addParam("missileKS", "Kill with Missile Barrage", SCRIPT_PARAM_ONOFF, true)
  223. end
  224.  
  225. --> Main Menu
  226. function mainMenu()
  227.     CorkiDAConfig = scriptConfig("Corki - Options Menu", "CorkiDAMainMenu")
  228.     CorkiDAConfig:addParam("sep1", "-- Load Out Options --", SCRIPT_PARAM_INFO, "")
  229.     CorkiDAConfig:addParam("useQ", "Load Phosphorus Bombs", SCRIPT_PARAM_ONOFF, true)
  230.     CorkiDAConfig:addParam("useE", "Fire Gatling Gun", SCRIPT_PARAM_ONOFF, true)
  231.     CorkiDAConfig:addParam("useR", "Prep Missile Barrage", SCRIPT_PARAM_ONOFF, true)
  232.     CorkiDAConfig:addParam("sep2", "-- Cast Options --", SCRIPT_PARAM_INFO, "")
  233.     CorkiDAConfig:addParam("bigOneCheck", "Missile KS - Big One Check", SCRIPT_PARAM_ONOFF, true)
  234.     if VIP_USER then
  235.         CorkiDAConfig:addParam("hitChance", "Missile Hitchance", SCRIPT_PARAM_SLICE, 60, 0, 100, 0)
  236.     end
  237.     CorkiDAConfig:addParam("sep3", "-- Draw Options --", SCRIPT_PARAM_INFO, "")
  238.     CorkiDAConfig:addParam("drawQ", "Draw - Phosphorus Bombs", SCRIPT_PARAM_ONOFF, false)
  239.     CorkiDAConfig:addParam("drawR", "Draw - Missile Barrage", SCRIPT_PARAM_ONOFF, false)
  240.     CorkiDAConfig:addParam("sep4", "-- Text Options --", SCRIPT_PARAM_INFO, "")
  241.     CorkiDAConfig:addParam("textQ", "Text - Phosphorus Bombs", SCRIPT_PARAM_ONOFF, true)
  242.     CorkiDAConfig:addParam("textE", "Text - Gatling Gun", SCRIPT_PARAM_ONOFF, true)
  243.     CorkiDAConfig:addParam("textR", "Text - Missile Barrage", SCRIPT_PARAM_ONOFF, true)
  244. end
  245.  
  246. --> Item Casts
  247. function itemTick(target)
  248.     for _,item in pairs(items) do
  249.         item.slot = GetInventorySlotItem(item.id)
  250.         if item.slot ~= nil then
  251.             if item.reqTarget and GetDistance(target) <= item.range and item.menu ~= "BRK" then
  252.                 CastSpell(item.slot, target)
  253.             elseif item.reqTarget and GetDistance(target) <= item.range and item.menu == "BRK" and myHero.health <= (myHero.maxHealth*0.65) then
  254.                 CastSpell(item.slot, target)
  255.             end
  256.         end
  257.     end
  258. end
  259.  
  260. function muramanaToggle(target)
  261.     if target and CorkiItemMenu.muraMana and not MuramanaIsActive() then
  262.         MuramanaOn()
  263.     elseif target == nil and CorkiItemMenu.muraMana and MuramanaIsActive() then
  264.         MuramanaOff()
  265.     end
  266. end
Advertisement
Add Comment
Please, Sign In to add comment