Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------#####################################################---------------------
- ---------------------## Corki ##---------------------
- ---------------------## Death from Above ##---------------------
- ---------------------#####################################################---------------------
- if myHero.charName ~= "Corki" then return end
- if VIP_USER then
- require "Collision"
- col = Collision(1300, 2000, 0.175, 60)
- qp = TargetPredictionVIP(600, math.huge, 0.200, 475)
- rp = TargetPredictionVIP(1300, 2000, 0.175, 60)
- PrintChat("<font color='#CCCCCC'> >> VIP Corki - Death from Above loaded! <<</font>")
- else
- qp = TargetPrediction(600, math.huge, 200, 475)
- rp = TargetPrediction(1300, 2.0, 175, 75)
- PrintChat("<font color='#CCCCCC'> >> Basic Corki - Death from Above loaded! <<</font>")
- end
- local qRange, eRange, rRange, igniteRange = 600, 600, 1225, 600
- local QREADY, WREADY, RREADY, IREADY = false, false, false, false
- local igniteSlot = nil
- function OnLoad()
- --> Combo Menu
- comboMenu()
- --> Main Menu
- mainMenu()
- --> Item Menu
- itemMenu()
- --> Minion Manager
- enemyMinions = minionManager(MINION_ENEMY, rRange+150, myHero)
- --> Target Selector
- qTS = TargetSelector(TARGET_LOW_HP_PRIORITY, qRange+50, DAMAGE_PHYSICAL)
- rTS = TargetSelector(TARGET_LOW_HP_PRIORITY, rRange+50, DAMAGE_MAGIC)
- qTS.name = "Basic Ability Target"
- rTS.name = "Missile Barrage Target"
- CorkiCombo:addTS(qTS)
- CorkiCombo:addTS(rTS)
- --> Ignite
- igniteSlot = ((myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") and SUMMONER_1) or (myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") and SUMMONER_2) or nil)
- end
- function OnTick()
- Checks()
- muramanaToggle(rTS.target)
- --> Barrage
- if CorkiCombo.scriptActive then
- if qTS.target then
- itemTick(qTS.target)
- if QREADY and CorkiDAConfig.useQ then castQ(qTS.target) end
- if EREADY and CorkiDAConfig.useE then castE(qTS.target) end
- end
- if rTS.target and RREADY and CorkiDAConfig.useR then castR(rTS.target) end
- end
- --> Harass
- if CorkiCombo.harassActive and RREADY and rTS.target then castR(rTS.target) end
- --> Auto Ignite
- if CorkiCombo.autoIgnite and IREADY then autoIgnite() end
- --> Missile KS
- if CorkiCombo.missileKS and RREADY then missileKS() end
- end
- function OnDraw()
- --> Ranges
- if not myHero.dead then
- if QREADY and CorkiDAConfig.drawQ then
- DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0x00FFFF)
- end
- if RREADY and CorkiDAConfig.drawR then
- DrawCircle(myHero.x, myHero.y, myHero.z, rRange, 0x00FF00)
- end
- end
- --> Text
- if CorkiDAConfig.textQ and CorkiDAConfig.useQ and QREADY then
- DrawText("Phosphorus Bombs Loaded", 16, 40, 40, 0xFF00FF00)
- elseif CorkiDAConfig.textQ and CorkiDAConfig.useQ then
- DrawText("Phosphorus Bombs Loading", 16, 40, 40, 0xFFFF0000)
- end
- if CorkiDAConfig.textE and CorkiDAConfig.useE and EREADY then
- DrawText("Gatling Gun Ready", 16, 40, 60, 0xFF00FF00)
- elseif CorkiDAConfig.textE and CorkiDAConfig.useE then
- DrawText("Gatling Gun Starting Up", 16, 40, 60, 0xFFFF0000)
- end
- if CorkiDAConfig.textR and CorkiDAConfig.useR and RREADY then
- DrawText("Missile Barrage Preped", 16, 40, 80, 0xFF00FF00)
- elseif CorkiDAConfig.textR and CorkiDAConfig.useR then
- DrawText("Missile Barrage Preping", 16,40, 80, 0xFFFF0000)
- end
- end
- --> Phosphorus Bomb Cast
- function castQ(target)
- local qPred = qp:GetPrediction(target)
- if qPred and GetDistance(qPred) <= qRange then
- CastSpell(_Q, qPred.x, qPred.z)
- end
- end
- --> Gatling Gun Cast
- function castE(target)
- if GetDistance(target) <= eRange then
- CastSpell(_E)
- end
- end
- --> Missile Barrage Cast
- function castR(target)
- if VIP_USER then
- local rPred, rTime, rVec = rp:GetPrediction(target)
- if rPred and GetDistance(rPred) <= rRange --[[and rp:GetHitChance(target) >= CorkiDAConfig.hitChance/100]] then
- if not col:GetMinionCollision(myHero, rPred) then
- CastSpell(_R, rPred.x, rPred.z)
- end
- end
- elseif not VIP_USER then
- local rPred = rp:GetPrediction(target)
- if rPred and not willHitMinion(rPred, 80) then
- CastSpell(_R, rPred.x, rPred.z)
- end
- end
- end
- --> Missile KS
- function missileKS()
- for i, enemy in ipairs(GetEnemyHeroes()) do
- local rDmg = nil
- if CorkiDAConfig.bigOneCheck and BigOne() then
- rDmg = (getDmg("R", enemy, myHero)*1.5)
- else rDmg = getDmg("R", enemy, myHero) end
- if enemy and not enemy.dead and enemy.health < rDmg then
- castR(enemy)
- end
- end
- end
- --> Auto Ignite
- function autoIgnite()
- for i, enemy in ipairs(GetEnemyHeroes()) do
- local igniteDmg = getDmg("IGNITE", enemy, myHero)
- if GetDistance(enemy) <= igniteRange and enemy.health < igniteDmg then
- CastSpell(igniteSlot, enemy)
- end
- end
- end
- --> Checks
- function Checks()
- qTS:update()
- rTS:update()
- enemyMinions:update()
- QREADY = (myHero:CanUseSpell(_Q) == READY)
- EREADY = (myHero:CanUseSpell(_E) == READY)
- RREADY = (myHero:CanUseSpell(_R) == READY)
- IREADY = (igniteSlot and myHero:CanUseSpell(igniteSlot))
- end
- --> Big One Check
- function BigOne()
- buffCount = player.buffCount
- for i = 1, buffCount, 1 do
- local buff = player:getBuff(i)
- if buff.valid and buff.name == "mbcheck2" then
- return true
- end
- end
- return false
- end
- --> Basic Collision
- function willHitMinion(predic, width)
- for _, minion in pairs(enemyMinions.objects) do
- if minion ~= nil and minion.valid and string.find(minion.name,"Minion_") == 1 and minion.team ~= player.team and minion.dead == false then
- if predic ~= nil then
- ex = player.x
- ez = player.z
- tx = predic.x
- tz = predic.z
- dx = ex - tx
- dz = ez - tz
- if dx ~= 0 then
- m = dz/dx
- c = ez - m*ex
- end
- mx = minion.x
- mz = minion.z
- distanc = (math.abs(mz - m*mx - c))/(math.sqrt(m*m+1))
- 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
- return true
- end
- end
- end
- end
- return false
- end
- --> Items Adapted from Sida's Auto Carry
- --> Item Table
- local items =
- {
- {name = "Blade of the Ruined King", menu = "BRK", id=3153, range = 500, reqTarget = true, slot = nil },
- {name = "Bilgewater Cutlass", menu = "BWC", id=3144, range = 400, reqTarget = true, slot = nil },
- {name = "Deathfire Grasp", menu = "DFG", id=3128, range = 750, reqTarget = true, slot = nil },
- {name = "Hextech Gunblade", menu = "HGB", id=3146, range = 400, reqTarget = true, slot = nil },
- }
- --> Item Menu
- function itemMenu()
- CorkiItemMenu = scriptConfig("Corki - Item Load out", "CorkiDAItemMenu")
- for _, item in ipairs(items) do
- CorkiItemMenu:addParam(item.menu, "Use "..item.name, SCRIPT_PARAM_ONOFF, true)
- end
- CorkiItemMenu:addParam("muraMana", "Use Muramana", SCRIPT_PARAM_ONOFF, true)
- end
- --> Combo Menu
- function comboMenu()
- CorkiCombo = scriptConfig("Corki - Combo Menu", "CorkiDAComboMenu")
- CorkiCombo:addParam("sep", "-- Combo Options --", SCRIPT_PARAM_INFO, "")
- CorkiCombo:addParam("scriptActive", "Death from Above", SCRIPT_PARAM_ONKEYDOWN, false, 32)
- CorkiCombo:addParam("harassActive", "Missile Harass", SCRIPT_PARAM_ONKEYDOWN, false, 71)
- CorkiCombo:addParam("autoIgnite", "Auto Ignite Killable", SCRIPT_PARAM_ONOFF, true)
- CorkiCombo:addParam("missileKS", "Kill with Missile Barrage", SCRIPT_PARAM_ONOFF, true)
- end
- --> Main Menu
- function mainMenu()
- CorkiDAConfig = scriptConfig("Corki - Options Menu", "CorkiDAMainMenu")
- CorkiDAConfig:addParam("sep1", "-- Load Out Options --", SCRIPT_PARAM_INFO, "")
- CorkiDAConfig:addParam("useQ", "Load Phosphorus Bombs", SCRIPT_PARAM_ONOFF, true)
- CorkiDAConfig:addParam("useE", "Fire Gatling Gun", SCRIPT_PARAM_ONOFF, true)
- CorkiDAConfig:addParam("useR", "Prep Missile Barrage", SCRIPT_PARAM_ONOFF, true)
- CorkiDAConfig:addParam("sep2", "-- Cast Options --", SCRIPT_PARAM_INFO, "")
- CorkiDAConfig:addParam("bigOneCheck", "Missile KS - Big One Check", SCRIPT_PARAM_ONOFF, true)
- if VIP_USER then
- CorkiDAConfig:addParam("hitChance", "Missile Hitchance", SCRIPT_PARAM_SLICE, 60, 0, 100, 0)
- end
- CorkiDAConfig:addParam("sep3", "-- Draw Options --", SCRIPT_PARAM_INFO, "")
- CorkiDAConfig:addParam("drawQ", "Draw - Phosphorus Bombs", SCRIPT_PARAM_ONOFF, false)
- CorkiDAConfig:addParam("drawR", "Draw - Missile Barrage", SCRIPT_PARAM_ONOFF, false)
- CorkiDAConfig:addParam("sep4", "-- Text Options --", SCRIPT_PARAM_INFO, "")
- CorkiDAConfig:addParam("textQ", "Text - Phosphorus Bombs", SCRIPT_PARAM_ONOFF, true)
- CorkiDAConfig:addParam("textE", "Text - Gatling Gun", SCRIPT_PARAM_ONOFF, true)
- CorkiDAConfig:addParam("textR", "Text - Missile Barrage", SCRIPT_PARAM_ONOFF, true)
- end
- --> Item Casts
- function itemTick(target)
- for _,item in pairs(items) do
- item.slot = GetInventorySlotItem(item.id)
- if item.slot ~= nil then
- if item.reqTarget and GetDistance(target) <= item.range and item.menu ~= "BRK" then
- CastSpell(item.slot, target)
- elseif item.reqTarget and GetDistance(target) <= item.range and item.menu == "BRK" and myHero.health <= (myHero.maxHealth*0.65) then
- CastSpell(item.slot, target)
- end
- end
- end
- end
- function muramanaToggle(target)
- if target and CorkiItemMenu.muraMana and not MuramanaIsActive() then
- MuramanaOn()
- elseif target == nil and CorkiItemMenu.muraMana and MuramanaIsActive() then
- MuramanaOff()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment