Guest User

Nidalee the Rapist

a guest
Dec 13th, 2012
35
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 ts.target ~= nil 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 GetDistance(ts.target) < myHero.range + 300 then
  295.         myHero:Attack(ts.target)
  296.       end      
  297.             if WREADY and GetDistance(ts.target) < myHero.range + 300 then             
  298.                 myHero:MoveTo(ts.target.x,ts.target.z)
  299.                 if GetTickCount()-lastdirection >= 500 then
  300.                     local absposxy = math.min(math.abs(ts.target.x-myHero.x),math.abs(ts.target.y-myHero.y))
  301.                     myHero:MoveTo(myHero.x+(ts.target.x-myHero.x)*100/absposxy,myHero.z+(ts.target.z-myHero.z)*100/absposxy)
  302.                     lastdirection = GetTickCount()
  303.         elseif GetTickCount()-lastdirection >= 100 then
  304.                     CastSpell(_W, ts.target.x,ts.target.z)
  305.                 end            
  306.             end      
  307.     elseif swing == 1 then
  308.       if WREADY and GetDistance(ts.target) < myHero.range + 300 and os.clock() - lastBasicAttack > swingDelay then             
  309.         myHero:MoveTo(ts.target.x,ts.target.z)
  310.         if GetTickCount()-lastdirection >= 500 then
  311.           local absposxy = math.min(math.abs(ts.target.x-myHero.x),math.abs(ts.target.y-myHero.y))
  312.           myHero:MoveTo(myHero.x+(ts.target.x-myHero.x)*100/absposxy,myHero.z+(ts.target.z-myHero.z)*100/absposxy)
  313.           lastdirection = GetTickCount()
  314.         elseif GetTickCount()-lastdirection >= 100 then
  315.           CastSpell(_W, ts.target.x,ts.target.z)
  316.         end            
  317.       end
  318.       if EREADY and not WREADY and GetDistance(ts.target) < myHero.range + 200 and os.clock() - lastBasicAttack > swingDelay then              
  319.         if GetTickCount()-lastdirection >= 500 then
  320.           local absposxy = math.min(math.abs(ts.target.x-myHero.x),math.abs(ts.target.y-myHero.y))
  321.           myHero:MoveTo(myHero.x+(ts.target.x-myHero.x)*100/absposxy,myHero.z+(ts.target.z-myHero.z)*100/absposxy)
  322.           lastdirection = GetTickCount()
  323.         elseif GetTickCount()-lastdirection >= 100 then
  324.           CastSpell(_E, ts.target.x,ts.target.z)
  325.           swing = 0
  326.         end
  327.       elseif QREADY and not EREADY and os.clock() - lastBasicAttack > swingDelay then
  328.         CastSpell(_Q)
  329.         swing = 0          
  330.       end
  331.     end
  332.   end
  333.  
  334.  
  335.  
  336.     if NIDConfig.DASH then
  337.     myHero:MoveTo(mousePos.x,mousePos.z)
  338.         if COUGAR and not HUMAN then
  339.             if WREADY then
  340.         if GetTickCount()-lastdirection >= 500 then
  341.           local absposxy = math.min(math.abs(mousePos.x-myHero.x),math.abs(mousePos.y-myHero.y))
  342.           myHero:MoveTo(myHero.x+(mousePos.x-myHero.x)*100/absposxy,myHero.z+(mousePos.z-myHero.z)*100/absposxy)
  343.           lastdirection = GetTickCount()
  344.         elseif GetTickCount()-lastdirection >= 100 then
  345.           CastSpell(_W)
  346.         end
  347.       end
  348.     end
  349.         if HUMAN and not COUGAR then
  350.                 CastSpell(_R)
  351.         end
  352.     end
  353.  
  354.  
  355.  
  356.     if NIDConfig.autoAAFarm then
  357.         if mousemoving and GetTickCount() > nextTick then
  358.             player:MoveTo(mousePos.x, mousePos.z)
  359.         end
  360.                        
  361.         local tick = GetTickCount()
  362.         if lasthiton then
  363.         unitScanTick = tick
  364.             for i = 1, objManager.maxObjects, 1 do
  365.                 local object = objManager:getObject(i)
  366.                 if object ~= nil and object.team ~= player.team and object.type == "obj_AI_Minion" and string.find(object.charName,"Minion") then
  367.                     if not object.dead and GetDistance(object,player) <= (player.range + scanAdditionalRange) then
  368.                         if units[object.name] == nil then
  369.                             units[object.name] = { obj = object, markTick = 0 }
  370.                         end
  371.                     else
  372.                         units[object.name] = nil
  373.                     end
  374.                 end
  375.             end
  376.         end
  377.         for i, unit in pairs(units) do
  378.             if unit.obj == nil or unit.obj.dead or GetDistance(player,unit.obj) > (player.range + scanAdditionalRange) then
  379.                 units[i] = nil
  380.             else
  381.                 if unit.obj.health <= (myHero:CalcDamage(unit.obj,myHero.totalDamage)) then --
  382.                     if lasthiton and GetTickCount() > nextTick then
  383.                         player:Attack(unit.obj) ---PrintChat("ATTACKING")
  384.                         nextTick = GetTickCount() + waitDelay  
  385.                         return
  386.                     end
  387.                 end
  388.             end    
  389.         end
  390.     end
  391.    
  392. end
  393. function OnDraw()
  394.     if NIDConfig.drawcircles and not myHero.dead then
  395.     if HUMAN and not COUGAR then
  396.       DrawCircle(myHero.x, myHero.y, myHero.z, myHero.range+150, 0x992D3D)
  397.       if QREADY then DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x992D3D)end
  398.       if WREADY then DrawCircle(myHero.x, myHero.y, myHero.z, wrange, 0xFFFFFF)end
  399.     end
  400.     if COUGAR and not HUMAN then
  401.       DrawCircle(myHero.x, myHero.y, myHero.z, myHero.range+150, 0x992D3D)
  402.       if WREADY then DrawCircle(myHero.x, myHero.y, myHero.z, myHero.range+300, 0xFFFFFF)end
  403.     end
  404.         if ts.target ~= nil then
  405.             for j=0, 10 do DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00) end
  406.         end
  407.     end  
  408.     if ts.target ~= nil and NIDConfig.drawprediction then
  409.         DrawCircle(ts.nextPosition.x, ts.target.y, ts.nextPosition.z, 200, 0x0000FF)
  410.     end
  411.     SC__OnDraw()
  412. end
  413. function OnWndMsg(msg,key)
  414.     SC__OnWndMsg(msg,key)
  415. end
  416. function OnSendChat(msg)
  417.     TargetSelector__OnSendChat(msg)
  418.     ts:OnSendChat(msg, "pri")
  419. end
  420. PrintChat(" >> Nidalee the Rapist!")
Advertisement
Add Comment
Please, Sign In to add comment