Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'Utils'
- require 'winapi'
- require 'vals_lib'
- local Q,W,E,R = 'Q','W','E','R'
- local startVector = Vector(myHero.x,myHero.y,myHero.z)
- local endVector = Vector(GetLastOrder())
- local directionVector = (endVector-startVector):normalized()
- local radius = 1
- local theta=0
- local tooLow = 15
- local Counter = {}
- local count = 10
- function main()
- GetCD()
- local percent = ((myHero.health / myHero.maxHealth)*100)
- target = GetWeakEnemy('MAGIC',990)
- if target ~= nil then
- if percent >= tooLow then
- castQ(target)
- end
- end
- end
- function castQ(target)
- if target ~= nil then
- local FX,FY,FZ = GetFireahead(target,2,0)
- Qdelay = 2
- Qspeed = 0
- radius = 50
- startVector = Vector(myHero.x,myHero.y,myHero.z)
- endVector = Vector(FX,FY,FZ)
- directionVector = (endVector-startVector):normalized()
- local theta = math.deg(math.atan(directionVector.z / directionVector.x))
- if distXYZ(target.x,target.z,FX,FZ)<((target.movespeed/1000)*(((Qdelay*100)+100)+(Qspeed*10)))/0.20 and directionVector.x < radius and directionVector.z <radius then
- table.insert(Counter, target)
- end
- if target==nil then
- for i,v in pairs(Counter) do Counter[i] = nil end
- end
- if #Counter~=0 and #Counter>count then SpellPred(Q,QRDY,myHero,target,1000,2,0,1,100)
- end
- end
- end
- SetTimerCallback('main')
Advertisement
Add Comment
Please, Sign In to add comment