Kain2030

Udyr - Spirit Guard - Combo - v1.3b

Aug 12th, 2013
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 23.25 KB | None | 0 0
  1. --[[
  2. Udyr -Spirit Guard- Combo
  3. by burn
  4. with fix by Kain
  5.  
  6. Credits: HeX (stun cycle), Manciuszz & eXtragoZ (for their Auto TS Priority Arranger, AutoSmitee & Predator Vision & Simple OrbWalking)
  7.  
  8. Features:
  9. *Auto Ignite
  10. *Auto Smite
  11. *Predator vision
  12. *Auto TS Priority Arranger
  13. *Auto potions
  14. *Auto cast Items
  15. *Auto level up
  16. *OrbWalking in combo
  17.  
  18. Combos: -dynamic, according to the spells you have leveled-
  19. *E-AA-Q-AA-R-AAx4-W (Max Damage - proc 2x R flames)
  20. *E-AA-R-AAx4-W
  21. *E-AA-Q-AA-W
  22. *Q-AA-R-AAx4-W
  23. *E-AA-Q-AA-R-AAx4
  24. *R-AAx4-W
  25. *E-AA-Q
  26. *Q or R
  27. *extra: Stun Cycle --]]
  28. if myHero.charName ~= "Udyr" then return end
  29. --[[ Config ]]--
  30. local levelSequence = {4,2,4,3,4,2,4,2,4,2,2,3,1,3,3,3,1,1} --Trick2g Phoenix jungle style
  31. --[[ CODE ]]--
  32. local UdyrConfig, ts
  33. local lastAttack = GetTickCount()
  34. local walkDistance = 300
  35. local lastWindUpTime = 0
  36. local lastAttackCD = 0
  37. local lastAnimation = ""
  38. local ignite = nil
  39. local stunTarget = nil
  40. local lastCast = "none"
  41. local AAcount = 0
  42. local lastNameTarget = myHero.name
  43. local priorityTable = {
  44.     AP = {
  45.         "Ahri", "Akali", "Anivia", "Annie", "Brand", "Cassiopeia", "Diana", "Evelynn", "FiddleSticks", "Fizz", "Gragas", "Heimerdinger", "Karthus",
  46.         "Kassadin", "Katarina", "Kayle", "Kennen", "Leblanc", "Lissandra", "Lux", "Malzahar", "Mordekaiser", "Morgana", "Nidalee", "Orianna",
  47.         "Rumble", "Ryze", "Sion", "Swain", "Syndra", "Teemo", "TwistedFate", "Veigar", "Viktor", "Vladimir", "Xerath", "Ziggs", "Zyra", "MasterYi",
  48.     },
  49.     Support = {
  50.         "Blitzcrank", "Janna", "Karma", "Leona", "Lulu", "Nami", "Sona", "Soraka", "Thresh", "Zilean",
  51.     },
  52.     Tank = {
  53.         "Amumu", "Chogath", "DrMundo", "Galio", "Hecarim", "Malphite", "Maokai", "Nasus", "Rammus", "Sejuani", "Shen", "Singed", "Skarner", "Volibear",
  54.         "Warwick", "Yorick", "Zac", "Nunu", "Taric", "Alistar",
  55.     },
  56.     AD_Carry = {
  57.         "Ashe", "Caitlyn", "Corki", "Draven", "Ezreal", "Graves", "Jayce", "KogMaw", "MissFortune", "Pantheon", "Quinn", "Shaco", "Sivir",
  58.         "Talon", "Tristana", "Twitch", "Urgot", "Varus", "Vayne", "Zed",
  59.     },
  60.     Bruiser = {
  61.         "Darius", "Elise", "Fiora", "Gangplank", "Garen", "Irelia", "JarvanIV", "Jax", "Khazix", "LeeSin", "Nautilus", "Nocturne", "Olaf", "Poppy",
  62.         "Renekton", "Rengar", "Riven", "Shyvana", "Trundle", "Tryndamere", "Udyr", "Vi", "MonkeyKing", "XinZhao", "Aatrox"
  63.     },
  64. }
  65. local minionVisionRange = 1250
  66. local heroVisionRange = 1450
  67. local storedminions = {}
  68. local useDebug = false
  69. --Auto Smite vars
  70. local range = 800
  71. local smiteSlot = nil
  72. local smiteDamage = 0
  73. local canusesmite = false
  74. local Vilemaw,Nashor,Dragon,Golem1,Golem2,Lizard1,Lizard2 = nil,nil,nil,nil,nil,nil,nil
  75.  
  76. function OnLoad()
  77.     UdyrConfig = scriptConfig("Udyr Combo", "UdyrCombo")
  78.     UdyrConfig:addParam("Combo", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  79.     UdyrConfig:addParam("StunCycle", "Stun Cycle press C", SCRIPT_PARAM_ONKEYDOWN, false, 67) --c
  80.     UdyrConfig:addParam("drawCircles", "Draw circles", SCRIPT_PARAM_ONOFF, true)
  81.     UdyrConfig:addParam("autoignite", "Auto Ignite killable", SCRIPT_PARAM_ONOFF, true)
  82.     UdyrConfig:addParam("autoTS", "Auto Arrenge TS priority", SCRIPT_PARAM_ONOFF, true)
  83.     UdyrConfig:addParam("autoPotions", "Use potions when HP < 60%", SCRIPT_PARAM_ONOFF, true)
  84.     UdyrConfig:addParam("PredatorVision", "Toggle X for use Predator Vision", SCRIPT_PARAM_ONKEYTOGGLE, false, string.byte("X"))
  85.     UdyrConfig:addParam("autoLevel", "Auto level spells", SCRIPT_PARAM_ONOFF, false)
  86.     UdyrConfig:addParam("moveToMouse", "Move to Mouse", SCRIPT_PARAM_ONOFF, false)
  87.     UdyrConfig:addParam("AutoSmiteInfo", "--- Auto Smite Settings ---", SCRIPT_PARAM_INFO)
  88.     UdyrConfig:addParam("EnableAutoSmite", "Enable AutoSmite (Turn On/Off)", SCRIPT_PARAM_ONOFF, true)
  89.     UdyrConfig:addParam("UseAutoSmite", "Use AutoSmite", SCRIPT_PARAM_ONOFF, true)
  90.     UdyrConfig:addParam("TempStopStartAutoSmite", "Press Ctrl to temporarily stop/start AS", SCRIPT_PARAM_ONKEYDOWN, false, 17) --Ctrl
  91.     UdyrConfig:addParam("smiteRange", "Draw Smite Range", SCRIPT_PARAM_ONOFF, true)
  92.     UdyrConfig:addParam("drawAStext", "Draw Remaining %HP monsters", SCRIPT_PARAM_ONOFF, true)
  93.     UdyrConfig:permaShow("Combo")
  94.     UdyrConfig:permaShow("StunCycle")
  95.     UdyrConfig:permaShow("PredatorVision")
  96.     UdyrConfig:permaShow("UseAutoSmite")
  97.     ts = TargetSelector(TARGET_LESS_CAST_PRIORITY, 600, DAMAGE_PHYSICAL, false)
  98.     ts.name = "Udyr"
  99.     UdyrConfig:addTS(ts)
  100.     PrintChat(">> Udyr -Spirit Guard- Combo v1.3 loaded!")
  101.     if UdyrConfig.autoTS then
  102.         if #GetEnemyHeroes() > 1 then
  103.             TargetSelector(TARGET_LESS_CAST_PRIORITY, 0)
  104.             arrangePrioritys(#GetEnemyHeroes())
  105.         end
  106.     end
  107.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  108.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end
  109.     --Predator Vision
  110.     LoadMinions()
  111.     --Auto Smite Check
  112.     if myHero:GetSpellData(SUMMONER_1).name:find("Smite") then smiteSlot = SUMMONER_1
  113.     elseif myHero:GetSpellData(SUMMONER_2).name:find("Smite") then smiteSlot = SUMMONER_2 end
  114.     if smiteSlot ~= nil then ASLoadMinions() end
  115. end
  116.  
  117. function OnProcessSpell(object, spell)
  118.     if myHero.dead then return end
  119.     if object.isMe then
  120.         if spell.name:lower():find("attack") then
  121.             lastAttack = GetTickCount() - GetLatency()/2
  122.             lastWindUpTime = spell.windUpTime*1000
  123.             lastAttackCD = spell.animationTime*1000
  124.             AAcount = AAcount + 1
  125.         end
  126.     end
  127. end
  128.  
  129. function OnAnimation(unit,animationName)
  130.     if myHero.dead then return end
  131.     if unit.isMe and lastAnimation ~= animationName then lastAnimation = animationName end
  132. end
  133.  
  134. function OnTick()
  135.     ts:SetDamages((40*GetSpellData(_R).level+.25*myHero.ap), myHero.totalDamage,0)
  136.     ts:update()
  137.     if myHero.dead then return end
  138.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  139.     WREADY = (myHero:CanUseSpell(_W) == READY)
  140.     EREADY = (myHero:CanUseSpell(_E) == READY)
  141.     RREADY = (myHero:CanUseSpell(_R) == READY)
  142.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  143.  
  144.     --[[ Auto Level ]]--
  145.     if UdyrConfig.autoLevel then
  146.         autoLevelSetSequence(levelSequence)
  147.     end
  148.  
  149.     --[[ Move to Mouse ]]--
  150.     if UdyrConfig.moveToMouse and ts.target == nil and UdyrConfig.Combo then
  151.         myHero:MoveTo(mousePos.x, mousePos.z)
  152.     end
  153.  
  154.     --[[ Auto Smite ]]--
  155.     if smiteSlot ~= nil then
  156.         UdyrConfig.UseAutoSmite = ((UdyrConfig.EnableAutoSmite and not UdyrConfig.TempStopStartAutoSmite) or (not UdyrConfig.EnableAutoSmite and UdyrConfig.TempStopStartAutoSmite))
  157.         if UdyrConfig.UseAutoSmite then
  158.             checkDeadMonsters()
  159.             smiteDamage = 460+30*myHero.level
  160.             canusesmite = (myHero:CanUseSpell(smiteSlot) == READY)
  161.             if canusesmite then
  162.                 if Vilemaw ~= nil then checkMonster(Vilemaw) end
  163.                 if Nashor ~= nil then checkMonster(Nashor) end
  164.                 if Dragon ~= nil then checkMonster(Dragon) end
  165.                 if Golem1 ~= nil then checkMonster(Golem1) end
  166.                 if Golem2 ~= nil then checkMonster(Golem2) end
  167.                 if Lizard1 ~= nil then checkMonster(Lizard1) end
  168.                 if Lizard2 ~= nil then checkMonster(Lizard2) end
  169.             end
  170.         end
  171.     end
  172.  
  173.     --[[ Auto Potions ]]--
  174.     if UdyrConfig.autoPotions then
  175.         if tickPotions == nil or (GetTickCount() - tickPotions > 1000) then
  176.             PotionSlot = GetInventorySlotItem(2003)
  177.             if PotionSlot ~= nil then --we have potions
  178.                 if myHero.health/myHero.maxHealth < 0.60 and not TargetHaveBuff("RegenerationPotion", myHero) and not InFountain() then
  179.                     CastSpell(PotionSlot)
  180.                 end
  181.             end
  182.             tickPotions = GetTickCount()
  183.         end
  184.     end
  185.  
  186.     --[[ Ignite ]]--
  187.     if UdyrConfig.autoignite then
  188.         if IREADY then
  189.             local ignitedmg = 0
  190.             for i = 1, heroManager.iCount, 1 do
  191.                 local enemyhero = heroManager:getHero(i)
  192.                 if ValidTarget(enemyhero,600) then
  193.                     ignitedmg = 50 + 20 * myHero.level
  194.                     if enemyhero.health <= ignitedmg then
  195.                         CastSpell(ignite, enemyhero)
  196.                     end
  197.                 end
  198.             end
  199.         end
  200.     end
  201.  
  202.     --[[ Reset AA Count ]]--
  203.     if ts.target ~= nil then
  204.         if ts.target.name ~= lastNameTarget then
  205.             lastNameTarget = ts.target.name
  206.             AAcount = 0
  207.             lastCast = "none"
  208.         end
  209.     else
  210.         AAcount = 0
  211.         lastCast = "none"
  212.     end
  213.  
  214.     --[[ Combo ]]--
  215.     if UdyrConfig.Combo and ts.target ~= nil then
  216.         if GetInventoryItemIsCastable(3128) then CastSpell(GetInventorySlotItem(3128), ts.target) end
  217.         if GetInventoryItemIsCastable(3146) then CastSpell(GetInventorySlotItem(3146), ts.target) end
  218.         if GetInventoryItemIsCastable(3144) then CastSpell(GetInventorySlotItem(3144), ts.target) end
  219.         if GetInventoryItemIsCastable(3153) then CastSpell(GetInventorySlotItem(3153), ts.target) end
  220.         if GetInventoryItemIsCastable(3131) and GetDistance(ts.target) < 350 then CastSpell(GetInventorySlotItem(3131)) end
  221.         if GetInventoryItemIsCastable(3077) and GetDistance(ts.target) < 350 then CastSpell(GetInventorySlotItem(3077)) end
  222.         if GetInventoryItemIsCastable(3074) and GetDistance(ts.target) < 350 then CastSpell(GetInventorySlotItem(3074)) end
  223.         if GetInventoryItemIsCastable(3143) and GetDistance(ts.target) < 350 then CastSpell(GetInventorySlotItem(3143)) end
  224.         --We have E-Q-R-W
  225.         if myHero:GetSpellData(_Q).level >= 1 and myHero:GetSpellData(_W).level >= 1 and myHero:GetSpellData(_E).level >= 1 and myHero:GetSpellData(_R).level >= 1 then
  226.             if EREADY and CheckForBearStun(ts.target) == false then
  227.                 CastSpell(_E)
  228.                 lastCast = "E"
  229.                 AAcount = 0
  230.             elseif (CheckForBearStun(ts.target) == true and QREADY) and (lastCast == "E" or lastCast == "none" or lastCast == "W") and AAcount >= 1 then
  231.                 CastSpell(_Q)
  232.                 lastCast = "Q"
  233.                 AAcount = 0
  234.             elseif (CheckForBearStun(ts.target) == true and RREADY) and lastCast == "Q" and AAcount >= 1 then
  235.                 CastSpell(_R)
  236.                 lastCast = "R"
  237.                 AAcount = 0
  238.             elseif (CheckForBearStun(ts.target) == true and WREADY) and lastCast == "R" and AAcount >= 4 then
  239.                 CastSpell(_W)
  240.                 lastCast = "W"
  241.                 AAcount = 0
  242.             end
  243.             OrbWalk()
  244.         --We have E-R-W
  245.         elseif myHero:GetSpellData(_W).level >= 1 and myHero:GetSpellData(_E).level >= 1 and myHero:GetSpellData(_R).level >= 1 and myHero:GetSpellData(_Q).level == 0 then
  246.             if EREADY and CheckForBearStun(ts.target) == false then
  247.                 CastSpell(_E)
  248.                 lastCast = "E"
  249.                 AAcount = 0
  250.             elseif (CheckForBearStun(ts.target) == true and RREADY) and (lastCast == "E" or lastCast == "none" or lastCast == "W") and AAcount >= 1 then
  251.                 CastSpell(_R)
  252.                 lastCast = "R"
  253.                 AAcount = 0
  254.             elseif (CheckForBearStun(ts.target) == true and WREADY) and lastCast == "R" and AAcount >= 4 then
  255.                 CastSpell(_W)
  256.                 lastCast = "W"
  257.                 AAcount = 0
  258.             end
  259.             OrbWalk()
  260.         --We have E-Q-W
  261.         elseif myHero:GetSpellData(_W).level >= 1 and myHero:GetSpellData(_E).level >= 1 and myHero:GetSpellData(_Q).level >= 1 and myHero:GetSpellData(_R).level == 0 then
  262.             if EREADY and CheckForBearStun(ts.target) == false then
  263.                 CastSpell(_E)
  264.                 lastCast = "E"
  265.                 AAcount = 0
  266.             elseif (CheckForBearStun(ts.target) == true and QREADY) and (lastCast == "E" or lastCast == "none" or lastCast == "W") and AAcount >= 1 then
  267.                 CastSpell(_Q)
  268.                 lastCast = "Q"
  269.                 AAcount = 0
  270.             elseif (CheckForBearStun(ts.target) == true and WREADY) and lastCast == "Q" and AAcount >= 1 then
  271.                 CastSpell(_W)
  272.                 lastCast = "W"
  273.                 AAcount = 0
  274.             end
  275.             OrbWalk()
  276.         --We have Q-W-R
  277.         elseif myHero:GetSpellData(_W).level >= 1 and myHero:GetSpellData(_E).level == 0 and myHero:GetSpellData(_Q).level >= 1 and myHero:GetSpellData(_R).level >= 1 then
  278.             if QREADY and ((lastCast == "R" and AAcount >= 4) or lastCast == "none") then
  279.                 CastSpell(_Q)
  280.                 lastCast = "Q"
  281.                 AAcount = 0
  282.             elseif WREADY and lastCast == "Q" and AAcount >= 1 then
  283.                 CastSpell(_W)
  284.                 lastCast = "W"
  285.                 AAcount = 0
  286.             elseif RREADY and lastCast == "W" then
  287.                 CastSpell(_R)
  288.                 lastCast = "R"
  289.                 AAcount = 0
  290.             end
  291.             OrbWalk()
  292.         --We have E-Q-R
  293.         elseif myHero:GetSpellData(_W).level == 0 and myHero:GetSpellData(_E).level >=1 and myHero:GetSpellData(_Q).level >= 1 and myHero:GetSpellData(_R).level >= 1 then
  294.             if EREADY and CheckForBearStun(ts.target) == false then
  295.                 CastSpell(_E)
  296.                 lastCast = "E"
  297.                 AAcount = 0
  298.             elseif CheckForBearStun(ts.target) == true and QREADY and (((lastCast == "E" or lastCast == "none") and AAcount >= 1) or (lastCast == "R" and AAcount >= 4)) then
  299.                 CastSpell(_Q)
  300.                 lastCast = "Q"
  301.                 AAcount = 0
  302.             elseif CheckForBearStun(ts.target) == true and RREADY and lastCast == "Q" and AAcount >= 1 then
  303.                 CastSpell(_R)
  304.                 lastCast = "R"
  305.                 AAcount = 0
  306.             end
  307.             OrbWalk()
  308.         --We have R-W
  309.         elseif myHero:GetSpellData(_W).level >= 1 and myHero:GetSpellData(_R).level >= 1 and myHero:GetSpellData(_Q).level == 0 and myHero:GetSpellData(_E).level == 0 then
  310.             if RREADY and (lastCast == "none" or lastCast == "W") and AAcount >= 0 then
  311.                 CastSpell(_R)
  312.                 lastCast = "R"
  313.                 AAcount = 0
  314.             elseif WREADY and lastCast == "R" and AAcount >= 4 then
  315.                 CastSpell(_W)
  316.                 lastCast = "W"
  317.                 AAcount = 0
  318.             end
  319.             OrbWalk()
  320.         --We have E-Q
  321.         elseif myHero:GetSpellData(_W).level == 0 and myHero:GetSpellData(_R).level == 0 and myHero:GetSpellData(_Q).level >= 1 and myHero:GetSpellData(_E).level >= 1 then
  322.             if EREADY and CheckForBearStun(ts.target) == false then
  323.                 CastSpell(_E)
  324.                 lastCast = "E"
  325.                 AAcount = 0
  326.             elseif CheckForBearStun(ts.target) == true and QREADY and (lastCast == "E" or lastCast == "none" or lastCast == "Q") and AAcount >= 1 then
  327.                 CastSpell(_Q)
  328.                 lastCast = "Q"
  329.                 AAcount = 0
  330.             end
  331.             OrbWalk()
  332.         --We have Q or R
  333.         elseif (myHero:GetSpellData(_Q).level >= 1 or myHero:GetSpellData(_R).level >= 1) and myHero:GetSpellData(_W).level == 0 and myHero:GetSpellData(_E).level == 0 then
  334.             if QREADY and AAcount >= 0 then CastSpell(_Q) AAcount = 0 end
  335.             if RREADY and AAcount >= 1 then CastSpell(_R) AAcount = 0 end
  336.             OrbWalk()
  337.         end
  338.     end
  339.  
  340.     --[[ Stun Cycle ]]--
  341.     if UdyrConfig.StunCycle then
  342.         stunTarget = findClosestEnemy()
  343.         if stunTarget ~= nil and GetDistance(stunTarget) <= 600 then
  344.             if EREADY then
  345.                 CastSpell(_E)
  346.                 lastCast = "E"
  347.             end
  348.             myHero:Attack(stunTarget)
  349.         end
  350.     end
  351. end
  352.  
  353. function OrbWalk()
  354.     if not TargetHaveBuff("udyrbearstuncheck", ts.target) then
  355.         myHero:Attack(ts.target)
  356.     else
  357.         if GetDistance(ts.target) <= myHero.range + 65 then
  358.             if timeToShoot() then
  359.                 myHero:Attack(ts.target)
  360.             elseif heroCanMove() then
  361.                 moveToCursor()
  362.             end
  363.         else
  364.             myHero:Attack(ts.target)
  365.         end
  366.     end
  367. end
  368.  
  369. function CheckForBearStun(target)
  370.     --oldtarget = GetTarget()  
  371.     SetTarget(target)  
  372.     if TargetHaveBuff("udyrbearstuncheck", target) then
  373.         --SetTarget(oldtarget)
  374.         return true
  375.     else
  376.         --SetTarget(oldtarget)
  377.         return false
  378.     end
  379. end
  380.  
  381. function findClosestEnemy()
  382.     local closestEnemy = nil
  383.     local currentEnemy = nil
  384.     for i=1, heroManager.iCount do
  385.         currentEnemy = heroManager:GetHero(i)
  386.         if ValidTarget(currentEnemy, 600) and CheckForBearStun(currentEnemy) == false then
  387.             if closestEnemy == nil then
  388.                 closestEnemy = currentEnemy
  389.             elseif GetDistance(currentEnemy) < GetDistance(closestEnemy) then
  390.                 closestEnemy = currentEnemy
  391.             end
  392.         end
  393.     end
  394.     return closestEnemy
  395. end
  396.  
  397. function heroCanMove()
  398.     return (GetTickCount() + GetLatency()/2 > lastAttack + lastWindUpTime + 20)
  399. end
  400.  
  401. function timeToShoot()
  402.     return (GetTickCount() + GetLatency()/2 > lastAttack + lastAttackCD)
  403. end
  404.  
  405. function moveToCursor()
  406.     if GetDistance(mousePos) > 1 or lastAnimation == "Idle1" then
  407.         local moveToPos = myHero + (Vector(mousePos) - myHero):normalized()*walkDistance
  408.         myHero:MoveTo(moveToPos.x, moveToPos.z)
  409.     end
  410. end
  411.  
  412. function OnDraw()
  413.     if useDebug then
  414.         DrawText("AutoAttack Count: "..AAcount,17,WINDOW_W - (WINDOW_W/3*2.45),WINDOW_H - (WINDOW_H/13.3),ARGB(0xFF,0xFF,0xF0,0x00))
  415.         DrawText("Last Cast: "..lastCast,17,WINDOW_W - (WINDOW_W/3*2.45),WINDOW_H - (WINDOW_H/7.3),ARGB(0xFF,0xFF,0xF0,0x00))
  416.         DrawText("Last Target Name: "..tostring(lastNameTarget),17,WINDOW_W - (WINDOW_W/3*2.45),WINDOW_H - (WINDOW_H/5.3),ARGB(0xFF,0xFF,0xF0,0x00))
  417.         if ts.target ~= nil then
  418.             if TargetHaveBuff("udyrbearstuncheck", ts.target) then
  419.                 DrawText("Enemy STUNNED Recently",17,WINDOW_W - (WINDOW_W/3*2.45),WINDOW_H - (WINDOW_H/9.3),ARGB(0xFF,0xFF,0xF0,0x00))
  420.             else
  421.                 DrawText("Enemy NO stunned",17,WINDOW_W - (WINDOW_W/3*2.45),WINDOW_H - (WINDOW_H/9.3),ARGB(0xFF,0xFF,0xF0,0x00))
  422.             end
  423.         end
  424.     end
  425.     if not myHero.dead and UdyrConfig.drawCircles then
  426.         if ts.target ~= nil then
  427.             DrawCircle(ts.target.x, ts.target.y, ts.target.z, 150, 0x7A24DB)
  428.         end
  429.         DrawCircle(myHero.x, myHero.y, myHero.z, 600, 0xC2743C)
  430.     end
  431.     --predator vision
  432.     if UdyrConfig.PredatorVision then
  433.         DrawCircle(mousePos.x, mousePos.y, mousePos.z, 100, 0xFF00FF00)
  434.         for i,obj in ipairs(storedminions) do --loop the table that minions are stored.
  435.             if obj ~= nil then
  436.                 if (GetDistance(obj, mousePos) < 100) then
  437.                     if obj.team ~= myHero.team and obj.type == "obj_AI_Minion" and not obj.dead then -- If the enemy minion is not dead
  438.                         if GetDistance(obj,myHero) <= minionVisionRange then
  439.                             DrawCircle(obj.x, obj.y, obj.z, minionVisionRange, 0xFFFF0000) --IF MINION CAN SEE YOU, CHANGE THE COLOR to RED
  440.                         else
  441.                             DrawCircle(obj.x, obj.y, obj.z, minionVisionRange, 0xFF00FF00) --IF MINION CAN'T SEE YOU, CHANGE THE COLOR to GREEN
  442.                         end
  443.                     end
  444.                 end
  445.             end
  446.         end
  447.         for i,hero in ipairs(GetEnemyHeroes()) do
  448.             if hero ~= nil then
  449.                 if (GetDistance(hero, mousePos) < 100) then
  450.                     if hero.team ~= myHero.team and hero.type == "obj_AI_Hero" and not hero.dead then
  451.                         if GetDistance(hero,myHero) <= heroVisionRange then
  452.                             DrawCircle(hero.x, hero.y, hero.z, heroVisionRange, 0xFF00FF00)
  453.                         else
  454.                             DrawCircle(hero.x, hero.y, hero.z, heroVisionRange, 0xFF00FF00)
  455.                         end
  456.                     end
  457.                 end
  458.             end
  459.         end
  460.     end
  461.     --Auto Smite
  462.     if smiteSlot ~= nil and UdyrConfig.UseAutoSmite and UdyrConfig.smiteRange and not myHero.dead then
  463.         if canusesmite then DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x992D3D) end
  464.     end
  465.     if not myHero.dead and (UdyrConfig.drawAStext or UdyrConfig.smiteRange) and smiteSlot ~= nil and UdyrConfig.UseAutoSmite then
  466.         if Vilemaw ~= nil then MonsterDraw(Vilemaw) end
  467.         if Nashor ~= nil then MonsterDraw(Nashor) end
  468.         if Dragon ~= nil then MonsterDraw(Dragon) end
  469.         if Golem1 ~= nil then MonsterDraw(Golem1) end
  470.         if Golem2 ~= nil then MonsterDraw(Golem2) end
  471.         if Lizard1 ~= nil then MonsterDraw(Lizard1) end
  472.         if Lizard2 ~= nil then MonsterDraw(Lizard2) end
  473.     end
  474. end
  475.  
  476. function SetPriority(table, hero, priority)
  477.     for i=1, #table, 1 do
  478.         if hero.charName:find(table[i]) ~= nil then
  479.             TS_SetHeroPriority(priority, hero.charName)
  480.         end
  481.     end
  482. end
  483.  
  484. function arrangePrioritys(enemies)
  485.     local priorityOrder = {
  486.         [2] = {1,1,2,2,2},
  487.         [3] = {1,1,2,3,3},
  488.         [4] = {1,2,3,4,4},
  489.         [5] = {1,2,3,4,5},
  490.     }
  491.     for i, enemy in ipairs(GetEnemyHeroes()) do
  492.         SetPriority(priorityTable.AD_Carry, enemy, priorityOrder[enemies][1])
  493.         SetPriority(priorityTable.AP,       enemy, priorityOrder[enemies][2])
  494.         SetPriority(priorityTable.Support,  enemy, priorityOrder[enemies][3])
  495.         SetPriority(priorityTable.Bruiser,  enemy, priorityOrder[enemies][4])
  496.         SetPriority(priorityTable.Tank,     enemy, priorityOrder[enemies][5])
  497.     end
  498. end
  499.  
  500. function LoadMinions()
  501.     for i = 1, objManager.maxObjects do
  502.         local object = objManager:getObject(i)
  503.         if object and object.team ~= myHero.team and object.type == "obj_AI_Minion" and not object.dead then
  504.             table.insert(storedminions, object)
  505.         end
  506.     end
  507. end
  508.  
  509. function OnCreateObj(obj)
  510.     if obj and obj.type == "obj_AI_Minion" and (obj.name:find((myHero.team == TEAM_BLUE and "T200" or "T100")) or obj.name:find((myHero.team == TEAM_BLUE and "Red" or "Blue"))) then
  511.         table.insert(storedminions, obj)
  512.     end
  513.     if obj ~= nil and obj.type == "obj_AI_Minion" and obj.name ~= nil and smiteSlot ~= nil then
  514.         if obj.name == "TT_Spiderboss7.1.1" then Vilemaw = obj
  515.         elseif obj.name == "Worm12.1.1" then Nashor = obj
  516.         elseif obj.name == "Dragon6.1.1" then Dragon = obj
  517.         elseif obj.name == "AncientGolem1.1.1" then Golem1 = obj
  518.         elseif obj.name == "AncientGolem7.1.1" then Golem2 = obj
  519.         elseif obj.name == "LizardElder4.1.1" then Lizard1 = obj
  520.         elseif obj.name == "LizardElder10.1.1" then Lizard2 = obj end
  521.     end
  522. end
  523.  
  524. function OnDeleteObj(obj)
  525.     for i,v in ipairs(storedminions) do
  526.         if obj and v.name ~= nil and obj.name:find(v.name) then
  527.             table.remove(storedminions,i)
  528.         end
  529.     end
  530.     if obj ~= nil and obj.name ~= nil and smiteSlot ~= nil then
  531.         if obj.name == "TT_Spiderboss7.1.1" then Vilemaw = nil
  532.         elseif obj.name == "Worm12.1.1" then Nashor = nil
  533.         elseif obj.name == "Dragon6.1.1" then Dragon = nil
  534.         elseif obj.name == "AncientGolem1.1.1" then Golem1 = nil
  535.         elseif obj.name == "AncientGolem7.1.1" then Golem2 = nil
  536.         elseif obj.name == "LizardElder4.1.1" then Lizard1 = nil
  537.         elseif obj.name == "LizardElder10.1.1" then Lizard2 = nil end
  538.     end
  539. end
  540.  
  541. function checkDeadMonsters()
  542.     if Vilemaw ~= nil and (not Vilemaw.valid or Vilemaw.dead or Vilemaw.health <= 0) then Vilemaw = nil end
  543.     if Nashor ~= nil and (not Nashor.valid or Nashor.dead or Nashor.health <= 0) then Nashor = nil end
  544.     if Dragon ~= nil and (not Dragon.valid or Dragon.dead or Dragon.health <= 0) then Dragon = nil end
  545.     if Golem1 ~= nil and (not Golem1.valid or Golem1.dead or Golem1.health <= 0) then Golem1 = nil end
  546.     if Golem2 ~= nil and (not Golem2.valid or Golem2.dead or Golem2.health <= 0) then Golem2 = nil end
  547.     if Lizard1 ~= nil and (not Lizard1.valid or Lizard1.dead or Lizard1.health <= 0) then Lizard1 = nil end
  548.     if Lizard2 ~= nil and (not Lizard2.valid or Lizard2.dead or Lizard2.health <= 0) then Lizard2 = nil end
  549. end
  550.  
  551. function ASLoadMinions()
  552.     for i = 1, objManager.maxObjects do
  553.         local obj = objManager:getObject(i)
  554.         if obj ~= nil and obj.type == "obj_AI_Minion" and obj.name ~= nil then
  555.             if obj.name == "TT_Spiderboss7.1.1" then Vilemaw = obj
  556.             elseif obj.name == "Worm12.1.1" then Nashor = obj
  557.             elseif obj.name == "Dragon6.1.1" then Dragon = obj
  558.             elseif obj.name == "AncientGolem1.1.1" then Golem1 = obj
  559.             elseif obj.name == "AncientGolem7.1.1" then Golem2 = obj
  560.             elseif obj.name == "LizardElder4.1.1" then Lizard1 = obj
  561.             elseif obj.name == "LizardElder10.1.1" then Lizard2 = obj end
  562.         end
  563.     end
  564. end
  565.  
  566. function checkMonster(object)
  567.     if object ~= nil and not object.dead and object.visible and object.x ~= nil then
  568.         if canusesmite and GetDistance(object) <= range and object.health <= smiteDamage then
  569.             CastSpell(smiteSlot, object)
  570.         end
  571.     end
  572. end
  573.  
  574. function MonsterDraw(object)
  575.     if object ~= nil and not object.dead and object.visible and object.x ~= nil and smiteSlot ~= nil then
  576.         if UdyrConfig.UseAutoSmite and UdyrConfig.smiteRange and canusesmite and GetDistance(object) <= range then
  577.             local healthradius = object.health*100/object.maxHealth
  578.             DrawCircle(object.x, object.y, object.z, healthradius+100, 0x00FF00)
  579.             if canusesmite then
  580.                 local smitehealthradius = smiteDamage*100/object.maxHealth
  581.                 DrawCircle(object.x, object.y, object.z, smitehealthradius+100, 0x00FFFF)
  582.             end
  583.         end
  584.         if UdyrConfig.drawAStext and GetDistance(object) <= range*2 then
  585.             local wtsobject = WorldToScreen(D3DXVECTOR3(object.x,object.y,object.z))
  586.             local objectX, objectY = wtsobject.x, wtsobject.y
  587.             local onScreen = OnScreen(wtsobject.x, wtsobject.y)
  588.             if onScreen then
  589.                 local statusdmgS = smiteDamage*100/object.health
  590.                 local statuscolorS = (canusesmite and 0xFF00FF00 or 0xFFFF0000)
  591.                 local textsizeS = statusdmgS < 100 and math.floor((statusdmgS/100)^2*20+8) or 28
  592.                 textsizeS = textsizeS > 16 and textsizeS or 16
  593.                 DrawText(string.format("%.1f", statusdmgS).."% - Smite", textsizeS, objectX-40, objectY+38, statuscolorS)
  594.             end
  595.         end
  596.     end
  597. end
Advertisement
Add Comment
Please, Sign In to add comment