Guest User

Nidalee the Rapist

a guest
Dec 13th, 2012
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2.     Nidalee the Rapist
  3. ]]
  4. if myHero.charName ~= "Nidalee" then return end
  5.  
  6. require "AllClass"
  7.  
  8. --[[        Code        ]]
  9. local mousemoving = true
  10. local movedelay = 0
  11. local unitScanDelay = 0
  12. local waitDelay = 300
  13. local scanAdditionalRange = 500
  14. local units = {}
  15. local oldDelayTick = 0
  16. local unitScanTick = 0
  17. local holding = 0
  18. local animPlayedTick = nil
  19. local nextTick = 0
  20.  
  21. local AxePos = nil
  22.  
  23. local lasthiton = true
  24.  
  25. local lastdirection = 0
  26.  
  27. local range = 1400
  28.  
  29. local wrange = 1000
  30.  
  31. local AArange = 275
  32. local lastBasicAttack = 0
  33. local swingDelay = 0.1
  34. local rangedSwingDelay = 0.05
  35. local swing = 0
  36. local tick = nil
  37. -- Active
  38. -- draw
  39.  
  40. local targetSelected = true
  41. -- ts
  42. local ts
  43. --
  44. local ignite = nil
  45. local BRKSlot, DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = nil, nil, nil, nil, nil, nil, nil
  46. local QREADY, WREADY, EREADY, RREADY, BRKREADY, DFGREADY, HXGREADY, BWCREADY = false, false, false, false, false, false, false, false
  47.  
  48. function OnLoad()
  49.     NIDConfig= scriptConfig("Nidalee the Rapist", "nidaleetherapist")
  50.     NIDConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  51.     NIDConfig:addParam("scriptActive1", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 67)
  52.   NIDConfig:addParam("scriptActive2", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 88)
  53.     NIDConfig:addParam("harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, 84)
  54.   NIDConfig:addParam("DASH", "Dash", SCRIPT_PARAM_ONKEYDOWN, false, 90)
  55.     NIDConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  56.     NIDConfig:addParam("drawtext", "Draw Text", SCRIPT_PARAM_ONOFF, true)
  57.     NIDConfig:addParam("drawprediction", "Draw Prediction", SCRIPT_PARAM_ONOFF, false)
  58.     NIDConfig:addParam("autoignite", "Auto Ignite", SCRIPT_PARAM_ONOFF, true)
  59.     NIDConfig:addParam("autoAAFarm", "Auto Farm", SCRIPT_PARAM_ONKEYDOWN, false, 192)
  60.   NIDConfig:permaShow("autoAAFarm")
  61.     ts = TargetSelector(TARGET_LOW_HP,range+200,DAMAGE_MAGIC)
  62.     ts.name = "Nidalee"
  63.     NIDConfig:addTS(ts)
  64.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  65.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end   
  66. end
  67.  
  68.  
  69.  
  70.     function OnProcessSpell(unit, spell)
  71.         if unit.isMe and (spell.name:find("Attack") ~= nil) then
  72.             swing = 1
  73.             lastBasicAttack = os.clock()
  74.         end
  75.     end
  76.  
  77.  
  78.  
  79. function OnTick()
  80.  
  81.  
  82.     if myHero.dead then
  83.         return
  84.     end
  85.  
  86.   ts:update()
  87.   Prediction__OnTick()
  88.  
  89.   if myHero:GetSpellData(_Q).name == "JavelinToss" or myHero:GetSpellData(_W).name == "Bushwhack" or myHero:GetSpellData(_E).name == "PrimalSurge" then
  90.     HUMAN = true
  91.     COUGAR = false
  92.     end
  93.  
  94.   if myHero:GetSpellData(_Q).name == "Takedown" or myHero:GetSpellData(_W).name == "Pounce" or myHero:GetSpellData(_E).name == "Swipe" then
  95.     COUGAR = true
  96.     HUMAN = false
  97.     end
  98.    
  99.     if swing == 1 and os.clock() > lastBasicAttack + 0.5 then
  100.         swing = 0
  101.     end
  102.  
  103.     if ignite ~= nil and myHero:CanUseSpell(ignite) == READY then
  104.         if IREADY then
  105.             local ignitedmg = 0
  106.             for j = 1, heroManager.iCount, 1 do
  107.                 local enemyhero = heroManager:getHero(j)
  108.                 if ValidTarget(enemyhero,600) then
  109.                     ignitedmg = 50 + 20 * myHero.level
  110.                     if enemyhero.health <= (ignitedmg - 50) then
  111.                         CastSpell(ignite, enemyhero)
  112.                     end
  113.                 end
  114.             end
  115.         end
  116.     end
  117.  
  118.     BRKSlot, DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100)
  119.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  120.     WREADY = (myHero:CanUseSpell(_W) == READY)
  121.     EREADY = (myHero:CanUseSpell(_E) == READY)
  122.     RREADY = (myHero:CanUseSpell(_R) == READY)
  123.     DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  124.     HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  125.     BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  126.     BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
  127.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  128.  
  129.  
  130. ---------------------------------------------------------------- Combos Etc---------------------------------------------------------------------------------
  131.  
  132.  
  133.     if NIDConfig.harass and ts.target ~= nil then
  134.     if HUMAN and not COUGAR then   
  135.       if QREADY then
  136.         QtravelDuration = (GetDistance(myHero, ts.nextPosition) / 1.2) + 290
  137.         ts:SetPrediction(QtravelDuration)  
  138.         if GetDistance(ts.target)<range and GetDistance(ts.nextPosition) < range and not GetMinionCollision(myHero,ts.nextPosition, 150) then
  139.           CastSpell(_Q, ts.nextPosition.x, ts.nextPosition.z)
  140.         end
  141.       end
  142.     end
  143.     if COUGAR and not HUMAN then
  144.       CastSpell(_R)
  145.     end
  146.     end
  147.  
  148.  
  149.  
  150.   if HUMAN and NIDConfig.scriptActive and ts.target ~= nil and not COUGAR then     
  151.         if DFGREADY then CastSpell(DFGSlot, ts.target) end
  152.         if HXGREADY then CastSpell(HXGSlot, ts.target) end
  153.         if BWCREADY then CastSpell(BWCSlot, ts.target) end
  154.         if BRKREADY then CastSpell(BRKSlot, ts.target) end
  155.         if QREADY then
  156.       QtravelDuration = (GetDistance(myHero, ts.nextPosition) / 1.2) + 270
  157.       ts:SetPrediction(QtravelDuration)  
  158.       if HUMAN and GetDistance(ts.target) < range and GetDistance(ts.nextPosition) < range and not GetMinionCollision(myHero,ts.nextPosition, 150) then
  159.         CastSpell(_Q, ts.nextPosition.x, ts.nextPosition.z)
  160.       end
  161.     end    
  162.         if swing == 0  then
  163.             if GetDistance(ts.target) < AArange then
  164.         myHero:Attack(ts.target)
  165.       end
  166.     end
  167.   end
  168.  
  169.  
  170.  
  171.   if COUGAR and NIDConfig.scriptActive and ts.target ~= nil and not HUMAN then         
  172.         if DFGREADY then CastSpell(DFGSlot, ts.target) end
  173.         if HXGREADY then CastSpell(HXGSlot, ts.target) end
  174.         if BWCREADY then CastSpell(BWCSlot, ts.target) end
  175.         if BRKREADY then CastSpell(BRKSlot, ts.target) end     
  176.     if swing == 0 then
  177.       if GetDistance(ts.target) < myHero.range + 300 then
  178.         myHero:Attack(ts.target)
  179.       end      
  180.             if WREADY and GetDistance(ts.target) < myHero.range + 300 then             
  181.                 myHero:Attack(ts.target)
  182.                 if GetTickCount()-lastdirection >= 500 then
  183.                     local absposxy = math.min(math.abs(ts.target.x-myHero.x),math.abs(ts.target.y-myHero.y))
  184.                     myHero:MoveTo(myHero.x+(ts.target.x-myHero.x)*100/absposxy,myHero.z+(ts.target.z-myHero.z)*100/absposxy)
  185.                     lastdirection = GetTickCount()
  186.         elseif GetTickCount()-lastdirection >= 100 then
  187.                     CastSpell(_W, ts.target.x,ts.target.z)
  188.                 end            
  189.             end      
  190.     elseif swing == 1 then
  191.       if EREADY and GetDistance(ts.target) < myHero.range + 200 and os.clock() - lastBasicAttack > swingDelay then             
  192.         if GetTickCount()-lastdirection >= 500 then
  193.           local absposxy = math.min(math.abs(ts.target.x-myHero.x),math.abs(ts.target.y-myHero.y))
  194.           myHero:MoveTo(myHero.x+(ts.target.x-myHero.x)*100/absposxy,myHero.z+(ts.target.z-myHero.z)*100/absposxy)
  195.           lastdirection = GetTickCount()
  196.         elseif GetTickCount()-lastdirection >= 100 then
  197.           CastSpell(_E, ts.target.x,ts.target.z)
  198.           swing = 0
  199.         end
  200.       elseif QREADY and not EREADY and os.clock() - lastBasicAttack > swingDelay then
  201.         CastSpell(_Q)
  202.         swing = 0          
  203.       end
  204.     end
  205.   end
  206.  
  207.  
  208.  
  209.   if HUMAN and NIDConfig.scriptActive1 and ts.target ~= nil and not COUGAR then        
  210.         if DFGREADY then CastSpell(DFGSlot, ts.target) end
  211.         if HXGREADY then CastSpell(HXGSlot, ts.target) end
  212.         if BWCREADY then CastSpell(BWCSlot, ts.target) end
  213.         if BRKREADY then CastSpell(BRKSlot, ts.target) end     
  214.         if swing == 0  then
  215.             if GetDistance(ts.target) < AArange then
  216.         myHero:Attack(ts.target)
  217.       end
  218.     elseif swing == 1 then
  219.       if EREADY and os.clock() - lastBasicAttack > rangedSwingDelay then
  220.                 CastSpell(_E, myHero)
  221.                 swing = 0
  222.             end        
  223.     end
  224.   end
  225.  
  226.  
  227.  
  228.   if COUGAR and NIDConfig.scriptActive1 and ts.target ~= nil and not HUMAN then    
  229.         if DFGREADY then CastSpell(DFGSlot, ts.target) end
  230.         if HXGREADY then CastSpell(HXGSlot, ts.target) end
  231.         if BWCREADY then CastSpell(BWCSlot, ts.target) end
  232.         if BRKREADY then CastSpell(BRKSlot, ts.target) end     
  233.     if swing == 0 then
  234.       if GetDistance(ts.target) < myHero.range + 300 then
  235.         myHero:Attack(ts.target)
  236.       end
  237.     elseif swing == 1 then
  238.       if EREADY and GetDistance(ts.target) < myHero.range + 200 and os.clock() - lastBasicAttack > swingDelay then         
  239.         if GetTickCount()-lastdirection >= 500 then
  240.           local absposxy = math.min(math.abs(ts.target.x-myHero.x),math.abs(ts.target.y-myHero.y))
  241.           myHero:MoveTo(myHero.x+(ts.target.x-myHero.x)*100/absposxy,myHero.z+(ts.target.z-myHero.z)*100/absposxy)
  242.           lastdirection = GetTickCount()
  243.         elseif GetTickCount()-lastdirection >= 100 then
  244.           CastSpell(_E, ts.target.x,ts.target.z)
  245.           swing = 0
  246.         end
  247.       elseif QREADY and not EREADY and os.clock() - lastBasicAttack > swingDelay then
  248.         CastSpell(_Q)
  249.         swing = 0          
  250.       end
  251.     end
  252.   end
  253.  
  254.  
  255.  
  256.   if HUMAN and NIDConfig.scriptActive2 and not COUGAR then
  257.     if ts.target ~= nil then
  258.       if DFGREADY then CastSpell(DFGSlot, ts.target) end
  259.       if HXGREADY then CastSpell(HXGSlot, ts.target) end
  260.       if BWCREADY then CastSpell(BWCSlot, ts.target) end
  261.       if BRKREADY then CastSpell(BRKSlot, ts.target) end
  262.       if WREADY then
  263.         WtravelDuration = 270+350
  264.         ts:SetPrediction(WtravelDuration)  
  265.         if GetDistance(ts.target) < wrange and GetDistance(ts.nextPosition) < wrange then
  266.           CastSpell(_W, ts.nextPosition.x, ts.nextPosition.z)
  267.         end
  268.       end      
  269.       if swing == 0  then
  270.         if GetDistance(ts.target) < AArange then
  271.           myHero:Attack(ts.target)
  272.         end
  273.       elseif swing == 1 then
  274.         if EREADY and os.clock() - lastBasicAttack > rangedSwingDelay then
  275.           CastSpell(_E, myHero)
  276.           swing = 0
  277.         end        
  278.       end
  279.     elseif ts.target == nil then
  280.       if WREADY then
  281.         CastSpell(_W,mousePos.x,mousePos.z)
  282.       end
  283.     end
  284.   end
  285.  
  286.  
  287.  
  288.   if COUGAR and NIDConfig.scriptActive2 and not HUMAN then     
  289.         if DFGREADY then CastSpell(DFGSlot, ts.target) end
  290.         if HXGREADY then CastSpell(HXGSlot, ts.target) end
  291.         if BWCREADY then CastSpell(BWCSlot, ts.target) end
  292.         if BRKREADY then CastSpell(BRKSlot, ts.target) end     
  293.     if swing == 0 then  
  294.             if WREADY then             
  295.                 if GetTickCount()-lastdirection >= 500 then
  296.           local absposxy = math.min(math.abs(mousePos.x-myHero.x),math.abs(mousePos.y-myHero.y))
  297.           myHero:MoveTo(myHero.x+(mousePos.x-myHero.x)*100/absposxy,myHero.z+(mousePos.z-myHero.z)*100/absposxy)
  298.           lastdirection = GetTickCount()
  299.         elseif GetTickCount()-lastdirection >= 100 then
  300.           CastSpell(_W)
  301.                 end            
  302.             end      
  303.     elseif swing == 1 then      
  304.       if EREADY and os.clock() - lastBasicAttack > swingDelay then             
  305.         if GetTickCount()-lastdirection >= 500 then
  306.           local absposxy = math.min(math.abs(mousePos.x-myHero.x),math.abs(mousePos.y-myHero.y))
  307.           myHero:MoveTo(myHero.x+(mousePos.x-myHero.x)*100/absposxy,myHero.z+(mousePos.z-myHero.z)*100/absposxy)
  308.           lastdirection = GetTickCount()
  309.         elseif GetTickCount()-lastdirection >= 100 then
  310.           CastSpell(_E)
  311.           swing = 0
  312.         end
  313.       elseif QREADY and not EREADY and os.clock() - lastBasicAttack > swingDelay then
  314.         CastSpell(_Q)
  315.         swing = 0          
  316.       end
  317.     end
  318.   end
  319.  
  320.  
  321.  
  322.     if NIDConfig.DASH then
  323.     myHero:MoveTo(mousePos.x,mousePos.z)
  324.         if COUGAR and not HUMAN then
  325.             if WREADY then
  326.         if GetTickCount()-lastdirection >= 500 then
  327.           local absposxy = math.min(math.abs(mousePos.x-myHero.x),math.abs(mousePos.y-myHero.y))
  328.           myHero:MoveTo(myHero.x+(mousePos.x-myHero.x)*100/absposxy,myHero.z+(mousePos.z-myHero.z)*100/absposxy)
  329.           lastdirection = GetTickCount()
  330.         elseif GetTickCount()-lastdirection >= 100 then
  331.           CastSpell(_W)
  332.         end
  333.       end
  334.     end
  335.         if HUMAN and not COUGAR then
  336.                 CastSpell(_R)
  337.         end
  338.     end
  339.  
  340.  
  341.  
  342.     if NIDConfig.autoAAFarm then
  343.         if mousemoving and GetTickCount() > nextTick then
  344.             player:MoveTo(mousePos.x, mousePos.z)
  345.         end
  346.                        
  347.         local tick = GetTickCount()
  348.         if lasthiton then
  349.         unitScanTick = tick
  350.             for i = 1, objManager.maxObjects, 1 do
  351.                 local object = objManager:getObject(i)
  352.                 if object ~= nil and object.team ~= player.team and object.type == "obj_AI_Minion" and string.find(object.charName,"Minion") then
  353.                     if not object.dead and GetDistance(object,player) <= (player.range + scanAdditionalRange) then
  354.                         if units[object.name] == nil then
  355.                             units[object.name] = { obj = object, markTick = 0 }
  356.                         end
  357.                     else
  358.                         units[object.name] = nil
  359.                     end
  360.                 end
  361.             end
  362.         end
  363.         for i, unit in pairs(units) do
  364.             if unit.obj == nil or unit.obj.dead or GetDistance(player,unit.obj) > (player.range + scanAdditionalRange) then
  365.                 units[i] = nil
  366.             else
  367.                 if unit.obj.health <= (myHero:CalcDamage(unit.obj,myHero.totalDamage)) then --
  368.                     if lasthiton and GetTickCount() > nextTick then
  369.                         player:Attack(unit.obj) ---PrintChat("ATTACKING")
  370.                         nextTick = GetTickCount() + waitDelay  
  371.                         return
  372.                     end
  373.                 end
  374.             end    
  375.         end
  376.     end
  377.    
  378. end
  379. function OnDraw()
  380.     if NIDConfig.drawcircles and not myHero.dead then
  381.     if HUMAN and not COUGAR then
  382.       DrawCircle(myHero.x, myHero.y, myHero.z, myHero.range+150, 0x992D3D)
  383.       if QREADY then DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x992D3D)end
  384.       if WREADY then DrawCircle(myHero.x, myHero.y, myHero.z, wrange, 0xFFFFFF)end
  385.     end
  386.     if COUGAR and not HUMAN then
  387.       DrawCircle(myHero.x, myHero.y, myHero.z, myHero.range+150, 0x992D3D)
  388.       if WREADY then DrawCircle(myHero.x, myHero.y, myHero.z, myHero.range+300, 0xFFFFFF)end
  389.     end
  390.         if ts.target ~= nil then
  391.             for j=0, 10 do DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00) end
  392.         end
  393.     end  
  394.     if ts.target ~= nil and NIDConfig.drawprediction then
  395.         DrawCircle(ts.nextPosition.x, ts.target.y, ts.nextPosition.z, 200, 0x0000FF)
  396.     end
  397.     SC__OnDraw()
  398. end
  399. function OnWndMsg(msg,key)
  400.     SC__OnWndMsg(msg,key)
  401. end
  402. function OnSendChat(msg)
  403.     TargetSelector__OnSendChat(msg)
  404.     ts:OnSendChat(msg, "pri")
  405. end
  406. PrintChat(" >> Nidalee the Rapist!")
Advertisement
Add Comment
Please, Sign In to add comment