Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if myHero.charName ~= "LeeSin" and myHero.charName ~= "Jax" and myHero.charName ~= "Katarina" and myHero.charName ~= "JarvanIV" then return end
- casted = false
- hold = false
- castedWard = false
- Wards = {}
- ID = {--[[RSStone]] 2045, --[[SStone]] 2049, --[[RSLantern]] 3340, --[[RLantern]] 3350, --[[RGLantern]] 3361, --[[Quill Coat]] 3205, --[[Wriggles]] 3154, --[[SpiritGolem]] 3207, --[[SWard]] 2044, --[[VWard]] 2043, --[[RVLantern]] 3362, --[[FFlare]] 3160}
- if (myHero.charName == "LeeSin") then
- JumperAbility = _W
- end
- if (myHero.charName == "Katarina") then
- JumperAbility = _E
- end
- if (myHero.charName == "Jax") then
- JumperAbility = _Q
- end
- function OnLoad()
- PrintChat("MiniJumper")
- ConfigBasic = scriptConfig("MiniJumper", "MiniJumper")
- ConfigBasic:addParam("wardjump", "Jump key", SCRIPT_PARAM_ONKEYDOWN, false, GetKey("G"))
- ConfigBasic:addParam("DrawRange", "Draw Jump range", SCRIPT_PARAM_ONOFF, false)
- ConfigBasic:addParam("DrawScanRange", "Draw Ward Position", SCRIPT_PARAM_ONOFF, true)
- for i = 1, objManager.maxObjects do
- local object = objManager:GetObject(i)
- if object ~= nil and object.valid and (object.name == "SightWard" or object.name == "VisionWard") then
- table.insert(Wards, object)
- end
- end
- end
- function OnDraw()
- if ConfigBasic.DrawRange then
- if myHero.charName == "JarvanIV" then
- DrawCircle(myHero.x, myHero.y, myHero.z, 800, ARGB(0, 255, 0, 255))
- else
- DrawCircle(myHero.x, myHero.y, myHero.z, 625, ARGB(0, 255, 0, 255))
- end
- end
- if (ConfigBasic.DrawScanRange and (myHero:CanUseSpell(JumperAbility) == READY and (myHero.charName ~= "LeeSin" or myHero:GetSpellData(JumperAbility).name == "BlindMonkWOne"))) then
- local pos = getMousePos()
- if (GetWardSlot() == nil) then
- if (GetDistance(mousePos) <= 600) then
- pos = mousePos
- end
- end
- DrawCircle(pos.x, pos.y, pos.z, 150, ARGB(255, 255, 255, 0))
- end
- end
- function OnRecvPacket(p)
- if p.header == 0x07 and castedWard then
- p.pos = 5
- if myHero.networkID == (p:DecodeF()) then
- p.pos = 1
- wardNetID = p:DecodeF()
- if myHero:CanUseSpell(JumperAbility) == READY and (myHero.charName ~= "LeeSin" or myHero:GetSpellData(JumperAbility).name == "BlindMonkWOne") then
- Packet('S_CAST', { spellId = JumperAbility, targetNetworkId = wardNetID }):send()
- end
- end
- end
- end
- function OnSendPacket(p)
- if (p.header == _G.Packet.headers.S_CAST and casted) then
- local packet = Packet(p)
- if (packet:get('sourceNetworkId') == myHero.networkID) then
- local location = packet:get('spellId')
- if (location ~= 11) then
- for i, ward in ipairs(ID) do
- if (myHero:getInventorySlot(location) == ward) then
- if not castedWard then
- castedWard = true
- DelayAction(function() castedWard = false casted = false end, 4)
- else
- p:Block()
- end
- end
- end
- else
- if not castedWard then
- castedWard = true
- DelayAction(function() castedWard = false casted = false end, 4)
- else
- p:Block()
- end
- end
- end
- end
- end
- function OnTick()
- if not ConfigBasic.wardjump then hold = false return end
- if not hold then
- hold = true
- if myHero.charName == "LeeSin" or myHero.charName == "Jax" or myHero.charName == "Katarina" then
- if myHero:CanUseSpell(JumperAbility) == READY and (myHero.charName ~= "LeeSin" or myHero:GetSpellData(JumperAbility).name == "BlindMonkWOne") then
- local pos = getMousePos()
- table.sort(Wards, function(x,y) return GetDistance(x) < GetDistance(y) end)
- for i, ward in ipairs(Wards) do
- if (GetDistance(ward, pos) <= 150) then
- CastSpell(JumperAbility, ward)
- return
- end
- end
- slot = GetWardSlot()
- if slot == nil then PrintAlert("Error: No Wards.", 4, 255, 0, 0) return end
- casted = true
- CastSpell(slot, pos.x, pos.z)
- return true
- else
- PrintAlert("Eror: Spell on CD", 4, 255, 0, 0)
- end
- end
- if myHero.charName == "JarvanIV" and myHero:CanUseSpell(_E) == READY and myHero:CanUseSpell(_Q) == READY and myHero:GetSpellData(_Q).mana + myHero:GetSpellData(_E).mana < myHero.mana then
- local pos = GetDistance(mousePos) <= 770 and mousePos or getMousePos(770)
- CastSpell(_E, pos.x, pos.z)
- CastSpell(_Q, pos.x, pos.z)
- end
- end
- end
- function OnCreateObj(obj)
- if obj ~= nil and obj.valid then
- if obj.name == "SightWard" or obj.name == "VisionWard" then
- table.insert(Wards, obj)
- end
- end
- end
- function getMousePos(range)
- local temprange = range or 600
- local MyPos = Vector(myHero.x, myHero.y, myHero.z)
- local MousePos = Vector(mousePos.x, mousePos.y, mousePos.z)
- return MyPos - (MyPos - MousePos):normalized() * temprange
- end
- function GetWardSlot()
- for _, wardID in ipairs(ID) do
- slot = GetInventorySlotItem(wardID)
- if slot ~= nil and myHero:CanUseSpell(slot) == READY then
- return slot
- end
- end
- return nil
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement