Guest User

Untitled

a guest
Dec 16th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.62 KB | None | 0 0
  1. --[[        LastHitter v1.75 by DeniCevap!
  2.            
  3.             Press X to disable/enable the lasthitter!
  4.             Press Z to harass!
  5.            
  6.             In chat:
  7.             .elast ( enable lasthitter )
  8.             .dlast ( disable lasthitter )
  9.             .circleon ( draws circles and hp )
  10.             .circleoff ( disable circles and hp )
  11.            
  12.             Fixed bugs: All of them, just run the script :)
  13.        
  14.             New Features:
  15.             TRUS gave me some thing to put into the code, thanks!
  16.             Sion's Q
  17.             Harassing/Blood mode = Z key, forces spell use on the enemy to reduce his hp for a Ally to swoop in and take the kill.
  18.            
  19.             Howto add new champions, put this into the infoTable table.
  20.             {name="Name of course.", range = range of script, spell = _(Spell goes here, yes the _ should be there), getDMGfrom = "(Spell without _ here)"},
  21. --]]
  22.  
  23. do
  24. spellText = {"Q","W","E","R"}
  25. infoTable = {
  26.     {name="Ashe", range = 1100, spell = _W, castTarget = false},
  27.     {name="Akali", range = 600, spell = _Q, castTarget = true},
  28.     {name="Alistar", range = 650, spell = _W, castTarget = true},
  29.     {name="Anivia", range = 650, spell = _E, castTarget = true},
  30.     {name="Annie", range = 625, spell = _Q, castTarget = true},
  31.     {name="Brand", range = 625, spell = _E, castTarget = true},
  32.     {name="Caitlyn", range = 1200, spell = _Q, castTarget = false},
  33.     {name="Cassiopeia",range = 700, spell = _E, castTarget = true},
  34.     {name="Chogath",range = 150, spell = _R, castTarget = true},
  35.     {name="Darius",range = 475, spell = _R, castTarget = true},
  36.     {name="Diana",range = 900, spell = _R, castTarget = true},
  37.     {name="Evelynn",range = 325, spell = _E, castTarget = true},
  38.     {name="Fiddlesticks",range = 750, spell = _E, castTarget = true},
  39.     {name="Gangplank",range = 625, spell = _Q, castTarget = true},
  40.     {name="Kassadin",range = 650,spell = _Q, castTarget = true},
  41.     {name="Katarina", range = 700, spell = _E, castTarget = true},
  42.     {name="Kayle",range = 650, spell = _Q, castTarget = true},
  43.     {name="MasterYi",range = 600, spell = _Q, castTarget = true},
  44.     {name="Miss Fortune",range = 550, spell = _Q, castTarget = true},
  45.     {name="Nunu",range = 550, spell = _E, castTarget = true},
  46.     {name="Irelia",range = 650, spell = _Q, castTarget = false},
  47.     {name="Taric", range = 625, spell = _E, castTarget = true},
  48.     {name="Teemo", range = 590, spell = _Q, castTarget = true},
  49.     {name="Tristana",range = 700, spell = _R, castTarget = true},
  50.     {name="Twitch",range = 1200, spell = _E, castTarget = true},
  51.     {name="Ryze",range = 625, spell = _W, castTarget = true},
  52.     {name="Soraka",range = 725, spell = _E, castTarget = true},
  53.     {name="Shaco",range = 625, spell = _E, castTarget = true},
  54.     {name="Sivir",range = 1000, spell = _Q, castTarget = false},
  55.     {name="Sion",range = 550, spell = _Q, castTarget = true},
  56.     {name="Veigar",range = 650, spell = _Q, castTarget = true},
  57.     {name="Volibear",range = 400, sell = _W, castTarget = true},
  58.     {name="Viktor",range = 600, spell = _Q, castTarget = true},
  59.     {name="Vladimir",range = 600, spell = _Q, castTarget = true},
  60.     {name="Warwick",range = 400, spell = _Q, castTarget = true},
  61.     {name="XinZhao",range = 600, spell = _E, castTarget = true},
  62.    
  63. }
  64. for i,info in pairs(infoTable) do
  65.     if player.charName ~= info.name then table.remove(infoTable, i) end
  66. end
  67.  
  68. if #infoTable == 0 then PrintChat(" » "..player.charName.." is not supported") return end
  69.  
  70. local ToggleHK = string.byte("X")  -- X
  71. local harassHK = string.byte("Z")  -- Z
  72. local active = true
  73. local harass = false
  74. local player = GetMyHero()
  75. local drawcircles = true
  76. local ts
  77.  
  78. function OnLoad()
  79.     ts = TargetSelector(TARGET_LOW_HP,0,DAMAGE_MAGIC)
  80.     for i,info in pairs(infoTable) do
  81.         if ts.range < info.range then ts.range = info.range end
  82.     end
  83.     PrintChat(" » LastHitter is "..player.charName..".")
  84. end
  85.  
  86.  
  87. function OnTick()
  88.     ts:update()
  89.     if active then
  90.         for i,info in pairs(infoTable) do
  91.             if player:CanUseSpell(info.spell) == READY and ValidTarget(ts, info.range) then
  92.                 local Dmg = getDmg(spellText(info.spell + 1 - _Q)),ts.target,player)
  93.                 if ts.target.health < Dmg then
  94.                     PrintFloatText(ts.target,10,"DIE!!!")
  95.                     if info.castTarget then
  96.                         CastSpell(info.spell,ts.target)
  97.                     else
  98.                         CastSpell(info.spell,ts.target.x,ts.target.z)
  99.                     end
  100.                 end
  101.             else
  102.                 PrintFloatText(ts.target,0,"" .. math.ceil(ts.target.health - (Dmg)) .. " hp")
  103.             end
  104.         end
  105.     end
  106.     if harass then
  107.         for i,info in pairs(infoTable) do
  108.             if player:CanUseSpell(info.spell) == READY and ValidTarget(ts.target, info.range) then
  109.                 if info.castTarget then
  110.                     CastSpell(info.spell,ts.target)
  111.                 else
  112.                     CastSpell(info.spell,ts.target.x,ts.target.z)
  113.                 end
  114.             end
  115.         end
  116.     end
  117. end
  118.  
  119. function OnDraw()
  120.     if drawcircles and not player.dead then
  121.         DrawCircle(player.x, player.y, player.z, ts.range, 0x19A712)
  122.         if ts.target ~= nil then
  123.             for j=0, 15 do
  124.                 DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  125.             end
  126.         end
  127.     end
  128. end
  129.  
  130. function OnSendChat(text)
  131.     if text == ".elast" then
  132.         BlockChat()
  133.         active = true
  134.         PrintChat(">> LastHitter enabled")
  135.     elseif text == ".dlast" then
  136.         BlockChat()
  137.         active = false
  138.         PrintChat(">> LastHitter disabled")
  139.     elseif text == ".circleoff" then
  140.         BlockChat()
  141.         drawcircles = false
  142.         PrintChat(">> Drawing Circles and HP off!")
  143.     elseif text == ".circleon" then
  144.         BlockChat()
  145.         drawcircles = true
  146.         PrintChat(">> Drawing Cricles and HP on!")
  147.     end
  148. end
  149.  
  150. function OnWndMsg(msg,key)
  151.     if msg == KEY_DOWN then
  152.         if key == ToggleHK then
  153.             if active then
  154.                 active = false
  155.                 PrintChat(">> LastHitter disabled")
  156.             else
  157.                 active = true
  158.                 PrintChat(">> LastHitter enabled")
  159.             end
  160.         end
  161.     end
  162.     if key == harassHK then
  163.         harass = (msg == KEY_DOWN)
  164.     end
  165. end
  166. end
Add Comment
Please, Sign In to add comment