Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ported script, will try to avoid trynd W and cassio stun (not 100%)
- require 'Utils'
- local delay = 850
- local lastRightClick = {x = nil, z = nil}
- local lastmyHeroPos = {x = 0, z = 0}
- local move = {x=0,z=0}
- local exist = false
- local moving = false
- local lastmove = 0
- local tickHeroPos = 0
- local forcemove = false
- for i=1, objManager:GetMaxHeroes() do
- local enemy = objManager:GetHero(i)
- if enemy.team ~= myHero.team and (enemy.name == "Tryndamere" or enemy.name == "Cassiopeia") then
- exist = true
- end
- end
- function OnProcessSpell(object,spell)
- if not exist then return end
- local spellName = spell.name
- if object and object.team ~= myHero.team then
- if spellName == "CassiopeiaPetrifyingGaze" and GetDistance(object) <= 750 then
- local dist = GetDistance(object)
- move = {x=myHero.x+((object.x-myHero.x)*(-100)/dist),z=myHero.z+((object.z-myHero.z)*(-100)/dist)}
- _MoveToXYZ(move.x,0,move.z)
- moving = true
- lastmove = GetTickCount()
- elseif spellName == "MockingShout" and GetDistance(object) <= 850 then
- local dist = GetDistance(object)
- move = {x=myHero.x+((object.x-myHero.x)*(100)/dist),z=myHero.z+((object.z-myHero.z)*(100)/dist)}
- _MoveToXYZ(move.x,0,move.z)
- moving = true
- lastmove = GetTickCount()
- end
- end
- end
- function OnWndMsg(msg,key)
- if not exist then return end
- if msg == WM_RBUTTONDOWN then
- lastRightClick.x,lastRightClick.z = mousePos.x,mousePos.z
- if forcemove and moving then
- _MoveToXYZ(move.x,0,move.z)
- end
- end
- end
- function OnTick()
- if not exist then return end
- if GetTickCount()-lastmove>=delay and moving and lastRightClick.x then
- _MoveToXYZ(lastRightClick.x,0, lastRightClick.z)
- moving = false
- end
- if lastRightClick.x and not moving then
- if math.abs(myHero.x-lastRightClick.x) <= 75 and math.abs(myHero.z-lastRightClick.z) <= 75 then
- --If myHero has reached last right clicked position.
- lastRightClick.x = nil
- lastRightClick.z = nil
- end
- tickHeroPos = tickHeroPos+1
- if tickHeroPos>=100 then
- if lastmyHeroPos.x == myHero.x and lastmyHeroPos.z == myHero.z then
- --If myHero has not moved since the last 100 tick.
- lastRightClick.x = nil
- lastRightClick.z = nil
- end
- lastmyHeroPos.x = myHero.x
- lastmyHeroPos.z = myHero.z
- tickHeroPos = 0
- end
- end
- end
- SetTimerCallback("OnTick")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement