Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Rengar The Rapist by jbman
- ]]
- if myHero.charName ~= "Rengar" then return end
- require "AllClass"
- --[[ Code ]]
- local mousemoving = true
- local movedelay = 0
- local unitScanDelay = 0
- local waitDelay = 300
- local scanAdditionalRange = 500
- local units = {}
- local oldDelayTick = 0
- local unitScanTick = 0
- local holding = 0
- local animPlayedTick = nil
- local nextTick = 0
- local lasthiton = true
- local wrange = 475
- local range = 750
- local erange = 650
- local lastBasicAttack = 0
- local swingDelay = 0.15
- local swing = 0
- local tick = nil
- local targetSelected = true
- local ts
- local ignite = nil
- local GPLSlot, BRKSlot, DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = nil, nil, nil, nil, nil, nil, nil, nil
- local QREADY, WREADY, EREADY, RREADY, BRKREADY, DFGREADY, HXGREADY, BWCREADY = false, false, false, false, false, false, false, false
- function OnLoad()
- RCConfig = scriptConfig("Rengar the Rapist", "rengartherapist ")
- RCConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 88)
- RCConfig:addParam("scriptActive2", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 90)
- RCConfig:addParam("scriptActive3", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 67)
- RCConfig:addParam("escape", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 89)
- RCConfig:addParam("harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, 84)
- RCConfig:addParam("SHIELD", "Shield", SCRIPT_PARAM_ONKEYDOWN, false, 85) -- Uu
- RCConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
- RCConfig:addParam("drawtext", "Draw Text", SCRIPT_PARAM_ONOFF, true)
- RCConfig:addParam("autoAAFarm", "Auto AA Farm", SCRIPT_PARAM_ONKEYDOWN, false, 192) -- `~
- RCConfig:addParam("autoignite", "Auto Ignite", SCRIPT_PARAM_ONOFF, true)
- RCConfig:permaShow("autoAAFarm")
- ts = TargetSelector(TARGET_LOW_HP,range+200,DAMAGE_PHYSICAL,true)
- ts.name = "Rengar"
- RCConfig:addTS(ts)
- if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
- elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2
- end
- end
- function OnProcessSpell(unit, spell)
- if unit.isMe then
- if spell and spell.name:find("RengarBasicAttack" or "RengarCritAttack") then
- swing = 1
- lastBasicAttack = os.clock()
- end
- if spell and spell.name:find("RengarQ")then
- swing = 0
- end
- end
- end
- function OnCreateObj(obj)
- if obj and (obj.name == "Rengar_LeapEnd.troy") and GetDistance(obj) < 150 then
- swing = 1
- lastBasicAttack = os.clock()
- --leap = 1
- --PrintChat(" >> Rengar Leap!")
- end
- end
- function OnTick()
- if myHero.dead then
- return
- end
- if swing == 1 and os.clock() > lastBasicAttack + 0.5 then
- swing = 0
- end
- if ignite ~= nil and myHero:CanUseSpell(ignite) == READY then
- if IREADY then
- local ignitedmg = 0
- for j = 1, heroManager.iCount, 1 do
- local enemyhero = heroManager:getHero(j)
- if ValidTarget(enemyhero,600) then
- ignitedmg = 50 + 20 * myHero.level
- if enemyhero.health <= (ignitedmg - 50) then
- CastSpell(ignite, enemyhero)
- end
- end
- end
- end
- end
- GPLSlot, BRKSlot, DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3159), GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100)
- QREADY = (myHero:CanUseSpell(_Q) == READY)
- WREADY = (myHero:CanUseSpell(_W) == READY)
- EREADY = (myHero:CanUseSpell(_E) == READY)
- RREADY = (myHero:CanUseSpell(_R) == READY)
- DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
- HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
- BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
- GPLREADY = (GPLSlot ~= nil and myHero:CanUseSpell(GPLSlot) == READY)
- IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
- ts:update()
- if RCConfig.harass and ts.target ~= nil then
- if EREADY and GetDistance(ts.target) < erange then
- CastSpell(_E, ts.target)
- end
- end
- if RCConfig.scriptActive and ts.target ~= nil then
- if DFGREADY then CastSpell(DFGSlot, ts.target) end
- if HXGREADY then CastSpell(HXGSlot, ts.target) end
- if BWCREADY then CastSpell(BWCSlot, ts.target) end
- if BRKREADY then CastSpell(BRKSlot, ts.target) end
- if myHero.mana < 5 and GetDistance(ts.target) < wrange and WREADY then
- CastSpell(_W)
- end
- if swing == 0 then
- if (GetDistance(ts.target) < erange and GetDistance(ts.target) > 225) and EREADY then
- CastSpell(_E, ts.target)
- end
- if ValidTarget(ts.target, wrange) then
- myHero:Attack(ts.target)
- end
- elseif swing == 1 then
- if EREADY and os.clock() - lastBasicAttack > swingDelay then
- CastSpell(_E, ts.target)
- swing = 0
- elseif myHero.mana < 5 and QREADY and not EREADY and os.clock() - lastBasicAttack > swingDelay then
- CastSpell(_Q)
- myHero:Attack(ts.target)
- swing = 0
- end
- end
- end
- if RCConfig.scriptActive2 and ts.target ~= nil then
- if DFGREADY then CastSpell(DFGSlot, ts.target) end
- if HXGREADY then CastSpell(HXGSlot, ts.target) end
- if BWCREADY then CastSpell(BWCSlot, ts.target) end
- if BRKREADY then CastSpell(BRKSlot, ts.target) end
- if myHero.mana < 5 and GetDistance(ts.target) < wrange and WREADY then
- CastSpell(_W)
- end
- if swing == 0 then
- if myHero.mana == 4 and not (WREADY or QREADY) and (GetDistance(ts.target) < erange and GetDistance(ts.target) > 225) and EREADY then
- CastSpell(_E, ts.target)
- end
- if ts.target ~= nil and ValidTarget(ts.target, wrange) then
- myHero:Attack(ts.target)
- end
- elseif swing == 1 then
- if QREADY and os.clock() - lastBasicAttack > swingDelay then
- CastSpell(_Q)
- myHero:Attack(ts.target)
- swing = 0
- elseif myHero.mana == 4 and not (WREADY or QREADY) and os.clock() - lastBasicAttack > swingDelay then
- CastSpell(_E, ts.target)
- swing = 0
- end
- end
- end
- if RCConfig.scriptActive3 and ts.target ~= nil then
- if DFGREADY then CastSpell(DFGSlot, ts.target) end
- if HXGREADY then CastSpell(HXGSlot, ts.target) end
- if BWCREADY then CastSpell(BWCSlot, ts.target) end
- if BRKREADY then CastSpell(BRKSlot, ts.target) end
- if GetDistance(ts.target) < wrange and WREADY then
- CastSpell(_W)
- end
- if swing == 0 then
- if myHero.mana == 4 and not (WREADY or QREADY) and (GetDistance(ts.target) < erange and GetDistance(ts.target) > 225) and EREADY then
- CastSpell(_E, ts.target)
- end
- if ts.target ~= nil and ValidTarget(ts.target, wrange) then
- myHero:Attack(ts.target)
- end
- elseif swing == 1 then
- if myHero.mana < 5 and QREADY and os.clock() - lastBasicAttack > swingDelay then
- CastSpell(_Q)
- myHero:Attack(ts.target)
- swing = 0
- elseif myHero.mana == 4 and not (WREADY or QREADY) and os.clock() - lastBasicAttack > swingDelay then
- CastSpell(_E, ts.target)
- swing = 0
- end
- end
- end
- if RCConfig.autoAAFarm then
- if mousemoving and GetTickCount() > nextTick then
- player:MoveTo(mousePos.x, mousePos.z)
- end
- local tick = GetTickCount()
- if lasthiton then
- unitScanTick = tick
- for i = 1, objManager.maxObjects, 1 do
- local object = objManager:getObject(i)
- if object ~= nil and object.team ~= player.team and object.type == "obj_AI_Minion" and string.find(object.charName,"Minion") then
- if not object.dead and GetDistance(object,player) <= (player.range + scanAdditionalRange) then
- if units[object.name] == nil then
- units[object.name] = { obj = object, markTick = 0 }
- end
- else
- units[object.name] = nil
- end
- end
- end
- end
- for i, unit in pairs(units) do
- if unit.obj == nil or unit.obj.dead or GetDistance(player,unit.obj) > (player.range + scanAdditionalRange) then
- units[i] = nil
- else
- if unit.obj.health <= (myHero:CalcDamage(unit.obj,myHero.totalDamage)) then --
- if lasthiton and GetTickCount() > nextTick then
- player:Attack(unit.obj) ---PrintChat("ATTACKING")
- nextTick = GetTickCount() + waitDelay
- return
- end
- end
- end
- end
- end
- end
- function OnDraw()
- if RCConfig.drawcircles and not myHero.dead then
- if WREADY then DrawCircle(myHero.x, myHero.y, myHero.z, wrange, 0x992D3D) end
- if EREADY then DrawCircle(myHero.x, myHero.y, myHero.z, erange, 0xFFFFFF) end
- if ts.target ~= nil then
- for j=0, 10 do DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00) end
- end
- end
- SC__OnDraw()
- end
- function OnWndMsg(msg,key)
- SC__OnWndMsg(msg,key)
- end
- function OnSendChat(msg)
- TargetSelector__OnSendChat(msg)
- ts:OnSendChat(msg, "pri")
- end
- PrintChat(" >> Rengar the Rapist loaded!")
Advertisement
Add Comment
Please, Sign In to add comment