Advertisement
H3stia

MeleeLastHit.lua

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