Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require('Inspired')
- local enemyBasePos, delay, missileSpeed, damage, recallPos = nil, 0, 0, nil, nil
- BaseUltConfig = scriptConfig("BaseUlt", "BaseUlt")
- BaseUltConfig.addParam("doIt", "Do BaseUlt", SCRIPT_PARAM_ONOFF, true)
- myHero = GetMyHero()
- local delay = 600
- local missileSpeed = 2300
- 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))
- if GetTeam(myHero) == 100 then
- enemyBasePos = Vector(14340, 171, 14390)
- elseif GetTeam(myHero) == 200 then
- enemyBasePos = Vector(400, 200, 400)
- end
- --codestarthere
- OnLoop(function(myHero)
- baseult()
- if KeyIsDown(0x20) then
- combo()
- end
- end)
- function move()
- mousePos=GetMousePos()
- MoveToXYZ(mousePos.x, mousePos.y, mousePos.z)
- end
- function attack()
- unit=GetCurrentTarget()
- AttackUnit(unit)
- end
- function combo()
- DelayAction(function() move() end, 700)
- DelayAction(function() attack() end, 700)
- end
- --baseult
- function baseult()
- if CanUseSpell(myHero, _R) == READY and BaseUltConfig.doIt and GetTeam(Object) ~= GetTeam(myHero) then
- if damage(Object) > GetCurrentHP(Object) then
- local timeToRecall = recallProc.totalTime
- local distance = GetDistance(enemyBasePos)
- local timeToHit = delay + (distance * 1000 / missileSpeed)
- if timeToRecall > timeToHit then
- recallPos = Vector(Object)
- print("BaseUlt on "..GetObjectName(Object), 2, 0xffff0000)
- DelayAction(
- function()
- if recallPos == Vector(Object) then
- CastSkillShot(_R, enemyBasePos.x, enemyBasePos.y, enemyBasePos.z)
- recallPos = nil
- end
- end,
- timeToRecall-timeToHit
- )
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment