16HeX16

Last Hit 1.1

Mar 30th, 2013
1,188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.61 KB | None | 0 0
  1. --[[    Last Hit 1.1 by HeX ]]--
  2.  
  3. local player = GetMyHero()
  4. local bRange = 75
  5. --[[    Waits   ]]--
  6. local nextTick = 0
  7. local waitDelay = 400
  8. --[[    Extra Damage    ]]--
  9. local MaladyDmg = 0
  10.    
  11. function OnLoad()
  12.     PrintChat("<font color='#CCCCCC'> >> Last Hit 1.1 loaded! <<</font>")
  13.     MLConfig = scriptConfig("Last Hit", "LastHit")
  14.     MLConfig:addParam("lasthit", "Last Hit for me", SCRIPT_PARAM_ONKEYDOWN, false, 65)
  15.     MLConfig:addParam("spellsword", "Have Spellsword", SCRIPT_PARAM_ONOFF, false)
  16.     MLConfig:addParam("mousemoving", "Move to mouse", SCRIPT_PARAM_ONOFF, true)
  17.     MLConfig:permaShow("lasthit")
  18.    
  19.     enemyMinions = minionManager(MINION_ENEMY, 600, player, MINION_SORT_HEALTH_ASC)
  20. end
  21.  
  22. function getExtraDmg()
  23.     ExtraDmg = 0
  24.     if GetInventoryHaveItem(3091, player) == true then
  25.         ExtraDmg = ExtraDmg + 42
  26.     end
  27.     if MLConfig.spellsword then
  28.         ExtraDmg = ExtraDmg + (player.ap*0.1)
  29.     end
  30.     if GetInventoryHaveItem(3114, player) == true then
  31.         maladyDmg = 15+(player.ap*0.1)
  32.         ExtraDmg = ExtraDmg + maladyDmg
  33.     end
  34.     return ExtraDmg
  35. end
  36.  
  37. function OnTick()
  38.     enemyMinions:update()
  39.     getExtraDmg()
  40.    
  41.   if MLConfig.lasthit then  
  42.         if MLConfig.mousemoving and GetTickCount() > nextTick then
  43.             player:MoveTo(mousePos.x, mousePos.z)
  44.         end
  45.         for index, minion in pairs(enemyMinions.objects) do
  46.             if GetDistance(minion, myHero) <= (myHero.range+75) and GetTickCount() > nextTick + waitDelay then
  47.                 local aDmg = getDmg("AD",minion, myHero)
  48.                 local bDmg = myHero:CalcMagicDamage(minion, ExtraDmg)
  49.                 if (aDmg+bDmg)>minion.health then
  50.                     myHero:Attack(minion)
  51.                     nextTick = GetTickCount()
  52.                 end
  53.             end
  54.         end
  55.     end
  56. end
Advertisement
Add Comment
Please, Sign In to add comment