Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'Utils'
- local version = '2.0'
- function Sprediction(spell,unit,delay,range,speed,from,block,radius)
- local x, y, z = GetFireahead(unit,5,0)
- local ms = unit.movespeed
- local speed=speed
- local from = from or Vector(myHero)
- local CastPosition = unit.x, unit.y, unit.z
- local Position = myHero.x,myHero.y,myHero.z
- local delay = delay or (GetDistance(from, unit) / speed)
- local velocity = (Position + (((speed * speed + speed) * ms) / 2) - CastPosition) * -1 / ms
- local targetposition = Position + (ms * velocity) + ((( ms * ms + ms) * delay) / 2)
- local FX,FY,FZ = GetFireahead(unit,delay,speed)
- if unit~= nil and block == 0 and targetposition>range then
- CastSpellXYZ(spell,FX,FY,FZ)
- end
- if unit~= nil and targetposition>range and block == 1 and CreepBlock(GetFireahead(unit,delay,speed)) == 0 then
- CastSpellXYZ(spell,FX,FY,FZ)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment