local Heroes = {"Blitzcrank"} if not table.contains(Heroes, myHero.charName) then return end require "DamageLib" local castSpell = {state = 0, tick = GetTickCount(), casting = GetTickCount() - 1000, mouse = mousePos} local barHeight = 8 local barWidth = 103 local barXOffset = 24 local barYOffset = -8 local Version,Author,LVersion = "v1.0","Kypos","8.2" keybindings = { [ITEM_1] = HK_ITEM_1, [ITEM_2] = HK_ITEM_2, [ITEM_3] = HK_ITEM_3, [ITEM_4] = HK_ITEM_4, [ITEM_5] = HK_ITEM_5, [ITEM_6] = HK_ITEM_6} if FileExist(COMMON_PATH .. "TPred.lua") then require 'TPred' PrintChat("TPred library loaded") elseif FileExist(COMMON_PATH .. "Collision.lua") then require 'Collision' PrintChat("Collision library loaded") end function SetMovement(bool) if _G.EOWLoaded then EOW:SetMovements(bool) EOW:SetAttacks(bool) elseif _G.SDK then _G.SDK.Orbwalker:SetMovement(bool) _G.SDK.Orbwalker:SetAttack(bool) else GOS.BlockMovement = not bool GOS.BlockAttack = not bool end if bool then castSpell.state = 0 end end --------------------------------------------------------------------------------------- -- Blitzcrank --------------------------------------------------------------------------------------- class "Blitzcrank" local HeroIcon = "https://vignette.wikia.nocookie.net/leagueoflegends/images/5/5b/BlitzcrankSquare.png" function Blitzcrank:LoadSpells() Q = {Range = 950, Width = 70, Delay = 0.30, Speed = 1800, Collision = true, aoe = false} E = {Range = 280, Delay = 0} R = {Range = 600, Width = 0, Delay = 0.01, Speed = 347, Collision = false, aoe = false, Type = "circular"} end function Blitzcrank:LoadMenu() self.Menu = MenuElement({type = MENU, id = "Blitzcrank", name = "Kypo's Blitzcrank", leftIcon = HeroIcon}) self.Menu:MenuElement({id = "Combo", name = "Combo", type = MENU}) self.Menu.Combo:MenuElement({id = "UseQ", name = "Q", value = true}) self.Menu.Combo:MenuElement({id = "UseE", name = "E", value = true}) -- self.Menu.Combo:MenuElement({id = "Rkey", name = "R Key", value = false, key = string.byte("6"), tooltip = "make sure this key is unique and has no movement"}) self.Menu.Combo:MenuElement({id = "comboActive", name = "Combo key", key = string.byte(" ")}) self.Menu:MenuElement({id = "Killsteal", name = "Killsteal", type = MENU}) self.Menu.Killsteal:MenuElement({id = "UseQ", name = "Q", value = true}) self.Menu.Killsteal:MenuElement({id = "UseE", name = "E", value = true}) self.Menu.Killsteal:MenuElement({id = "RR", name = "R on:", value = true, type = MENU}) for i, hero in pairs(self:GetEnemyHeroes()) do self.Menu.Killsteal.RR:MenuElement({id = "UseR"..hero.charName, name = "Use R on: "..hero.charName, value = true}) end self.Menu:MenuElement({id = "isCC", name = "CC Settings", type = MENU}) self.Menu.isCC:MenuElement({id = "blank", type = SPACE , name = "Use Q on:"}) for i, hero in pairs(self:GetEnemyHeroes()) do self.Menu.isCC:MenuElement({id = "UseQ"..hero.charName, name = ""..hero.charName, value = true}) end self.Menu:MenuElement({id = "Drawings", name = "Drawings", type = MENU}) --Q self.Menu.Drawings:MenuElement({id = "Q", name = "Draw Q range", type = MENU}) self.Menu.Drawings.Q:MenuElement({id = "Enabled", name = "Enabled", value = true}) self.Menu.Drawings.Q:MenuElement({id = "Width", name = "Width", value = 1, min = 1, max = 5, step = 1}) self.Menu.Drawings.Q:MenuElement({id = "Color", name = "Color", color = Draw.Color(200, 255, 255, 255)}) --R self.Menu.Drawings:MenuElement({id = "R", name = "Draw R range", type = MENU}) self.Menu.Drawings.R:MenuElement({id = "Enabled", name = "Enabled", value = true}) self.Menu.Drawings.R:MenuElement({id = "Width", name = "Width", value = 1, min = 1, max = 5, step = 1}) self.Menu.Drawings.R:MenuElement({id = "Color", name = "Color", color = Draw.Color(200, 255, 255, 255)}) self.Menu:MenuElement({id = "CustomSpellCast", name = "Use custom spellcast", tooltip = "Can fix some casting problems with wrong directions", value = true}) self.Menu:MenuElement({id = "delay", name = "Custom spellcast delay", value = 100, min = 0, max = 200, step = 5,tooltip = "increase this one if spells is going completely wrong direction", identifier = ""}) self.Menu:MenuElement({id = "blank", type = SPACE , name = ""}) self.Menu:MenuElement({id = "blank", type = SPACE , name = "Script Ver: "..Version.. " - LoL Ver: "..LVersion.. ""}) self.Menu:MenuElement({id = "blank", type = SPACE , name = "by "..Author.. ""}) end function Blitzcrank:__init() self:LoadSpells() self:LoadMenu() Callback.Add("Tick", function() self:Tick() end) Callback.Add("Draw", function() self:Draw() end) local orbwalkername = "" if _G.SDK then orbwalkername = "IC'S orbwalker" elseif _G.EOW then orbwalkername = "EOW" elseif _G.GOS then orbwalkername = "Noddy orbwalker" else orbwalkername = "Orbwalker not found" end end function CurrentTarget(range) if _G.SDK then return _G.SDK.TargetSelector:GetTarget(range, _G.SDK.DAMAGE_TYPE_PHYSICAL); elseif _G.EOW then return _G.EOW:GetTarget(range) else return _G.GOS:GetTarget(range,"AD") end end function GetInventorySlotItem(itemID) assert(type(itemID) == "number", "GetInventorySlotItem: wrong argument types ( expected)") for _, j in pairs({ ITEM_1, ITEM_2, ITEM_3, ITEM_4, ITEM_5, ITEM_6}) do if myHero:GetItemData(j).itemID == itemID and myHero:GetSpellData(j).currentCd == 0 then return j end end return nil end function IsRecalling() for K, Buff in pairs(GetBuffs(myHero)) do if Buff.name == "recall" and Buff.duration > 0 then return true end end return false end function ValidTarget(target, range) range = range and range or math.huge return target ~= nil and target.valid and target.visible and not target.dead and target.distance <= range end function Blitzcrank:Tick() if myHero.dead or Game.IsChatOpen() == true or IsRecalling() == true then return end if self.Menu.Combo.comboActive:Value() then self:Combo() self:ComboE() end self:KillstealQ() self:KillstealE() self:KillstealR() self:SpellonCCQ() end function Blitzcrank:HasBuff(unit, buffname) for i = 0, unit.buffCount do local buff = unit:GetBuff(i) if buff.name == buffname and buff.count > 0 then return true end end return false end function Blitzcrank:GetValidMinion(range) for i = 1,Game.MinionCount() do local minion = Game.Minion(i) if minion.team ~= myHero.team and minion.valid and minion.pos:DistanceTo(myHero.pos) < 1150 then return true end end return false end function GetPercentHP(unit) return 100 * unit.health / unit.maxHealth end function GetPercentHPT(target) return 100 * target.health / target.maxHealth end function Blitzcrank:IsReady(spell) return Game.CanUseSpell(spell) == 0 end function Blitzcrank:CheckMana(spellSlot) return myHero:GetSpellData(spellSlot).mana < myHero.mana end function Blitzcrank:CanCast(spellSlot) return self:IsReady(spellSlot) and self:CheckMana(spellSlot) end function EnableMovement() SetMovement(true) end function ReturnCursor(pos) Control.SetCursorPos(pos) DelayAction(EnableMovement,0.1) end function LeftClick(pos) Control.mouse_event(MOUSEEVENTF_LEFTDOWN) Control.mouse_event(MOUSEEVENTF_LEFTUP) DelayAction(ReturnCursor,0.05,{pos}) end function Blitzcrank:GetValidMinion(range) for i = 1,Game.MinionCount() do local minion = Game.Minion(i) if minion.team ~= myHero.team and minion.valid and minion.pos:DistanceTo(myHero.pos) < 650 then return true end end return false end function Blitzcrank:GetEnemyHeroes() self.EnemyHeroes = {} for i = 1, Game.HeroCount() do local Hero = Game.Hero(i) if Hero.isEnemy then table.insert(self.EnemyHeroes, Hero) end end return self.EnemyHeroes end function Blitzcrank:EnemyInRange(range) local count = 0 for i, target in ipairs(self:GetEnemyHeroes()) do if target.pos:DistanceTo(myHero.pos) < range then count = count + 1 end end return count end ----------------------------- -- DRAWINGS ----------------------------- function Blitzcrank:Draw() if self.Menu.Drawings.Q.Enabled:Value() then Draw.Circle(myHero.pos, 950, self.Menu.Drawings.Q.Width:Value(), self.Menu.Drawings.Q.Color:Value()) end if self.Menu.Drawings.R.Enabled:Value() then Draw.Circle(myHero.pos, 600, self.Menu.Drawings.R.Width:Value(), self.Menu.Drawings.R.Color:Value()) end if self:CanCast(_Q) then if self:CanCast(_Q) then local target = CurrentTarget(Q.Range) if target == nil then return end local temppred if (TPred) then local castpos,HitChance, pos = TPred:GetBestCastPosition(target, Q.Delay , Q.Width, Q.Range, Q.Speed, myHero.pos, not Q.ignorecol, Q.Type ) Draw.Circle(castpos, 60, 3, Draw.Color(200, 255, 255, 255)) end end end end function Blitzcrank:CastSpell(spell,pos) local customcast = self.Menu.CustomSpellCast:Value() if not customcast then Control.CastSpell(spell, pos) return else local delay = self.Menu.delay:Value() local ticker = GetTickCount() if castSpell.state == 0 and ticker > castSpell.casting then castSpell.state = 1 castSpell.mouse = mousePos castSpell.tick = ticker if ticker - castSpell.tick < Game.Latency() then SetMovement(false) Control.SetCursorPos(pos) Control.KeyDown(spell) Control.KeyUp(spell) DelayAction(LeftClick,delay/1000,{castSpell.mouse}) castSpell.casting = ticker + 500 end end end end function Blitzcrank:HpPred(unit, delay) if _G.GOS then hp = GOS:HP_Pred(unit,delay) else hp = unit.health end return hp end ----------------------------- -- BUFFS ----------------------------- function Blitzcrank:IsImmobileTarget(unit) if unit == nil then return false end for i = 0, unit.buffCount do local buff = unit:GetBuff(i) if buff and (buff.type == 5 or buff.type == 11 or buff.type == 29 or buff.type == 24 or buff.type == 28 or buff.type == 21 or buff.type == 22) and buff.count > 0 then return true end end return false end ----------------------------- -- COMBO ----------------------------- function Blitzcrank:Combo() local target = CurrentTarget(Q.Range) if target == nil then return end if self.Menu.Combo.UseQ:Value() and target and self:CanCast(_Q) then local level = myHero:GetSpellData(_Q).level local castpos,HitChance, pos = TPred:GetBestCastPosition(target, Q.Delay , Q.Width, Q.Range,Q.Speed, myHero.pos, not Q.ignorecol, Q.Type ) if (HitChance > 0 ) and target.pos:DistanceTo(myHero.pos) > 450 then Control.CastSpell(HK_Q,castpos) end end end function Blitzcrank:ComboE() local target = CurrentTarget(E.Range) if target == nil then return end if self.Menu.Combo.UseE:Value() and target and self:CanCast(_E) then if self:EnemyInRange(E.Range) then Control.CastSpell(HK_E) end end end ----------------------------- -- KILLSTEAL ----------------------------- function Blitzcrank:QDMG() local level = myHero:GetSpellData(_Q).level local qdamage = ({80, 135, 190, 245, 300})[level] + 1.0 * myHero.ap return qdamage end function Blitzcrank:EDMG() local level = myHero:GetSpellData(_E).level local edamage = myHero.totalDamage * 2 return edamage end function Blitzcrank:RDMG() local level = myHero:GetSpellData(_R).level local rdamage = ({250, 375, 500})[level] + 1.0 * myHero.ap return rdamage end function Blitzcrank:IsValidTarget(unit,range) return unit ~= nil and unit.valid and unit.visible and not unit.dead and unit.isTargetable and not unit.isImmortal and unit.pos:DistanceTo(myHero.pos) <= 3340 end ----------------------------- -- Q KS ----------------------------- function Blitzcrank:KillstealQ() local target = CurrentTarget(Q.Range) if target == nil then return end if self.Menu.Killsteal.UseQ:Value() and target and self:CanCast(_Q) then if self:EnemyInRange(Q.Range) then local Qdamage = Blitzcrank:QDMG() local level = myHero:GetSpellData(_Q).level local castpos,HitChance, pos = TPred:GetBestCastPosition(target, Q.Delay , Q.Width, Q.Range,Q.Speed, myHero.pos, Q.ignorecol, Q.Type ) if (HitChance > 0 ) then if Qdamage >= self:HpPred(target,1) + target.hpRegen * 1 and not target.dead then Control.CastSpell(HK_Q,castpos) end end end end end ----------------------------- -- E KS ----------------------------- function Blitzcrank:KillstealE() local target = CurrentTarget(E.Range) if target == nil then return end if self.Menu.Killsteal.UseE:Value() and target and self:CanCast(_E) then if self:EnemyInRange(E.Range) then local Edamage = Blitzcrank:EDMG() if Edamage >= self:HpPred(target,1) + target.hpRegen * 1 and not target.dead then Control.CastSpell("E") Control.Attack(target) end end end end ----------------------------- -- R KS ----------------------------- function Blitzcrank:KillstealR() local target = CurrentTarget(R.Range) if target == nil then return end if self.Menu.Killsteal.RR["UseR"..target.charName]:Value() and target and self:CanCast(_R) then if self:EnemyInRange(R.Range) then local Rdamage = Blitzcrank:RDMG() if Rdamage >= self:HpPred(target,1) + target.hpRegen * 1 and not target.dead then Control.CastSpell(HK_R) end end end end ----------------------------- -- Q Spell on CC ----------------------------- function Blitzcrank:SpellonCCQ() local target = CurrentTarget(Q.Range) if target == nil then return end if self.Menu.isCC["UseQ"..target.charName]:Value() and target and self:CanCast(_Q) then if self:EnemyInRange(Q.Range) then local ImmobileEnemy = self:IsImmobileTarget(target) local level = myHero:GetSpellData(_Q).level local castpos,HitChance, pos = TPred:GetBestCastPosition(target, Q.Delay , Q.Width, Q.Range,Q.Speed, myHero.pos, Q.ignorecol, Q.Type ) if ImmobileEnemy then if (HitChance > 0 ) and target.pos2D.onScreen and target.visible then Control.CastSpell(HK_Q,castpos) end end end end end Callback.Add("Load",function() _G[myHero.charName]() end)