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).
- ]]
- --[[ Config ]]
- local myObjectsTable = {}
- 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", "Draw", SCRIPT_PARAM_ONKEYDOWN, false, 71)
- SJConfig:addParam("jumpActive", "Ward jump", SCRIPT_PARAM_ONKEYDOWN, false, 71)
- SJConfig:permaShow("jumpActive")
- lastJump = 0
- 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
- 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 wardSqr = math.sqrt((mousePos.x - myHero.x)^2+(mousePos.z - myHero.z)^2)
- local x = myHero.x + wardRange*((mousePos.x - myHero.x)/wardSqr)
- local z = myHero.z + wardRange*((mousePos.z - myHero.z)/wardSqr)
- 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
- if player:CanUseSpell(jumpSlot) == READY and GetTickCount() - lastJump > 5000 then
- CastSpell(wardSlot, x, z)
- jumpReady = true
- lastJump = GetTickCount()
- end
- end
- end
- end
- --[[ if wardSlot ~= nil and jumpSlot ~= nil then
- if player:CanUseSpell(jumpSlot) == READY and GetTickCount() - lastJump > 2000 then
- CastSpell(wardSlot, x, z)
- jumpReady = true
- lastJump = GetTickCount()
- 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 GetDistance(object) <= jumpRange then
- if GetDistance(object, mousePos) <= 250 then
- CastSpell(jumpSlot, object)
- jumpReady = false
- end
- 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