Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Smart Jump 2.0
- Original Author and All Credits to ikita
- Updated by HeX
- Attempts to ward jump (Stones->Vision->Sight->Wriggles) before trying to flash.
- ]]
- --[[ Config ]]
- local myObjectsTable = {}
- local flashRange = 540
- local wardRange = 600
- local jumpDelay = 0
- local SWard, VWard, SStone, RSStone, Wriggles = 2044, 2043, 2049, 2045, 3154
- local SWardSlot, VWardSlot, SStoneSlot, RSStoneSlot, WrigglesSlot = nil, nil, nil, nil, nil
- local lastJump = 0
- local wardTarget
- local jumpReady = false
- function OnLoad()
- PrintChat("<font color='#CCCCCC'> >> Smart Jump 2.0 loaded! <<</font>")
- PrintChat("<font color='#CCCCCC'> >> Credit to ikita <<</font>")
- PrintChat("<font color='#CCCCCC'> >> Updated by HeX <<</font>")
- SJConfig = scriptConfig("Smart Jump Config", "SmartJump")
- SJConfig:addParam("drawActive", "Ward jump", SCRIPT_PARAM_ONKEYDOWN, false, 71)
- SJConfig:addParam("jumpActive", "Ward jump", SCRIPT_PARAM_ONKEYDOWN, false, 71)
- SJConfig:addParam("includeFlash", "Use Flash", SCRIPT_PARAM_ONKEYTOGGLE, false, 48)
- SJConfig:permaShow("jumpActive")
- SJConfig:permaShow("includeFlash")
- if player.charName == "Katarina" then
- jumpSlot = _E
- jumpRange = 700
- elseif player.charName == "Jax" then
- jumpSlot = _Q
- jumpRange = 700
- elseif player.charName == "LeeSin" then
- jumpSlot = _W
- jumpRange = 700
- else
- jumpSlot = nil
- jumpRange = 0
- end
- if myHero:GetSpellData(SUMMONER_1).name:find("SummonerFlash") then
- flashSlot = SUMMONER_1
- elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerFlash") then
- flashSlot = SUMMONER_2
- else flashSlot = nil
- end
- for i = 0, objManager.maxObjects, 1 do
- local object = objManager:GetObject(i)
- if objectIsValid(object) then table.insert(myObjectsTable, object) end
- end
- end
- function OnTick()
- if jumpReady == true and GetTickCount() - lastJump > jumpDelay then
- jumpNowAlready()
- end
- if SJConfig.jumpActive then
- local x = mousePos.x
- local z = mousePos.z
- local dx = x - player.x
- local dz = z - player.z
- local rad1 = math.atan2(dz, dx)
- SWardSlot = GetInventorySlotItem(SWard)
- VWardSlot = GetInventorySlotItem(VWard)
- SStoneSlot = GetInventorySlotItem(SStone)
- RSStoneSlot = GetInventorySlotItem(RSStone)
- WrigglesSlot = GetInventorySlotItem(Wriggles)
- if RSStoneSlot ~= nil and CanUseSpell(RSStoneSlot) == READY then
- wardSlot = RSStoneSlot else
- if SStoneSlot ~= nil and CanUseSpell(SStoneSlot) == READY then
- wardSlot = SStoneSlot else
- if SWardSlot ~= nil then
- wardSlot = SWardSlot else
- if VWardSlot ~= nil then
- wardSlot = VWardSlot else
- if WrigglesSlot ~= nil then
- wardSlot = WrigglesSlot
- else wardSlot = nil
- end
- end
- end
- end
- end
- if wardSlot ~= nil and jumpSlot ~= nil then
- local dx1 = flashRange*math.cos(rad1)
- local dz1 = flashRange*math.sin(rad1)
- local x1 = x - dx1
- local z1 = z - dz1
- if player:CanUseSpell(jumpSlot) == READY and GetTickCount() - lastJump > 2000 and math.sqrt(dx*dx + dz*dz) <= 600 then
- CastSpell( wardSlot, x, z )
- jumpReady = true
- lastJump = GetTickCount()
- elseif player:CanUseSpell(jumpSlot) == READY then
- player:MoveTo(x1, z1)
- else myHero:StopPosition()
- end
- end
- if SJConfig.includeFlash and (not (jumpSlot ~= nil and wardSlot ~= nil and player:CanUseSpell(jumpSlot) == READY)) and flashSlot ~= nil then
- local dx1 = flashRange*math.cos(rad1)
- local dz1 = flashRange*math.sin(rad1)
- local x1 = x - dx1
- local z1 = z - dz1
- if GetTickCount() - lastJump > 2000 and math.sqrt(dx*dx + dz*dz) < flashRange + 90 then
- CastSpell( flashSlot, x, z )
- lastJump = GetTickCount()
- else player:MoveTo(x1, z1)
- end
- end
- end
- end
- function objectIsValid(object)
- return object and object.valid and (string.find(object.name, "Ward") ~= nil or string.find(object.name, "Wriggle") ~= nil)
- end
- function jumpNowAlready()
- if SJConfig.jumpActive and jumpReady == true then
- for i,object in ipairs(myObjectsTable) do
- if object ~= nil and object.valid and math.sqrt((object.x-mousePos.x)^2+(object.z-mousePos.z)^2) < 150 then
- CastSpell(jumpSlot, object)
- jumpReady = false
- else table.remove(myObjectsTable, i) i = i - 1
- end
- end
- end
- end
- function OnCreateObj(object)
- if objectIsValid(object) then table.insert(myObjectsTable, object) end
- end
- function OnDraw()
- if SJConfig.drawActive and not myHero.dead then
- DrawCircle(myHero.x, myHero.y, myHero.z, wardRange, 0x0000FF)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment