Advertisement
Guest User

Nautilus-v1.0-xkjtx.lua

a guest
Mar 24th, 2013
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.28 KB | None | 0 0
  1. --[[           
  2.  
  3.             Nautilus the beastly Jungler v1.0
  4.             -- Grabbed 99% code from the Blitz script by burn
  5.                     - Modded to work for Nautilus by xkjtx
  6.  
  7.             - Features:
  8.                 - Combo (spells will cast only in range) Q-E-W-R and it will try to AA when
  9.                     ever possible.
  10.                 - Harass will harass with Q and if Q hits then it will E-W-Auto-Attack
  11.  
  12.                 - Damage calculation, for combos you could do to kill the target. It will
  13.                     display red circles and text.
  14.  
  15.                 -- Todo:
  16.                     - Auto kill with E or R maybe even Q.. :-)
  17.                     -
  18.  
  19. ]]
  20.  
  21. if myHero.charName ~= "Nautilus" then return end
  22.  
  23.     local player = GetMyHero()
  24.     local playing_AD = true --<-- CHANGE THIS TO true IF YOU WANT TO PLAY NAUTILUS AD OR TO false IF WANT PLAY AP <------------- <------------- <-------------
  25.     local attackrange = 175
  26.     local qrange = 935 -- lowered to stop missing..
  27.     local wrange = 345
  28.     local erange = 590
  29.     local ultirange = 850
  30.     local waittxt = {}
  31.     local floattext = {"Skills are not available","Able to fight","Killable","Murder Now!"}
  32.     local killable = {}
  33.     local calculationenemy = 1
  34.     local ignite = nil
  35.     local SheenSlot, TrinitySlot, LichBaneSlot = nil, nil, nil
  36.     local QREADY, WREADY, EREADY, RREADY, IREADY = false, false, false, false, false
  37.     -- better Q prediction
  38.     local delay = 250
  39.     local qspeed = 1.725
  40.     local travelDuration = 600
  41.  
  42.     -- hot keys
  43.     local comboKey = 32 -- Space Bar
  44.     local grabKey = string.byte("S") -- letter S
  45.     local useUltKey = string.byte("X") -- letter X
  46.     local moveKey = string.byte("V") -- letter V
  47.    
  48.     function OnLoad()
  49.         PrintChat(">> Nautilus Combo 1.0 loaded!")
  50.         NautConfig = scriptConfig("Nautilus", "nautiluscombo")
  51.         NautConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, comboKey)
  52.         NautConfig:addParam("grabQ", "Grab Q", SCRIPT_PARAM_ONKEYDOWN, false, grabKey) -- S
  53.         NautConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  54.         NautConfig:addParam("drawtext", "Draw Text", SCRIPT_PARAM_ONOFF, true)
  55.         NautConfig:addParam("useUlti", "Toggle Use Ultimate in Combo", SCRIPT_PARAM_ONKEYTOGGLE, true, useUltKey) -- X
  56.         NautConfig:addParam("autoignite", "Auto Ignite", SCRIPT_PARAM_ONOFF, false) -- Of by default(I use my own)
  57.         NautConfig:addParam("MoveToMouse", "Move to Mouse: Hot Key toggle", SCRIPT_PARAM_ONKEYTOGGLE, false, moveKey) -- V -- Off by default(will only work with harass)(when On, Nautilus will not AA while moving, but will cast all spells)
  58.         NautConfig:addParam("checkCollision", "Use minion collision", SCRIPT_PARAM_ONOFF, false) -- off by default(FPS DROP) (when off it will grab minions in the way so watch out)
  59.         NautConfig:permaShow("scriptActive")
  60.         NautConfig:permaShow("grabQ")
  61.         NautConfig:permaShow("useUlti")
  62.         NautConfig:permaShow("MoveToMouse")
  63.         NautConfig:permaShow("checkCollision")
  64.         if playing_AD == true then
  65.             ts = TargetSelector(TARGET_LOW_HP,qrange,DAMAGE_PHYSICAL)
  66.         else
  67.             ts = TargetSelector(TARGET_LOW_HP,qrange,DAMAGE_MAGIC)
  68.         end
  69.         ts.name = "Nautilus"
  70.         NautConfig:addTS(ts)
  71.         if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  72.         elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end
  73.         for i=1, heroManager.iCount do waittxt[i] = i*3 end
  74.     end
  75.  
  76.     function OnTick()
  77.         ts:update()
  78.  
  79.         if myHero.dead then return end
  80.  
  81.         if ts.target ~= nil then
  82.             travelDuration = (delay + GetDistance(myHero, ts.target)/qspeed)
  83.         end
  84.  
  85.         ts:SetPrediction(travelDuration)
  86.  
  87.         if (ts.target ~= nil or myHero:CanUseSpell(_Q) == READY) then predic = ts.nextPosition end
  88.  
  89.         SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100)
  90.         QREADY = (myHero:CanUseSpell(_Q) == READY)
  91.         WREADY = (myHero:CanUseSpell(_W) == READY)
  92.         EREADY = (myHero:CanUseSpell(_E) == READY)
  93.         RREADY = (myHero:CanUseSpell(_R) == READY)
  94.         IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  95.  
  96.         if tick == nil or GetTickCount()-tick>=100 then
  97.             tick = GetTickCount()
  98.             SCDmgCalculation()
  99.         end
  100.  
  101.         if NautConfig.MoveToMouse and NautConfig.grabQ then
  102.             player:MoveTo(mousePos.x, mousePos.z) -- move to mouse(when On, Nautilus will not AA while moving, but will cast all spells)
  103.         end
  104.  
  105.         if NautConfig.autoignite then    
  106.                 if IREADY then
  107.                         local ignitedmg = 0    
  108.                         for j = 1, heroManager.iCount, 1 do
  109.                                 local enemyhero = heroManager:getHero(j)
  110.                                 if ValidTarget(enemyhero,600) then
  111.                                         ignitedmg = 50 + 20 * myHero.level
  112.                                         if enemyhero.health <= ignitedmg then
  113.                                                 CastSpell(ignite, enemyhero)
  114.                                         end
  115.                                 end
  116.                         end
  117.                 end
  118.         end
  119.  
  120.         if NautConfig.grabQ and ts.target ~= nil then
  121.             if NautConfig.checkCollision and predic ~= nil and QREADY and GetDistance(ts.target) <= qrange and not GetMinionCollision(myHero,ts.nextPosition, 260) then
  122.                 CastSpell(_Q, predic.x, predic.z)
  123.             elseif not NautConfig.checkCollision and predic ~= nil and QREADY and GetDistance(ts.target) <= qrange then
  124.                 CastSpell(_Q, predic.x, predic.z)
  125.             end
  126.             if (EREADY or WREADY) and GetDistance(ts.target) <= wrange then
  127.                 CastSpell(_E)
  128.                 CastSpell(_W)
  129.                 myHero:Attack(ts.target)
  130.             end
  131.         end
  132.  
  133.         if NautConfig.scriptActive then
  134.             if ts.target ~= nil then
  135.                 if NautConfig.checkCollision and predic ~= nil and QREADY and GetDistance(ts.target) <= qrange and not GetMinionCollision(myHero,ts.nextPosition, 260) then
  136.                     CastSpell(_Q, predic.x, predic.z)
  137.                 elseif not NautConfig.checkCollision and predic ~= nil and QREADY and GetDistance(ts.target) <= qrange then
  138.                     CastSpell(_Q, predic.x, predic.z)
  139.                 end
  140.                 if EREADY and GetDistance(ts.target) <= erange then
  141.                     CastSpell(_E)
  142.                 end
  143.                 if WREADY and GetDistance(ts.target) <= wrange then
  144.                     CastSpell(_W)
  145.                 end
  146.                 if GetDistance(ts.target) <= ultirange then
  147.                     myHero:Attack(ts.target)
  148.                 end
  149.                 if NautConfig.useUlti and RREADY and GetDistance(ts.target) <= ultirange then
  150.                     CastSpell(_R, ts.target)
  151.                 end
  152.             end
  153.         end
  154.     end
  155.      
  156.     function SCDmgCalculation()
  157.         local enemy = heroManager:GetHero(calculationenemy)
  158.         if ValidTarget(enemy) then
  159.             local ignitedamage, Sheendamage, Trinitydamage = 0, 0, 0
  160.             local qdamage = getDmg("Q",enemy,myHero)
  161.             local edamage = getDmg("E",enemy,myHero)
  162.             local rdamage = getDmg("R",enemy,myHero,1)
  163.             local hitdamage = getDmg("AD",enemy,myHero)
  164.             local ignitedamage = (ignite and getDmg("IGNITE",enemy,myHero) or 0)
  165.             local Sheendamage = (SheenSlot and getDmg("SHEEN",enemy,myHero) or 0)
  166.             local Trinitydamage = (TrinitySlot and getDmg("TRINITY",enemy,myHero) or 0)
  167.             local combo1 = hitdamage*2 + qdamage + edamage + rdamage + Sheendamage + Trinitydamage
  168.             local combo2 = hitdamage*2 + Sheendamage + Trinitydamage
  169.             local combo3 = hitdamage*1 + Sheendamage + Trinitydamage
  170.             local combo4 = 0
  171.             if QREADY then
  172.                 combo2 = combo2 + qdamage
  173.                 combo3 = combo3 + qdamage
  174.             end
  175.             if EREADY then
  176.                 combo2 = combo2 + edamage
  177.                 combo3 = combo3 + edamage
  178.             end
  179.             if RREADY then
  180.                 combo2 = combo2 + rdamage
  181.                 combo4 = combo4 + rdamage
  182.             end
  183.             if IREADY then
  184.                 combo1 = combo1 + ignitedamage
  185.                 combo2 = combo2 + ignitedamage
  186.                 combo3 = combo3 + ignitedamage
  187.             end
  188.             if combo4 >= enemy.health then killable[calculationenemy] = 4
  189.             elseif combo3 >= enemy.health then killable[calculationenemy] = 3
  190.             elseif combo2 >= enemy.health then killable[calculationenemy] = 2
  191.             elseif combo1 >= enemy.health then killable[calculationenemy] = 1
  192.             else killable[calculationenemy] = 0 end
  193.         end
  194.         if calculationenemy == 1 then calculationenemy = heroManager.iCount
  195.         else calculationenemy = calculationenemy-1 end
  196.     end
  197.      
  198.     function OnDraw()
  199.         if NautConfig.drawcircles and not myHero.dead then
  200.             DrawCircle(myHero.x, myHero.y, myHero.z, attackrange, 0xCCFF99)
  201.             DrawCircle(myHero.x, myHero.y, myHero.z, qrange, 0xCCFF33)
  202.             DrawCircle(myHero.x, myHero.y, myHero.z, ultirange, 0xFF6600)
  203.             if ts ~= nil and ts.target ~= nil then
  204.                 for j=0, 10 do
  205.                     DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  206.                 end
  207.             end
  208.             for i=1, heroManager.iCount do
  209.             local enemydraw = heroManager:GetHero(i)
  210.             if ValidTarget(enemydraw) then
  211.                 if NautConfig.drawcircles then
  212.                     if killable[i] == 1 then
  213.                         for j=0, 20 do
  214.                             DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0x0000FF)
  215.                         end
  216.                     elseif killable[i] == 2 then
  217.                         for j=0, 10 do
  218.                             DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  219.                         end
  220.                     elseif killable[i] == 3 then
  221.                         for j=0, 10 do
  222.                             DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  223.                             DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
  224.                         end
  225.                     elseif killable[i] == 4 then
  226.                         for j=0, 10 do
  227.                             DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  228.                             DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
  229.                             DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 140 + j*1.5, 0xFF0000)
  230.                         end
  231.                     end
  232.                 end
  233.                 if NautConfig.drawtext and waittxt[i] == 1 and killable[i] ~= 0 then
  234.                     PrintFloatText(enemydraw,0,floattext[killable[i]])
  235.                 end
  236.             end
  237.             if waittxt[i] == 1 then waittxt[i] = 30
  238.             else waittxt[i] = waittxt[i]-1 end
  239.             end
  240.         end
  241.     end
  242.        
  243.     function OnSendChat(msg)
  244.         ts:OnSendChat(msg, "pri")
  245.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement