16HeX16

Plugin - Tryndamere

Jul 25th, 2013
2,410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.99 KB | None | 0 0
  1. if myHero.charName ~= "Tryndamere" then return end
  2.  
  3. function PluginOnLoad()
  4.     AutoCarry.SkillsCrosshair.range = 850
  5.     --> Main Load
  6.     mainLoad()
  7.     --> Main Menu
  8.     mainMenu()
  9.     --> Tower Table
  10.     towersUpdate()
  11. end
  12.  
  13. function PluginOnTick()
  14.     Checks()
  15.     if Target and Menu2.AutoCarry then
  16.         if WREADY and Menu.useW and GetDistance(Target) <= wRange then CastSpell(_W) end
  17.         if EREADY and Menu.useE then castE(Target) end
  18.     end
  19.     if RREADY and Menu.autoR then autoUlt() end
  20.     if EREADY and Menu.eKS then eKS() end
  21. end
  22.  
  23. function autoUlt()
  24.     if RREADY and not myHero.dead then
  25.         if myHero.health <= myHero.maxHealth*(Menu.rHealth/100) then
  26.             if Target or TargetHaveBuff("SummonerDot", myHero) then
  27.                 CastSpell(_R)
  28.             end
  29.         elseif myHero.health <= myHero.maxHealth*((Menu.rHealth*1.5)/100) and inTurretRange(myHero) then
  30.             CastSpell(_R)
  31.         end
  32.     end
  33. end
  34.  
  35. function eKS()
  36.     for i, enemy in ipairs(GetEnemyHeroes()) do
  37.         if enemy and not enemy.dead and enemy.health < getDmg("E", enemy, myHero) then
  38.             castE(enemy)
  39.         end
  40.     end
  41. end
  42.  
  43. --> Tower Checks
  44. function towersUpdate()
  45.     for i = 1, objManager.iCount, 1 do
  46.         local obj = objManager:getObject(i)
  47.         if obj ~= nil and string.find(obj.type, "obj_Turret") ~= nil and string.find(obj.name, "_A") == nil and obj.health > 0 then
  48.             if not string.find(obj.name, "TurretShrine") and obj.team ~= player.team then
  49.                 table.insert(towers, obj)
  50.             end
  51.         end
  52.     end
  53. end
  54.  
  55. function inTurretRange(unit)
  56.     local check = false
  57.     for i, tower in ipairs(towers) do
  58.         if tower.health > 0 then
  59.             if math.sqrt((tower.x - unit.x) ^ 2 + (tower.z - unit.z) ^ 2) < 950 then
  60.                 check = true
  61.             end
  62.         else
  63.             table.remove(towers, i)
  64.         end
  65.     end
  66. return check
  67. end
  68.  
  69. function castE(target)
  70.     ePred = AutoCarry.GetPrediction(SkillE, target)
  71.     if ePred and GetDistance(ePred) <= eRange then CastSpell(_E, ePred.x, ePred.z) end
  72. end
  73.  
  74. --> Checks
  75. function Checks()
  76.     Target = AutoCarry.GetAttackTarget()
  77.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  78.     WREADY = (myHero:CanUseSpell(_W) == READY)
  79.     EREADY = (myHero:CanUseSpell(_E) == READY)
  80.     RREADY = (myHero:CanUseSpell(_R) == READY)
  81. end
  82.  
  83. --> Main Load
  84. function mainLoad()
  85.     AutoCarry.SkillsCrosshair.range = 900
  86.     QREADY, WREADY, EREADY, RREADY = false, false, false, false
  87.     wRange, eRange = 860, 700
  88.     SkillE = {spellKey = _E, range = eRange, speed = 1.6, delay = 225, width = 160}
  89.     Menu = AutoCarry.PluginMenu
  90.     Menu2 = AutoCarry.MainMenu
  91.     towers = {}
  92. end
  93.  
  94. --> Main Menu
  95. function mainMenu()
  96.     Menu:addParam("sep", "-- Cast Options --", SCRIPT_PARAM_INFO, "")
  97.     Menu:addParam("eKS", "Spinning Slash - Kill Steal", SCRIPT_PARAM_ONOFF, true)
  98.     Menu:addParam("autoR", "Undying Rage - Auto Ult", SCRIPT_PARAM_ONOFF, true)
  99.     Menu:addParam("rHealth", "Undying Rage - Min Health(%)", SCRIPT_PARAM_SLICE, 20, 0, 100, 0)
  100.     Menu:addParam("sep1", "-- Ability Options --", SCRIPT_PARAM_INFO, "")
  101.     Menu:addParam("useW", "Use - Mocking Shout", SCRIPT_PARAM_ONOFF, true)
  102.     Menu:addParam("useE", "Use - Spinning Slash", SCRIPT_PARAM_ONOFF, true)
  103. end
Advertisement
Add Comment
Please, Sign In to add comment