Advertisement
Guest User

Rengar - The Pridestalker

a guest
Jan 18th, 2016
605
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.53 KB | None | 0 0
  1. --         _____   ______  _   _   _____            _____          --
  2. --        |  __ \ |  ____|| \ | | / ____|    /\    |  __ \         --
  3. --        | |__) || |__   |  \| || |  __    /  \   | |__) |        --
  4. --        |  _  / |  __|  | . ` || | |_ |  / /\ \  |  _  /         --
  5. --        | | \ \ | |____ | |\  || |__| | / ____ \ | | \ \         --
  6. --        |_|  \_\|______||_| \_| \_____|/_/    \_\|_|  \_\        --                                                
  7. --   _   _          ___     _    _        _        _ _             --
  8. --  | |_| |_  ___  | _ \_ _(_)__| |___ __| |_ __ _| | |_____ _ _   --
  9. --  |  _| ' \/ -_) |  _/ '_| / _` / -_|_-<  _/ _` | | / / -_) '_|  --
  10. --   \__|_||_\___| |_| |_| |_\__,_\___/__/\__\__,_|_|_\_\___|_|    --
  11. --                           ___                        __         --
  12. --                          /\_ \                      /\ \        --
  13. --        __   __  __    ___\//\ \    __  __     __    \_\ \       --
  14. --      /'__`\/\ \/\ \  / __`\\ \ \  /\ \/\ \  /'__`\  /'_` \      --
  15. --     /\  __/\ \ \_/ |/\ \L\ \\_\ \_\ \ \_/ |/\  __/ /\ \L\ \     --
  16. --     \ \____\\ \___/ \ \____//\____\\ \___/ \ \____\\ \___,_\    --
  17. --      \/____/ \/__/   \/___/ \/____/ \/__/   \/____/ \/__,_ /    --
  18.  
  19.  
  20. require("Inspired")
  21. require("DamageLib")
  22.  
  23. class "Rengar"
  24. function Rengar:__init()
  25.   Rengo = MenuConfig("Rengar - The Pridestalker", "Rengar")
  26.   Rengo:Menu("Combo", "Combo")
  27.   Rengo.Combo:DropDown("combo_mode", "One Shot Mode", 1, {"Q-E-W", "E-Q-W"})
  28.   Rengo.Combo:KeyBinding("combo_mode_change", "Change One Shot Mode", string.byte("T"), true, function(oneshotmode_change)
  29.     local priority = Rengo.Combo.combo_mode:Value()
  30.     Rengo.Combo.combo_mode:Value(priority+1)
  31.     if Rengo.Combo.combo_mode:Value() == 3 then Rengo.Combo.combo_mode:Value(1) end
  32.     if Rengo.Combo.combo_mode:Value() == 1 then
  33.         PrintChat("<font color='#f3f3f3'>One Shot Mode changed to </font><font color='#af0000'>[Q-E-W]</font>")
  34.     elseif Rengo.Combo.combo_mode:Value() == 2 then
  35.         PrintChat("<font color='#f3f3f3'>One Shot Mode changed to </font><font color='#af0000'>[E-Q-W]</font>")
  36.     end
  37. end)
  38.   Rengo.Combo:DropDown("empowered_prioritize", "Empowered Prioritize:", 1, {"Q", "E", "W"})
  39.   Rengo.Combo:KeyBinding("empowered_prioritize_key", "Toggle Empowered Priority", string.byte("G"), true, function(priority_change)
  40.     local priority = Rengo.Combo.empowered_prioritize:Value()
  41.     Rengo.Combo.empowered_prioritize:Value(priority+1)
  42.     if Rengo.Combo.empowered_prioritize:Value() == 4 then Rengo.Combo.empowered_prioritize:Value(1) end
  43.     if Rengo.Combo.empowered_prioritize:Value() == 1 then
  44.         PrintChat("<font color='#f3f3f3'>Empowered Priorty changed to </font><font color='#af0000'>[Q]</font>")
  45.     elseif Rengo.Combo.empowered_prioritize:Value() == 2 then
  46.         PrintChat("<font color='#f3f3f3'>Empowered Priorty changed to </font><font color='#af0000'>[E]</font>")
  47.     elseif Rengo.Combo.empowered_prioritize:Value() == 3 then
  48.         PrintChat("<font color='#f3f3f3'>Empowered Priorty changed to </font><font color='#af0000'>[W]</font>")
  49.     end
  50. end)
  51.   Rengo.Combo:Boolean("one_shotable", "Draw One Shotable Text", true)
  52.   Rengo.Combo:Info("empoweredW_info", "Use empowered W if")
  53.   Rengo.Combo:Slider("empoweredW", "%HP <", 20, 0, 90, 1)
  54.  
  55.   Rengo:Menu("Harass", "Harass")
  56.   Rengo.Harass:Boolean("Q", "Use Q", true)
  57.   Rengo.Harass:Boolean("W", "Use W", true)
  58.   Rengo.Harass:Boolean("E", "Use E", true)
  59.  
  60.   Rengo:Menu("Misc", "Misc")
  61.   if Ignite ~= nil then Rengo.Misc:Boolean("Autoignite", "Auto Ignite", true) end
  62.   Rengo.Misc:Boolean("Autolvl", "Auto level", true)
  63.   Rengo.Misc:DropDown("Autolvltable", "Priority", 1, {"Q-E-W", "Q-W-E"})
  64.  
  65.   Rengo:Menu("Drawings", "Drawings")
  66.   Rengo.Drawings:Boolean("W", "Draw W Range", true)
  67.   Rengo.Drawings:Boolean("E", "Draw E Range", true)
  68.   Rengo.Drawings:ColorPick("color", "Color Picker", {255,255,255,0})
  69.  
  70.  
  71.     OnTick(function(myHero) self:OnTick(myHero) end)
  72.     OnDraw(function(myHero) self:Drawings(myHero) end)
  73. end
  74.  
  75.  
  76. function Rengar:OnTick(myHero)
  77.         if IOW:Mode() == "Combo" then
  78.             self:Combo()
  79.         end
  80.         if IOW:Mode() == "Harass" then
  81.             self:Harass()
  82.         end
  83.  
  84.         self:Checks()
  85.         self:Autolevel()
  86.         self:Autoignite()
  87. end
  88.  
  89.  
  90. function Rengar:Checks()
  91.         target = GetCurrentTarget()
  92.         unit = GetCurrentTarget()
  93.  
  94.         lastlevel = GetLevel(myHero)-1
  95.         Ferocity = GetCurrentMana(myHero)
  96.         AttackRange = GetRange(myHero)
  97.         MousePos = GetMousePos()
  98.         Hydra = GetItemSlot(myHero, 3074)
  99.         Tiamat = GetItemSlot(myHero, 3077)
  100.         YG = GetItemSlot(myHero, 3142)
  101.  
  102.         EPred = GetPredictionForPlayer(myHeroPos(), unit, GetMoveSpeed(unit), 1500, 250, GetCastRange(myHero,_E), 80, true, true)
  103. end
  104.  
  105. --[[ Q cast
  106. function Rengar:CastQ(unit, delay, validrange)
  107.     if ValidTarget(unit, validrange) then
  108.         if CanUseSpell(myHero, _Q) == READY then
  109.           CastSpell(_Q)
  110.           DelayAction(function() AttackUnit(unit) end, delay*0.001)
  111.       end
  112.     end
  113. end ]]--
  114.  
  115. function Rengar:AutoQ()
  116.     local AArange = GetRange(myHero)
  117.     if Rengo.Combo.combo_mode:Value() == 2 then
  118.         self:CastE(target, 1, 1000)
  119.         if ValidTarget(target, AArange+50) then
  120.             if CanUseSpell(myHero, _Q) == READY then
  121.               DelayAction(function() CastSpell(_Q) end, 40*0.001)
  122.               DelayAction(function() AttackUnit(target) end, 10*0.001)
  123.           end
  124.         end
  125.     elseif Rengo.Combo.combo_mode:Value() == 1 then
  126.         if ValidTarget(target, AArange+50) then
  127.             if CanUseSpell(myHero, _Q) == READY then
  128.               CastSpell(_Q)
  129.               DelayAction(function() AttackUnit(target) end, 10*0.001)
  130.             end
  131.         end
  132.     end
  133. end
  134.  
  135. -- E cast
  136. function Rengar:CastE(unit, delay, validrange)
  137.   if ValidTarget(unit, validrange) then
  138.     if CanUseSpell(myHero, _E) == READY then
  139.         DelayAction(function() CastSkillShot(_E, EPred.PredPos.x, EPred.PredPos.y, EPred.PredPos.z) end, delay*0.001)
  140.     end
  141.   end
  142. end
  143.  
  144. -- W cast
  145. function Rengar:CastW(unit, delay, validrange)
  146.   if ValidTarget(unit, validrange) then
  147.     if CanUseSpell(myHero, _W) == READY then
  148.      DelayAction(function() CastSpell(_W) end, delay*0.001)
  149.     end
  150.     end
  151. end
  152.  
  153. -- Tiamat and Hydra Cast
  154. function Rengar:CastTH(unit, delay, validrange)
  155. if ValidTarget(unit, validrange) then
  156.       if CanUseSpell(myHero, Hydra) == READY and Hydra ~= 0 then
  157.         DelayAction(function() CastSpell(Hydra) end, delay*0.001)
  158.       elseif CanUseSpell(myHero, Tiamat) == READY and Tiamat ~= 0 then
  159.         DelayAction(function() CastSpell(Tiamat) end, delay*0.001)
  160.       end
  161.     end
  162. end
  163.  
  164. function Rengar:Combo()
  165.     local Rpressed = 0
  166.  
  167.     if CanUseSpell(myHero, _R) == READYNONCAST and GotBuff(myHero,"RengarR") then
  168.         Rpressed = 1
  169.         if CanUseSpell(myHero, YG) == READY and YG ~= 0 then DelayAction(function() CastSpell(YG) end, 10*0.001) end
  170.         if ValidTarget(target, AttackRange) then
  171.             if Rengo.Combo.combo_mode:Value() == 1 then
  172.                 self:AutoQ()
  173.                 self:CastE(target, 65, 1000)
  174.                 self:CastTH(target, 5, 400)
  175.                 self:CastW(target, 15, 500)
  176.                
  177.                             -- If target didn't die from One Shot Combo --
  178.                 if not IsDead(target) then
  179.                 self:AutoQ()
  180.                 self:CastE(target, 1, 1000)
  181.                 self:CastTH(target, 1, 400)
  182.                 self:CastW(target, 1, 500)
  183.                 end
  184.  
  185.             elseif Rengo.Combo.combo_mode:Value() == 2 then
  186.                 self:CastE(target, 1, 1000)
  187.                 self:CastW(target, 20, 500)
  188.                
  189.                 self:CastTH(target, 1, 400)
  190.                 -- If target didn't die from One Shot Combo --
  191.                 if not IsDead(target) then
  192.                
  193.                 self:CastE(target, 1, 1000)
  194.                 self:CastTH(target, 1, 400)
  195.                 self:CastW(target, 1, 500)
  196.                 end
  197.             end
  198.         end
  199.     else
  200.         Rpressed = 0
  201.     end
  202.  
  203.     if Rpressed == 0 then
  204.         if Ferocity == 5 and (GetCurrentHP(myHero)/GetMaxHP(myHero))*100 > Rengo.Combo.empoweredW:Value() then
  205.             if Rengo.Combo.empowered_prioritize:Value() == 1 then
  206.                 if ValidTarget(target, AttackRange) then
  207.                     self:AutoQ()
  208.                 else
  209.                     self:CastE(target, 1, 1000)
  210.                 end
  211.             elseif Rengo.Combo.empowered_prioritize:Value() == 2 then
  212.                 self:CastE(target, 1, 1000)
  213.             elseif Rengo.Combo.empowered_prioritize:Value() == 3 then
  214.                 self:CastW(target, 1, 500)
  215.             end
  216.         elseif Ferocity == 5 and (GetCurrentHP(myHero)/GetMaxHP(myHero))*100 < Rengo.Combo.empoweredW:Value() then
  217.             self:CastW(target, 1, 100000)
  218.         end
  219.  
  220.         if Ferocity < 5 then
  221.             self:AutoQ()
  222.             self:CastE(target, 10, 1000)
  223.             self:CastTH(target, 10, 400)
  224.             self:CastW(target, 10, 500)
  225.         end
  226.     end
  227. end
  228.  
  229. function Rengar:Harass()
  230.     if Rengo.Harass.E:Value() then
  231.         self:CastE(target, 10, 1000)
  232.     end
  233.    
  234.     if Rengo.Harass.W:Value() then
  235.         self:CastW(target, 10, 500)
  236.     end
  237.  
  238.     if Rengo.Harass.Q:Value() then
  239.         self:AutoQ()
  240.     end
  241. end
  242.  
  243. function Rengar:Drawings()
  244.     self:DrawText_One_Shot()
  245.     self:Ranges()
  246. end
  247.  
  248. function Rengar:Is_OneShotable(enemy)
  249.     local Ferocity = GetCurrentMana(myHero)
  250.     local Qdmg = getdmg("Q", enemy, myHero, 1)
  251.     local EmpQdmg = getdmg("Q", enemy, myHero, 3)
  252.     local Wdmg = getdmg("W", enemy, myHero, 1)
  253.     local Edmg = getdmg("E", enemy, myHero, 1)
  254.     local EmpEdmg = getdmg("Q", enemy, myHero, 3)
  255.     local THdmg = CalcDamage(myHero, enemy, (GetBonusDmg(myHero) + GetBaseDamage(myHero)), 0)
  256.  
  257.     if Ferocity == 5 then
  258.         if EmpQdmg + Wdmg + Edmg + THdmg + 250 > GetCurrentHP(enemy) then
  259.             return "EmpQWE OneShot!"
  260.         elseif EmpQdmg + Wdmg + Edmg + THdmg + Qdmg + 250 > GetCurrentHP(enemy) then
  261.             return "EmpQWE+Q OneShot!"
  262.         else
  263.             return 'Not One Shotable'
  264.         end
  265.     elseif Ferocity < 5 then
  266.         if Qdmg + Wdmg + Edmg + THdmg + 250 > GetCurrentHP(enemy) then
  267.             return "QWE OneShot!"
  268.         elseif Qdmg + Wdmg + Edmg + THdmg + Qdmg + 250 > GetCurrentHP(enemy) then
  269.             return "QWE+Q OneShot!"
  270.         elseif Qdmg + Wdmg + Edmg + THdmg + EmpQdmg + 250 > GetCurrentHP(enemy) then
  271.             return "QWE+EmpQ OneShot!"
  272.         else
  273.             return 'Not One Shotable'
  274.         end
  275.     end
  276. end
  277.  
  278. function Rengar:DrawText_One_Shot()
  279.     if Rengo.Combo.one_shotable:Value() then
  280.         for _, enemy in pairs(GetEnemyHeroes()) do
  281.             if ValidTarget(enemy) then
  282.                 local enemyPos = GetOrigin(enemy)
  283.                 local drawpos = WorldToScreen(1,enemyPos.x, enemyPos.y, enemyPos.z)
  284.                 local enemyText = self:Is_OneShotable(enemy)
  285.                 DrawText(enemyText, 12, drawpos.x-60, drawpos.y, GoS.White)
  286.             end
  287.         end
  288.     end
  289. end
  290.  
  291. -- Deftsu <3
  292. function Rengar:Autoignite()
  293.     for i,enemy in pairs(GetEnemyHeroes()) do
  294.        
  295.         if Ignite and Rengo.Misc.Autoignite:Value() then
  296.               if IsReady(Ignite) and 20*GetLevel(myHero)+50 > GetHP(enemy)+GetHPRegen(enemy)*2.5 and ValidTarget(enemy, 600) then
  297.               CastTargetSpell(enemy, Ignite)
  298.               end
  299.         end
  300.     end
  301. end
  302.  
  303. -- Deftsu <3
  304. function Rengar:Ranges()
  305.     local col = Rengo.Drawings.color:Value()
  306.     local pos = GetOrigin(myHero)
  307.     if Rengo.Drawings.W:Value() then DrawCircle(pos,500,1,0,col) end
  308.     if Rengo.Drawings.E:Value() then DrawCircle(pos,1000,1,0,col) end
  309. end
  310.  
  311. -- Deftsu <3
  312. function Rengar:Autolevel()
  313.     if Rengo.Misc.Autolvl:Value() then  
  314.       if GetLevel(myHero) > lastlevel then
  315.         if Rengo.Misc.Autolvltable:Value() == 1 then leveltable = {_Q, _W, _E, _Q, _Q, _R, _Q, _E, _Q, _E, _R, _E, _E, _W, _W, _R, _W, _W}
  316.         elseif Rengo.Misc.Autolvltable:Value() == 2 then leveltable = {_Q, _W, _E, _Q, _Q, _R, _Q, _W, _Q, _W, _R, _W, _W, _E, _E, _R, _E, _E}
  317.         end
  318.         DelayAction(function() LevelSpell(leveltable[GetLevel(myHero)]) end, math.random(1000,3000)*0.001)
  319.         lastlevel = GetLevel(myHero)
  320.       end
  321.     end
  322. end
  323.  
  324. if _G[GetObjectName(myHero)] then
  325. _G[GetObjectName(myHero)]()
  326. end
  327.  
  328. PrintChat("<font color='#af0000'>Rengar - The Pridestalker</font> | <font color='#00d12d'>Loaded!</font>")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement