FukDaPolice

Autosmite 4.1 by SMART

Apr 23rd, 2015
2,158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.81 KB | None | 0 0
  1. --[[
  2.         AutoSmite 4.1
  3.                 by eXtragoZ
  4.  
  5.                 Features:
  6.                         - Hotkey for switching AutoSmite On/Off (default: N)
  7.                         - Hold-Hotkey for using AutoSmite (default: CTRL)
  8.                         - Range indicator of smite
  9.                         - A bar that indicates at what life can be smited in the hp bar
  10.                         - The damage that smite will do to the monster using smite in the hp bar
  11.                         - Supports Nunu Q and Chogath R
  12.  
  13. Patch 5.6 - Custom edition for SMART
  14.  ^ removed all drawings for better performance/less resource heavy
  15.  ^ removed drawtext for better performance/less resource heavy
  16.  ^ lowered minion health "scan" from 1000000 units to 1400 units (as you dont need possible smite dmg without being near imo).
  17.  ^ fixed smite range (~550)
  18.  ^ fixed circles
  19.  ^ Added Killsteal Function for ChillingSmite - Credit goes to Sida.
  20. ]]
  21.  
  22. local range = 550               -- Range of smite (~550)
  23. local turnoff = true
  24. local smiteSlot = nil
  25. local jungleMonsters = {}
  26.  
  27. local smiteDamage, qDamage, mixDamage, rDamage, mixdDamage = 0, 0, 0, 0, 0
  28. local canuseQ,canuseR,canusesmite = false,false,false
  29. local Smiteison = false
  30. local GameMap = 0
  31.  
  32. function OnLoad()
  33.         if myHero:GetSpellData(SUMMONER_1).name:lower():find("smite") then smiteSlot = SUMMONER_1
  34.     elseif myHero:GetSpellData(SUMMONER_2).name:lower():find("smite") then smiteSlot = SUMMONER_2 end
  35.         if myHero.charName == "Nunu" or myHero.charName == "Chogath" or smiteSlot or not turnoff then
  36.                 SmiteConfig = scriptConfig("AutoSmite 4.1", "autosmite")
  37.                 SmiteConfig:addParam("switcher", "Switcher Hotkey", SCRIPT_PARAM_ONKEYTOGGLE, (smiteSlot ~= nil), 78)
  38.                 SmiteConfig:addParam("hold", "Hold Hotkey", SCRIPT_PARAM_ONKEYDOWN, false, 17)
  39.                 SmiteConfig:addParam("active", "AutoSmite Active", SCRIPT_PARAM_INFO, false)
  40.                 SmiteConfig:addParam("smitenashor", "Always Smite Nashor", SCRIPT_PARAM_ONOFF, true)
  41.                 SmiteConfig:addParam("drawrange", "Draw Smite Range", SCRIPT_PARAM_ONOFF, true)
  42.                 SmiteConfig:addParam("Killsteal", "Killsteal", SCRIPT_PARAM_ONOFF, true)
  43.                 SmiteConfig:addSubMenu("Smite at", "smiteat")
  44.                 SmiteConfig.smiteat:addParam("SRUBaron", "Baron", SCRIPT_PARAM_ONOFF, true)
  45.                 SmiteConfig.smiteat:addParam("SRUDragon", "Dragon", SCRIPT_PARAM_ONOFF, true)
  46.                 SmiteConfig.smiteat:addParam("SRUGromp", "Gromp", SCRIPT_PARAM_ONOFF, false)
  47.                 SmiteConfig.smiteat:addParam("SRUBlue", "Blue Sentinel", SCRIPT_PARAM_ONOFF, true)
  48.                 SmiteConfig.smiteat:addParam("SRUBlueMini", "Sentry 1", SCRIPT_PARAM_ONOFF, false)
  49.                 SmiteConfig.smiteat:addParam("SRUBlueMini2", "Sentry 2", SCRIPT_PARAM_ONOFF, false)
  50.                 SmiteConfig.smiteat:addParam("SRUMurkwolf", "Greater Murk Wolf", SCRIPT_PARAM_ONOFF, false)
  51.                 SmiteConfig.smiteat:addParam("SRUMurkwolfMini", "Murk Wolf", SCRIPT_PARAM_ONOFF, false)
  52.                 SmiteConfig.smiteat:addParam("SRURazorbeak", "Crimson Razorbeak", SCRIPT_PARAM_ONOFF, false)
  53.                 SmiteConfig.smiteat:addParam("SRURazorbeakMini", "Razorbeak", SCRIPT_PARAM_ONOFF, false)
  54.                 SmiteConfig.smiteat:addParam("SRURed", "Brambleback", SCRIPT_PARAM_ONOFF, true)
  55.                 SmiteConfig.smiteat:addParam("SRURedMini", "Cinderling", SCRIPT_PARAM_ONOFF, false)
  56.                 SmiteConfig.smiteat:addParam("SRUKrug", "Ancient Krug", SCRIPT_PARAM_ONOFF, false)
  57.                 SmiteConfig.smiteat:addParam("SRUKrugMini", "Krug", SCRIPT_PARAM_ONOFF, false)
  58.                 SmiteConfig.smiteat:addParam("SruCrab", "Crab", SCRIPT_PARAM_ONOFF, false)
  59.                 SmiteConfig.smiteat:addParam("TTSpiderboss", "TT Spiderboss", SCRIPT_PARAM_ONOFF, true)
  60.                 SmiteConfig.smiteat:addParam("TTNGolem", "TT Golem", SCRIPT_PARAM_ONOFF, true)
  61.                 SmiteConfig.smiteat:addParam("TTNWolf", "TT Wolf", SCRIPT_PARAM_ONOFF, true)
  62.                 SmiteConfig.smiteat:addParam("TTNWraith", "TT Wraith", SCRIPT_PARAM_ONOFF, true)
  63.                 SmiteConfig:permaShow("active")
  64.                 SmiteConfig:permaShow("Killsteal")
  65.                 jungleMonsters = minionManager(MINION_JUNGLE, 1400)
  66.                 GameMap = GetGame().map.index
  67.                 Smiteison = true
  68.                 PrintChat(">> SMARTs Smite")
  69.         end
  70. end
  71.  
  72. function OnTick()
  73.         if not Smiteison then return end
  74.         jungleMonsters:update()
  75.         SmiteConfig.active = ((SmiteConfig.hold and not SmiteConfig.switcher) or (not SmiteConfig.hold and SmiteConfig.switcher))
  76.         if not SmiteConfig.active and SmiteConfig.smitenashor then
  77.                 if GameMap == 1 and GetDistance({x=4543,y=0,z=10234}) <= 850 then
  78.                         SmiteConfig.active = true
  79.                 elseif GameMap == 10 and GetDistance({x=7687,y=0,z=9921}) <= 1000 then
  80.                         SmiteConfig.active = true
  81.                 end
  82.         end
  83.         smiteDamage = math.max(20*myHero.level+370,30*myHero.level+330,40*myHero.level+240,50*myHero.level+100)
  84.         qDamage = 250+150*myHero:GetSpellData(_Q).level
  85.         mixDamage = qDamage+smiteDamage
  86.         rDamage = 1000+.7*myHero.ap
  87.         mixdDamage = rDamage+smiteDamage
  88.         canuseQ = (myHero.charName == "Nunu" and myHero:CanUseSpell(_Q) == READY)
  89.         canuseR = (myHero.charName == "Chogath" and myHero:CanUseSpell(_R) == READY)
  90.         if smiteSlot ~= nil then canusesmite = (myHero:CanUseSpell(smiteSlot) == READY) end
  91.  
  92.         if SmiteConfig.Killsteal then --and myHero:GetSpellData(smiteSlot).name == "S5_SummonerSmitePlayerGanker" then
  93.                 local smiteChampDmg = 20 + myHero.level * 8
  94.                 for _, enemy in pairs(GetEnemyHeroes()) do
  95.                         if enemy.health < smiteChampDmg and GetDistance(enemy)<=range then
  96.                                 CastSpell(smiteSlot, enemy)
  97.                         end
  98.                 end
  99.         end
  100.  
  101.         if SmiteConfig.active and not myHero.dead and (canusesmite or canuseQ or canuseR) then
  102.                 for i,monster in pairs(jungleMonsters.objects) do
  103.                         if monster ~= nil and monster.valid and not monster.dead and monster.visible and monster.x ~= nil and monster.health > 0 and monster.charName ~= "HA_AP_Poro" and monster.charName ~= "TestCubeRender" and monster.charName ~= "TT_Buffplat_R" and monster.charName ~= "TT_Buffplat_L" then
  104.                                 if SmiteConfig.smiteat[monster.charName:gsub("_", "")] then
  105.                                         checkMonster(monster)
  106.                                 end
  107.                         end
  108.                 end    
  109.         end
  110. end
  111. function checkMonster(object)
  112.         local DistanceMonster = GetDistance(object)
  113.         if canusesmite and DistanceMonster <= range and object.health <= smiteDamage then
  114.                 CastSpell(smiteSlot, object)
  115.         elseif canuseQ and DistanceMonster <= 125+200 then
  116.                 if canusesmite and object.health <= mixDamage then
  117.                         CastSpell(_Q, object)
  118.                 elseif object.health <= qDamage then
  119.                         CastSpell(_Q, object)
  120.                 end
  121.         elseif canuseR and DistanceMonster <= 150+200 then
  122.                 if canusesmite and object.health <= mixdDamage then
  123.                         CastSpell(_R, object)
  124.                 elseif object.health <= rDamage then
  125.                         CastSpell(_R, object)
  126.                 end
  127.         end
  128. end
  129. function OnDraw()
  130.         if not Smiteison then return end
  131.         if smiteSlot ~= nil and SmiteConfig.active and SmiteConfig.drawrange and not myHero.dead then
  132.                 DrawCircle(myHero.x, myHero.y, myHero.z, range, ARGB(252,153,45,61))
  133.         end
  134. end
Advertisement
Add Comment
Please, Sign In to add comment