sociophobia

Jinx

Jul 30th, 2015
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. require('Inspired')
  2.  
  3.  
  4. local enemyBasePos, delay, missileSpeed, damage, recallPos = nil, 0, 0, nil, nil
  5. BaseUltConfig = scriptConfig("BaseUlt", "BaseUlt")
  6. BaseUltConfig.addParam("doIt", "Do BaseUlt", SCRIPT_PARAM_ONOFF, true)
  7. myHero = GetMyHero()
  8.  
  9. local delay = 600
  10. local missileSpeed = 2300
  11. local damage = function(target) return CalcDamage(myHero, target, (GetMaxHP(target)-GetCurrentHP(target))*(0.2+0.05*GetCastLevel(myHero, _R)) + 150 + 100*GetCastLevel(myHero,_R) + GetBonusDmg(myHero))
  12.  
  13. if GetTeam(myHero) == 100 then
  14. enemyBasePos = Vector(14340, 171, 14390)
  15. elseif GetTeam(myHero) == 200 then
  16. enemyBasePos = Vector(400, 200, 400)
  17. end
  18.  
  19. --codestarthere
  20.  
  21. OnLoop(function(myHero)
  22. baseult()
  23. if KeyIsDown(0x20) then
  24. combo()
  25. end
  26. end)
  27.  
  28. function move()
  29. mousePos=GetMousePos()
  30. MoveToXYZ(mousePos.x, mousePos.y, mousePos.z)
  31. end
  32.  
  33. function attack()
  34. unit=GetCurrentTarget()
  35. AttackUnit(unit)
  36. end
  37.  
  38. function combo()
  39. DelayAction(function() move() end, 700)
  40. DelayAction(function() attack() end, 700)
  41. end
  42.  
  43.  
  44. --baseult
  45. function baseult()
  46. if CanUseSpell(myHero, _R) == READY and BaseUltConfig.doIt and GetTeam(Object) ~= GetTeam(myHero) then
  47. if damage(Object) > GetCurrentHP(Object) then
  48. local timeToRecall = recallProc.totalTime
  49. local distance = GetDistance(enemyBasePos)
  50. local timeToHit = delay + (distance * 1000 / missileSpeed)
  51. if timeToRecall > timeToHit then
  52. recallPos = Vector(Object)
  53. print("BaseUlt on "..GetObjectName(Object), 2, 0xffff0000)
  54. DelayAction(
  55. function()
  56. if recallPos == Vector(Object) then
  57. CastSkillShot(_R, enemyBasePos.x, enemyBasePos.y, enemyBasePos.z)
  58. recallPos = nil
  59. end
  60. end,
  61. timeToRecall-timeToHit
  62. )
  63. end
  64. end
  65. end
  66. end
Advertisement
Add Comment
Please, Sign In to add comment