Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. for i = 1, Game.MissileCount() do
  2. local obj = Game.Missile(i)
  3. if obj then
  4. local castp = obj.missileData.endPos
  5. --print(walllist)
  6. local target = obj.missileData.startPos
  7.  
  8. if target and table.contains(walllist, obj.missileData.name:lower()) and Game.CanUseSpell(1) == 0 and isOnSegment and (GetDistanceSqr(castp, linesegment) <= 300 * 300)then --
  9. local target2 = GetHeroByHandle(obj.missileData.owner)
  10. if Saga.Wset.UseW[obj.missileData.name:lower()]:Value() then
  11. local linesegment, line, isOnSegment = VectorPointProjectionOnLineSegment(myHero.pos, target, castp)
  12. if SagaOrb == 4 then
  13. __gsoSpell:CastSpell(HK_W, target2)
  14. else
  15. if target2.visible then
  16. Control.SetCursorPos(target2)
  17. Control.CastSpell(HK_W, target2)
  18. else
  19. Control.SetCursorPos(target)
  20. Control.CastSpell(HK_W, target)
  21. end
  22. end
  23.  
  24. end
  25. end
  26. if target and table.contains(walllist, obj.missileData.name:lower()) and Game.CanUseSpell(1) == 0 and GetDistance(castp, target) > GetDistance(target) then --
  27. local target2 = GetHeroByHandle(obj.missileData.owner)
  28. if Saga.Wset.UseW[obj.missileData.name:lower()]:Value() then
  29. local linesegment2, line2, isOnSegment2 = VectorPointProjectionOnLineSegment(castp, target, myHero.pos)
  30. if isOnSegment2 and (GetDistanceSqr(myHero.pos, linesegment2) <= 300 * 300) then
  31. if SagaOrb == 4 then
  32. __gsoSpell:CastSpell(HK_W, obj.missileData.startPos)
  33. else
  34. if target2.visible then
  35. Control.SetCursorPos(target2)
  36. Control.CastSpell(HK_W, target2)
  37. else
  38. Control.SetCursorPos(target)
  39. Control.CastSpell(HK_W, target)
  40. end
  41. end
  42. end
  43. end
  44. end
  45. end
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement