Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if myHero.charName ~= "Jayce" then return end
- PrintChat(" >> Jayce Helper loaded!")
- --[[
- » Jayce Helper [BoL Studio]
- by Manciuszz.
- modded/edited/made to work by xkjtx
- Press and hold "hot-key" key to do:
- » Auto Q > E combo(Mercury Cannon stance)
- » Auto Q (Hammer stance)
- » Will attempt to auto kill steal or "Last Hit" enemy champion with E
- ---- Run key (when hot-key is pressed R(if not in CONNON stance)-E-R in Hammer Stance
- --Added by xkjtx
- ]]
- --SETTINGS
- local showRanges = true --Displays Q range and Q > E max range when in Mercury Cannon stance(will show range only of the available spells(not on cooldown))
- local showGateRange = true --E(Acceleration Gate) range.
- local focusedTarget = true
- local AutoKnockBack = true -- Automatically knock backs incoming threats, for example: Malphite Ultimate charge, Xin Zhao E, Shen E(taunt).
- local EnableAutoE = true
- local QEHowFarAway = 100 --Cast Acceleration gate this far away when firing QE at your target. From 0 to 500 I prefer 200 cause it drops it near me, getting the buff with the improved blast almost instantly.
- local EDistance = 100 --Cast Acceleration gate this far away when firing QE at your cursor (great for clearing mobs). From 0 to 500 I prefer 200 cause it drops it near me, getting the buff with the improved blast almost instantly.
- local RefreshRate = 150 --function OnTick() refresh rate(How fast will it work) | Good Value is from 50 to 500
- local hotkey = 32 -- GetKey("S")
- local BurstKey = GetKey("S")
- local RunKey = string.byte("X")
- local targetCircle = 100 --Purple Circle of an enemy that is in Target Selectors scan range.
- --Globals
- local Delay = 0
- local scriptActive = false
- local BurstActive = false
- local RunActive = false
- --local delayFinished = GetTickCount()
- --local lastAA = GetTickCount()
- --local baseAS = 1/0.658
- --local attackSpeed = myHero.attackSpeed / baseAS
- -- Target Prediction
- local range = 1575
- local castRrange = 650
- local wrange = 600
- local proj_speed = 2.1
- local delay = 230
- local smoothness = 50
- --[[ Code ]]
- local ts = TargetSelector(TARGET_LOW_HP, range, true)
- local tp = TargetPrediction(range, proj_speed, delay, smoothness)
- --PrintChat(tostring(myHero:GetSpellData(_R).name))
- function OnLoad()
- velocityTimer = {}
- oldPos = {}
- Velocity = {}
- oldTick = {}
- velocity = 0
- velocityTimeOut = 5
- erange = 300
- conversionFactor = 975 --estimate. Converts coordinate velocity to game movement speed.
- msVarianceTrigger = 100 --will knock back when velocity > hero.ms + variance
- minMovementSpeed = 300 --minimum hero.ms to condemn. Sometimes hero.ms bugs and shows lesser values.
- for i = 1, heroManager.iCount, 1 do
- local hero = heroManager:getHero(i)
- if hero.team == TEAM_ENEMY then
- oldPos[hero.name] = {}
- oldTick[hero.name] = {}
- Velocity[hero.name] = 0
- velocityTimer[hero.name] = 0
- end
- end
- end
- function findmyHeroVelocity(target, oldPos, oldTick)
- if oldPos.x and oldPos.z and target.x and target.z then
- dis = math.sqrt((oldPos.x - target.x) ^ 2 + (oldPos.z - target.z) ^ 2)
- Velocity[target.name] = (dis / (GetTickCount() - oldTick)) * conversionFactor
- end
- end
- function OnTick()
- if myHero.dead then return end --If dead. Do nothing.
- if Delay > GetTickCount() then return end
- Delay = GetTickCount() + RefreshRate
- ts:update()
- if scriptActive and ts.target ~= nil and GetDistance(ts.target) <= range and myHero:GetSpellData(_R).name == "jaycestancegth" then
- local predictedPos = tp:GetPrediction(ts.target)
- if (myHero:CanUseSpell(_Q) == READY and myHero:CanUseSpell(_E) == READY) then
- if predictedPos ~= nil then
- EnemyPos = Vector(predictedPos.x, predictedPos.y, predictedPos.z)
- HeroPos = Vector(myHero.x, myHero.y, myHero.z)
- GatePos = HeroPos + ( HeroPos - EnemyPos )*(-QEHowFarAway/GetDistance(predictedPos))
- if (myHero:CanUseSpell(_Q) == READY and myHero:CanUseSpell(_E) == READY) then
- CastSpell(_Q, predictedPos.x, predictedPos.z) -- _Q has a ~0.5s channel time and casting E doesn't cancel it, making pretty comfty combo
- CastSpell(_E, GatePos.x, GatePos.z) -- Drops it near yourself.This way YOU GET THE SPEED BOOST almost IMMEDIATELY + You get almost instant powered Q.
- end
- end
- end
- if ts.target ~= nil and myHero:CanUseSpell(_W) == READY and GetDistance(ts.target) <= wrange then
- CastSpell(_W)
- end
- if ts.target ~= nil and GetDistance(ts.target) <= range then
- myHero:Attack(ts.target)
- end
- if ts.target ~= nil and myHero:CanUseSpell(_R) == READY and myHero:CanUseSpell(_Q) == COOLDOWN and myHero:CanUseSpell(_W) == COOLDOWN and myHero:CanUseSpell(_E) == COOLDOWN and GetDistance(ts.target) >= castRrange then
- CastSpell(_R)
- end
- end
- if BurstActive then
- if myHero:GetSpellData(_R).name == "jaycestancegth" then
- EnemyPos = Vector(mousePos.x, mousePos.y, mousePos.z)
- HeroPos = Vector(myHero.x, myHero.y, myHero.z)
- GatePos = HeroPos + ( HeroPos - EnemyPos )*(-EDistance/GetDistance(mousePos))
- if (myHero:CanUseSpell(_Q) == READY and myHero:CanUseSpell(_E) == READY) then
- CastSpell(_Q, mousePos.x,mousePos.z)
- CastSpell(_E, GatePos.x, GatePos.z)
- end
- end
- if ts.target ~= nil and myHero:CanUseSpell(_W) == READY and GetDistance(ts.target) <= wrange then
- CastSpell(_W)
- end
- if ts.target ~= nil and GetDistance(ts.target) <= range then
- myHero:Attack(ts.target)
- end
- end
- -- local function attack()
- -- ts:update()
- --
- -- if myHero:GetSpellData(_R).name == "JayceStanceHtG" then
- -- lrange = 250
- -- elseif myHero:GetSpellData(_R).name == "jaycestancegth" then
- -- lrange = 600
- -- end
- --
- -- if ts.target ~= nil and GetDistance(myHero,ts.target) <= lrange and GetTickCount() - lastAA > 1000/attackSpeed then
- -- myHero:Attack(ts.target)
- -- delayFinished = nil
- -- lastAA = GetTickCount()
- -- elseif delayFinished ~= nil then
- -- if GetTickCount() - delayFinished > 100 then
- -- myHero:MoveTo(mousePos.x, mousePos.z)
- -- end
- -- end
- -- end
- if myHero:GetSpellData(_R).name == "JayceStanceHtG" and scriptActive then -- When in Hammer form go dunk that enemy and attack-kite him.
- if ValidTarget(ts.target, 600) then
- if (myHero:CanUseSpell(_Q) == READY and myHero:CanUseSpell(_W) == READY) then
- CastSpell(_Q, ts.target)
- CastSpell(_W)
- end
- if ts.target ~= nil and GetDistance(ts.target) <= range then
- myHero:Attack(ts.target)
- end
- end
- end
- if EnableAutoE then --Auto Last Hit
- if myHero:GetSpellData(_R).name == "JayceStanceHtG" then
- if ValidTarget(ts.target) then
- local jayceEhammerdmg = myHero.addDamage +((3 * myHero:GetSpellData(_E).level + 5)*ts.target.maxHealth/100)
- if ts.target.health < jayceEhammerdmg and ValidTarget(ts.target, 350) then
- if myHero:CanUseSpell(_E) == READY and ValidTarget(ts.target, 350) then
- CastSpell(_E, ts.target)
- end
- end
- end
- end
- end
- if RunActive then
- if myHero:GetSpellData(_R).name == "jaycestancegth" then
- EnemyPos = Vector(mousePos.x, mousePos.y, mousePos.z)
- HeroPos = Vector(myHero.x, myHero.y, myHero.z)
- GatePos = HeroPos + ( HeroPos - EnemyPos )*(-EDistance/GetDistance(mousePos))
- if myHero:CanUseSpell(_E) == READY then
- CastSpell(_E, GatePos.x, GatePos.z)
- end
- CastSpell(_R)
- end
- if myHero:GetSpellData(_R).name == "JayceStanceHtG" then
- CastSpell(_R)
- end
- end
- -- if delayFinished == nil and lastAA - 300 > GetTickCount() then
- -- delayFinished = GetTickCount()
- -- end
- if AutoKnockBack then
- for i = 1, heroManager.iCount, 1 do
- local hero = heroManager:getHero(i)
- if ValidTarget(hero, nil, true) then
- if velocityTimer[hero.name] <= GetTickCount() and hero and hero.x and hero.z then
- velocityTimer[hero.name] = GetTickCount() + velocityTimeOut
- findmyHeroVelocity(hero, oldPos[hero.name], oldTick[hero.name])
- oldPos[hero.name].x = hero.x
- oldPos[hero.name].z = hero.z
- oldTick[hero.name] = GetTickCount()
- end
- if Velocity[hero.name] > (hero.ms + msVarianceTrigger) and hero.ms > minMovementSpeed and GetDistance(myHero, hero) < erange then
- if myHero:GetSpellData(_R).name == "jaycestancegth" and myHero:GetSpellData(_E).level > 0 then
- CastSpell(_R)
- CastSpell(_E,hero)
- elseif myHero:GetSpellData(_R).name == "JayceStanceHtG" and myHero:CanUseSpell(_E) == READY then
- CastSpell(_E,hero)
- PrintChat("" .. Velocity[hero.name])
- end
- end
- end
- end
- end
- end
- function OnDraw()
- if myHero.dead then return end
- if focusedTarget then
- if ts.target ~= nil then
- DrawCircle(ts.target.x, ts.target.y, ts.target.z, targetCircle, 0x990099)
- end
- end
- if showRanges then
- if myHero:GetSpellData(_R).name == "jaycestancegth" then --if in Mercury Cannon stance
- if myHero:CanUseSpell(_Q) == READY and myHero:CanUseSpell(_E) == READY then
- DrawCircle(myHero.x, myHero.y, myHero.z, range, 0xFF00FF00) --40% increased range cause of Acceleration Gate.
- elseif myHero:CanUseSpell(_Q) == READY and myHero:CanUseSpell(_E) ~= READY then
- DrawCircle(myHero.x, myHero.y, myHero.z, 1050, 0xFF00FF00)
- end
- if showGateRange then
- DrawCircle(myHero.x, myHero.y, myHero.z, 675, 0xFF00FF00)
- end
- elseif myHero:GetSpellData(_R).name == "JayceStanceHtG" then
- if myHero:CanUseSpell(_Q) == READY and myHero:CanUseSpell(_E) ~= READY then
- DrawCircle(myHero.x, myHero.y, myHero.z, 600, 0xFF00FF00)
- elseif myHero:CanUseSpell(_Q) == READY then
- DrawCircle(myHero.x, myHero.y, myHero.z, 600, 0xFF00FF00)
- elseif myHero:CanUseSpell(_E) == READY then
- DrawCircle(myHero.x, myHero.y, myHero.z, 305, 0xFF00FF00)
- end
- end
- end
- end
- function OnWndMsg(msg,key)
- if key == hotkey then
- if msg == KEY_DOWN then
- --if ts.target == nil then myHero:MoveTo(mousePos.x, mousePos.z) end
- scriptActive = true
- else
- scriptActive = false
- end
- end
- if key == BurstKey then
- if msg == KEY_DOWN then
- if ts.target == nil then myHero:MoveTo(mousePos.x, mousePos.z) end
- BurstActive = true
- else
- BurstActive = false
- end
- end
- if key == RunKey then
- if msg == KEY_DOWN then
- if ts.target == nil then myHero:MoveTo(mousePos.x, mousePos.z) end
- RunActive = true
- else
- RunActive = false
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement