Guest User

Freaking Good Evade

a guest
Apr 8th, 2014
1,349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 120.08 KB | None | 0 0
  1. local version = "5"
  2.  
  3. require "old2dgeo"
  4.  
  5. class 'CollisionPE'
  6. HERO_ALL = 1
  7. HERO_ENEMY = 2
  8. HERO_ALLY = 3
  9.  
  10.  
  11. function CollisionPE:__init(sRange, projSpeed, sDelay, sWidth)
  12.     uniqueId = uniqueId + 1
  13.     self.uniqueId = uniqueId
  14.    
  15.     self.sRange = sRange
  16.     self.projSpeed = projSpeed
  17.     self.sDelay = sDelay
  18.     self.sWidth = sWidth/2
  19.    
  20.     self.enemyMinions = minionManager(MINION_ALLY, 2000, myHero, MINION_SORT_HEALTH_ASC)
  21.     self.minionupdate = 0
  22. end
  23.  
  24. function CollisionPE:GetMinionCollision(pStart, pEnd)
  25.     self.enemyMinions:update()
  26.    
  27.     local distance =  GetDistance(pStart, pEnd)
  28.     local prediction = TargetPredictionVIP(self.sRange, self.projSpeed, self.sDelay, self.sWidth)
  29.     local mCollision = {}
  30.    
  31.     if distance > self.sRange then
  32.         distance = self.sRange
  33.     end
  34.    
  35.     local V = Vector(pEnd) - Vector(pStart)
  36.     local k = V:normalized()
  37.     local P = V:perpendicular2():normalized()
  38.    
  39.     local t,i,u = k:unpack()
  40.     local x,y,z = P:unpack()
  41.    
  42.     local startLeftX = pStart.x + (x *self.sWidth)
  43.     local startLeftY = pStart.y + (y *self.sWidth)
  44.     local startLeftZ = pStart.z + (z *self.sWidth)
  45.     local endLeftX = pStart.x + (x * self.sWidth) + (t * distance)
  46.     local endLeftY = pStart.y + (y * self.sWidth) + (i * distance)
  47.     local endLeftZ = pStart.z + (z * self.sWidth) + (u * distance)
  48.    
  49.     local startRightX = pStart.x - (x * self.sWidth)
  50.     local startRightY = pStart.y - (y * self.sWidth)
  51.     local startRightZ = pStart.z - (z * self.sWidth)
  52.     local endRightX = pStart.x - (x * self.sWidth) + (t * distance)
  53.     local endRightY = pStart.y - (y * self.sWidth) + (i * distance)
  54.     local endRightZ = pStart.z - (z * self.sWidth)+ (u * distance)
  55.    
  56.     local startLeft = WorldToScreen(D3DXVECTOR3(startLeftX, startLeftY, startLeftZ))
  57.     local endLeft = WorldToScreen(D3DXVECTOR3(endLeftX, endLeftY, endLeftZ))
  58.     local startRight = WorldToScreen(D3DXVECTOR3(startRightX, startRightY, startRightZ))
  59.     local endRight = WorldToScreen(D3DXVECTOR3(endRightX, endRightY, endRightZ))
  60.    
  61.     local poly = Polygon(Point(startLeft.x, startLeft.y),  Point(endLeft.x, endLeft.y), Point(startRight.x, startRight.y),   Point(endRight.x, endRight.y))
  62.    
  63.     for index, minion in pairs(self.enemyMinions.objects) do
  64.         if minion ~= nil and minion.valid and not minion.dead then
  65.             if GetDistance(pStart, minion) < distance then
  66.                 local pos, t, vec = prediction:GetPrediction(minion)
  67.                 local lineSegmentLeft = LineSegment(Point(startLeftX,startLeftZ), Point(endLeftX, endLeftZ))
  68.                 local lineSegmentRight = LineSegment(Point(startRightX,startRightZ), Point(endRightX, endRightZ))
  69.                 local toScreen, toPoint
  70.                 if pos ~= nil then
  71.                     toScreen = WorldToScreen(D3DXVECTOR3(minion.x, minion.y, minion.z))
  72.                     toPoint = Point(toScreen.x, toScreen.y)
  73.                 else
  74.                     toScreen = WorldToScreen(D3DXVECTOR3(minion.x, minion.y, minion.z))
  75.                     toPoint = Point(toScreen.x, toScreen.y)
  76.                 end
  77.                
  78.                
  79.                 if poly:contains(toPoint) then
  80.                     table.insert(mCollision, minion)
  81.                 else
  82.                     if pos ~= nil then
  83.                         distance1 = Point(pos.x, pos.z):distance(lineSegmentLeft)
  84.                         distance2 = Point(pos.x, pos.z):distance(lineSegmentRight)
  85.                     else
  86.                         distance1 = Point(minion.x, minion.z):distance(lineSegmentLeft)
  87.                         distance2 = Point(minion.x, minion.z):distance(lineSegmentRight)
  88.                     end
  89.                     if (distance1 < (getHitBoxRadius(minion)*2+10) or distance2 < (getHitBoxRadius(minion) *2+10)) then
  90.                         table.insert(mCollision, minion)
  91.                     end
  92.                 end
  93.             end
  94.         end
  95.     end
  96.     if #mCollision > 0 then return true, mCollision else return false, mCollision end
  97. end
  98.  
  99. function CollisionPE:GetHeroCollision(pStart, pEnd, mode)
  100.     if mode == nil then mode = HERO_ENEMY end
  101.     local heros = {}
  102.    
  103.     for i = 1, heroManager.iCount do
  104.         local hero = heroManager:GetHero(i)
  105.         if (mode == HERO_ENEMY or mode == HERO_ALL) and hero.team ~= myHero.team then
  106.             table.insert(heros, hero)
  107.             elseif (mode == HERO_ALLY or mode == HERO_ALL) and hero.team == myHero.team and not hero.isMe then
  108.             table.insert(heros, hero)
  109.         end
  110.     end
  111.    
  112.     local distance =  GetDistance(pStart, pEnd)
  113.     local prediction = TargetPredictionVIP(self.sRange, self.projSpeed, self.sDelay, self.sWidth)
  114.     local hCollision = {}
  115.    
  116.     if distance > self.sRange then
  117.         distance = self.sRange
  118.     end
  119.    
  120.     local V = Vector(pEnd) - Vector(pStart)
  121.     local k = V:normalized()
  122.     local P = V:perpendicular2():normalized()
  123.    
  124.     local t,i,u = k:unpack()
  125.     local x,y,z = P:unpack()
  126.    
  127.     local startLeftX = pStart.x + (x *self.sWidth)
  128.     local startLeftY = pStart.y + (y *self.sWidth)
  129.     local startLeftZ = pStart.z + (z *self.sWidth)
  130.     local endLeftX = pStart.x + (x * self.sWidth) + (t * distance)
  131.     local endLeftY = pStart.y + (y * self.sWidth) + (i * distance)
  132.     local endLeftZ = pStart.z + (z * self.sWidth) + (u * distance)
  133.    
  134.     local startRightX = pStart.x - (x * self.sWidth)
  135.     local startRightY = pStart.y - (y * self.sWidth)
  136.     local startRightZ = pStart.z - (z * self.sWidth)
  137.     local endRightX = pStart.x - (x * self.sWidth) + (t * distance)
  138.     local endRightY = pStart.y - (y * self.sWidth) + (i * distance)
  139.     local endRightZ = pStart.z - (z * self.sWidth)+ (u * distance)
  140.    
  141.     local startLeft = WorldToScreen(D3DXVECTOR3(startLeftX, startLeftY, startLeftZ))
  142.     local endLeft = WorldToScreen(D3DXVECTOR3(endLeftX, endLeftY, endLeftZ))
  143.     local startRight = WorldToScreen(D3DXVECTOR3(startRightX, startRightY, startRightZ))
  144.     local endRight = WorldToScreen(D3DXVECTOR3(endRightX, endRightY, endRightZ))
  145.    
  146.     local poly = Polygon(Point(startLeft.x, startLeft.y),  Point(endLeft.x, endLeft.y), Point(startRight.x, startRight.y),   Point(endRight.x, endRight.y))
  147.    
  148.     for index, hero in pairs(heros) do
  149.         if hero ~= nil and hero.valid and not hero.dead then
  150.             if GetDistance(pStart, hero) < distance then
  151.                 local pos, t, vec = prediction:GetPrediction(hero)
  152.                 local lineSegmentLeft = LineSegment(Point(startLeftX,startLeftZ), Point(endLeftX, endLeftZ))
  153.                 local lineSegmentRight = LineSegment(Point(startRightX,startRightZ), Point(endRightX, endRightZ))
  154.                 local toScreen, toPoint
  155.                 if pos ~= nil then
  156.                     toScreen = WorldToScreen(D3DXVECTOR3(pos.x, hero.y, pos.z))
  157.                     toPoint = Point(toScreen.x, toScreen.y)
  158.                 else
  159.                     toScreen = WorldToScreen(D3DXVECTOR3(hero.x, hero.y, hero.z))
  160.                     toPoint = Point(toScreen.x, toScreen.y)
  161.                 end
  162.                
  163.                
  164.                 if poly:contains(toPoint) then
  165.                     table.insert(hCollision, hero)
  166.                 else
  167.                     if pos ~= nil then
  168.                         distance1 = Point(pos.x, pos.z):distance(lineSegmentLeft)
  169.                         distance2 = Point(pos.x, pos.z):distance(lineSegmentRight)
  170.                     else
  171.                         distance1 = Point(hero.x, hero.z):distance(lineSegmentLeft)
  172.                         distance2 = Point(hero.x, hero.z):distance(lineSegmentRight)
  173.                     end
  174.                     if (distance1 < (getHitBoxRadius(hero)*2+10) or distance2 < (getHitBoxRadius(hero) *2+10)) then
  175.                         table.insert(hCollision, hero)
  176.                     end
  177.                 end
  178.             end
  179.         end
  180.     end
  181.     if #hCollision > 0 then return true, hCollision else return false, hCollision end
  182. end
  183.  
  184. function CollisionPE:GetCollision(pStart, pEnd)
  185.     local b , minions = self:GetMinionCollision(pStart, pEnd)
  186.     local t , heros = self:GetHeroCollision(pStart, pEnd, HERO_ENEMY)
  187.    
  188.     if not b then return t, heros end
  189.     if not t then return b, minions end
  190.    
  191.     local all = {}
  192.    
  193.     for index, hero in pairs(heros) do
  194.         table.insert(all, hero)
  195.     end
  196.    
  197.     for index, minion in pairs(minions) do
  198.         table.insert(all, minion)
  199.     end
  200.    
  201.     return true, all
  202. end
  203.  
  204.  
  205. function getHitBoxRadius(target)
  206.     return GetDistance(target, target.minBBox)/2
  207. end
  208.  
  209. _G.evade = false
  210. moveBuffer = 25
  211. smoothing = 75
  212. dashrange = 0
  213.  
  214.  
  215. champions = {}
  216. champions2 = {
  217. ["Lux"] = {charName = "Lux", skillshots = {
  218. ["Light Binding"] =  {name = "LightBinding", spellName = "LuxLightBinding", spellDelay = 250, projectileName = "LuxLightBinding_mis.troy", projectileSpeed = 1200, range = 1300, radius = 80, type = "line", cc = "true", collision = "false", shieldnow = "true"},
  219. ["Lux LightStrike Kugel"] = {name = "LuxLightStrikeKugel", spellName = "LuxLightStrikeKugel", spellDelay = 250, projectileName = "LuxLightstrike_mis.troy", projectileSpeed = 1400, range = 1100, radius = 275, type = "circle", cc = "false", collision = "false", shieldnow = "false"},
  220. ["Lux Malice Cannon"] =  {name = "LuxMaliceCannon", spellName = "LuxMaliceCannon", spellDelay = 1375, projectileName = "LuxMaliceCannon_cas.troy", projectileSpeed = 50000, range = 3500, radius = 190, type = "line", cc = "true", collision = "false", shieldnow = "true"},
  221. }},
  222. ["Nidalee"] = {charName = "Nidalee", skillshots = {
  223. ["Javelin Toss"] = {name = "JavelinToss", spellName = "JavelinToss", spellDelay = 125, projectileName = "nidalee_javelinToss_mis.troy", projectileSpeed = 1300, range = 1500, radius = 60, type = "line", cc = "true", collision = "true", shieldnow = "true"}
  224. }},
  225. ["Kennen"] = {charName = "Kennen", skillshots = {
  226. ["Thundering Shuriken"] = {name = "ThunderingShuriken", spellName = "KennenShurikenHurlMissile1", spellDelay = 180, projectileName = "kennen_ts_mis.troy", projectileSpeed = 1700, range = 1050, radius = 50, type = "line", cc = "false", collision = "true", shieldnow = "true"}
  227. }},
  228. ["Amumu"] = {charName = "Amumu", skillshots = {
  229. ["Bandage Toss"] = {name = "BandageToss", spellName = "BandageToss", spellDelay = 250, projectileName = "Bandage_beam.troy", projectileSpeed = 2000, range = 1100, radius = 80, type = "line", cc = "true", collision = "true", shieldnow = "true"}
  230. }},
  231. ["Lee Sin"] = {charName = "LeeSin", skillshots = {
  232. ["Sonic Wave"] = {name = "SonicWave", spellName = "BlindMonkQOne", spellDelay = 250, projectileName = "blindMonk_Q_mis_01.troy", projectileSpeed = 1800, range = 1100, radius = 70, type = "line", cc = "true", collision = "true", shieldnow = "true"}
  233. }},
  234. ["Morgana"] = {charName = "Morgana", skillshots = {
  235. ["Dark Binding Missile"] = {name = "DarkBinding", spellName = "DarkBindingMissile", spellDelay = 250, projectileName = "DarkBinding_mis.troy", projectileSpeed = 1200, range = 1300, radius = 80, type = "line", cc = "true", collision = "true", shieldnow = "true"},
  236. }},
  237. ["Sejuani"] = {charName = "Sejuani", skillshots = {
  238. ["SejuaniR"] = {name = "SejuaniR", spellName = "SejuaniGlacialPrisonCast", spellDelay = 250, projectileName = "Sejuani_R_mis.troy", projectileSpeed = 1600, range = 1200, radius = 110, type="line", cc = "true", collision = "false", shieldnow = "true"},    
  239. }},
  240. ["Sona"] = {charName = "Sona", skillshots = {
  241. ["Crescendo"] = {name = "Crescendo", spellName = "SonaCrescendo", spellDelay = 240, projectileName = "SonaCrescendo_mis.troy", projectileSpeed = 2400, range = 1000, radius = 160, type = "line", cc = "true", collision = "false", shieldnow = "true"},        
  242. }},
  243. ["Gragas"] = {charName = "Gragas", skillshots = {
  244. ["Barrel Roll"] = {name = "BarrelRoll", spellName = "GragasBarrelRoll", spellDelay = 250, projectileName = "gragas_barrelroll_mis.troy", projectileSpeed = 1000, range = 1115, radius = 180, type = "circle", cc = "false", collision = "false", shieldnow = "false"},
  245. ["Barrel Roll Missile"] = {name = "BarrelRollMissile", spellName = "GragasBarrelRollMissile", spellDelay = 0, projectileName = "gragas_barrelroll_mis.troy", projectileSpeed = 1000, range = 1115, radius = 180, type = "circle", cc = "false", collision = "false", shieldnow = "false"},
  246. }},
  247. ["Syndra"] = {charName = "Syndra", skillshots = {
  248. ["Q"] = {name = "Q", spellName = "SyndraQ", spellDelay = 250, projectileName = "Syndra_Q_fall.troy", projectileSpeed = 500, range = 825, radius = 175, type = "circular", cc = "false", collision = "false", shieldnow = "true"},
  249. ["W"] = {name = "W", spellName = "syndrawcast", spellDelay = 250, projectileName = "Syndra_W_fall.troy", projectileSpeed = 500, range = 950, radius = 200, type = "circular", cc = "false", collision = "false", shieldnow = "true"},
  250. }},
  251. ["Malphite"] = {charName = "Malphite", skillshots = {
  252. ["UFSlash"] = {name = "UFSlash", spellName = "UFSlash", spellDelay = 0, projectileName = "UnstoppableForce_cas.troy", projectileSpeed = 550, range = 1000, radius = 300, type="circular", cc = "true", collision = "false", shieldnow = "true"},    
  253. }},
  254. ["Ezreal"] = {charName = "Ezreal", skillshots = {
  255. ["Mystic Shot"]             = {name = "MysticShot",      spellName = "EzrealMysticShot",      spellDelay = 250, projectileName = "Ezreal_mysticshot_mis.troy",  projectileSpeed = 2000, range = 1200,  radius = 80,  type = "line", cc = "false", collision = "true", shieldnow = "true"},
  256. ["Essence Flux"]            = {name = "EssenceFlux",     spellName = "EzrealEssenceFlux",     spellDelay = 250, projectileName = "Ezreal_essenceflux_mis.troy", projectileSpeed = 1500, range = 1050,  radius = 80,  type = "line", cc = "false", collision = "false", shieldnow = "true"},
  257. ["Mystic Shot (Pulsefire)"] = {name = "MysticShot",      spellName = "EzrealMysticShotPulse", spellDelay = 250, projectileName = "Ezreal_mysticshot_mis.troy",  projectileSpeed = 2000, range = 1200,  radius = 80,  type = "line", cc = "false", collision = "true", shieldnow = "true"},
  258. ["Trueshot Barrage"]        = {name = "TrueshotBarrage", spellName = "EzrealTrueshotBarrage", spellDelay = 1000, projectileName = "Ezreal_TrueShot_mis.troy",    projectileSpeed = 2000, range = 20000, radius = 160, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  259. }},
  260. ["Ahri"] = {charName = "Ahri", skillshots = {
  261. ["Orb of Deception"] = {name = "OrbofDeception", spellName = "AhriOrbofDeception", spellDelay = 250, projectileName = "Ahri_Orb_mis.troy", projectileSpeed = 2500, range = 900, radius = 100, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  262. ["Orb of Deception Back"] = {name = "OrbofDeceptionBack", spellName = "AhriOrbofDeceptionherpityderp", spellDelay = 250+360, projectileName = "Ahri_Orb_mis_02.troy", projectileSpeed = 915, range = 900, radius = 100, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  263. ["Charm"] = {name = "Charm", spellName = "AhriSeduce", spellDelay = 250, projectileName = "Ahri_Charm_mis.troy", projectileSpeed = 1000, range = 1000, radius = 60, type = "line", cc = "true", collision = "true", shieldnow = "true"}
  264. }},
  265. ["Olaf"] = {charName = "Olaf", skillshots = {
  266. ["Undertow"] = {name = "Undertow", spellName = "OlafAxeThrow", spellDelay = 250, projectileName = "olaf_axe_mis.troy", projectileSpeed = 1600, range = 1000, radius = 90, type = "line", cc = "true", collision = "false", shieldnow = "true"}
  267. }},
  268. ["Leona"] = {charName = "Leona", skillshots = {
  269. ["Zenith Blade"] = {name = "LeonaZenithBlade", spellName = "LeonaZenithBlade", spellDelay = 250, projectileName = "Leona_ZenithBlade_mis.troy", projectileSpeed = 2000, range = 950, radius = 110, type = "line", cc = "true", collision = "false", shieldnow = "true"},
  270. ["Leona Solar Flare"] = {name = "LeonaSolarFlare", spellName = "LeonaSolarFlare", spellDelay = 250, projectileName = "Leona_SolarFlare_cas.troy", projectileSpeed = 1500, range = 1200, radius = 300, type = "circular", cc = "true", collision = "false", shieldnow = "true"}
  271. }},
  272. ["Karthus"] = {charName = "Karthus", skillshots = {
  273. ["Lay Waste"] = {name = "LayWaste", spellName = "LayWaste", spellDelay = 250, projectileName = "LayWaste_point.troy", projectileSpeed = 1750, range = 875, radius = 140, type = "circular", cc = "false", collision = "false", shieldnow = "true"}
  274. }},
  275. ["Chogath"] = {charName = "Chogath", skillshots = {
  276. ["Rupture"] = {name = "Rupture", spellName = "Rupture", spellDelay = 0, projectileName = "rupture_cas_01_red_team.troy", projectileSpeed = 950, range = 950, radius = 250, type = "circular", cc = "true", collision = "false", shieldnow = "true"}
  277. }},
  278. ["Blitzcrank"] = {charName = "Blitzcrank", skillshots = {
  279. ["Rocket Grab"] = {name = "RocketGrab", spellName = "RocketGrabMissile", spellDelay = 250, projectileName = "FistGrab_mis.troy", projectileSpeed = 1800, range = 1050, radius = 70, type = "line", cc = "true", collision = "true", shieldnow = "true"},
  280. }},
  281. ["Anivia"] = {charName = "Anivia", skillshots = {
  282. ["Flash Frost"] = {name = "FlashFrost", spellName = "FlashFrostSpell", spellDelay = 250, projectileName = "cryo_FlashFrost_mis.troy", projectileSpeed = 850, range = 1100, radius = 110, type = "line", cc = "true", collision = "false", shieldnow = "true"}
  283. }},
  284. ["Zyra"] = {charName = "Zyra", skillshots = {
  285. ["Grasping Roots"] = {name = "GraspingRoots", spellName = "ZyraGraspingRoots", spellDelay = 250, projectileName = "Zyra_E_sequence_impact.troy", projectileSpeed = 1150, range = 1150, radius = 70,  type = "line", cc = "true", collision = "false", shieldnow = "true"},
  286. ["Zyra Passive Death"] = {name = "ZyraPassive", spellName = "zyrapassivedeathmanager", spellDelay = 500, projectileName = "zyra_passive_plant_mis.troy", projectileSpeed = 2000, range = 1474, radius = 60,  type = "line", cc = "false", collision = "false", shieldnow = "true"},
  287. ["Deadly Bloom"] = {name = "DeadlyBloom", spellName = "ZyraQFissure", spellDelay = 1000, projectileName = "Zyra_Q_cas.troy", projectileSpeed = 0, range = 800, radius = 250, type = "circular", cc = "false", collision = "false", shieldnow = "true"}
  288. }},
  289. ["Nautilus"] = {charName = "Nautilus", skillshots = {
  290. ["Dredge Line"] = {name = "DredgeLine", spellName = "NautilusAnchorDrag", spellDelay = 250, projectileName = "Nautilus_Q_mis.troy", projectileSpeed = 2000, range = 1080, radius = 80, type = "line", cc = "true", collision = "true", shieldnow = "true"},
  291. }},
  292. ["Caitlyn"] = {charName = "Caitlyn", skillshots = {
  293. ["Piltover Peacemaker"] = {name = "PiltoverPeacemaker", spellName = "CaitlynPiltoverPeacemaker", spellDelay = 625, projectileName = "caitlyn_Q_mis.troy", projectileSpeed = 2200, range = 1300, radius = 90, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  294. ["Caitlyn Entrapment"] = {name = "CaitlynEntrapment", spellName = "CaitlynEntrapment", spellDelay = 150, projectileName = "caitlyn_entrapment_mis.troy", projectileSpeed = 2000, range = 950, radius = 80, type = "line", cc = "true", collision = "true", shieldnow = "true"},
  295. }},
  296. ["Mundo"] = {charName = "DrMundo", skillshots = {
  297. ["Infected Cleaver"] = {name = "InfectedCleaver", spellName = "InfectedCleaverMissile", spellDelay = 250, projectileName = "dr_mundo_infected_cleaver_mis.troy", projectileSpeed = 2000, range = 1050, radius = 75, type = "line", cc = "true", collision = "true", shieldnow = "true"},
  298. }},
  299. ["Brand"] = {charName = "Brand", skillshots = {
  300. ["BrandBlaze"] = {name = "BrandBlaze", spellName = "BrandBlaze", spellDelay = 250, projectileName = "BrandBlaze_mis.troy", projectileSpeed = 1600, range = 1100, radius = 80, type = "line", cc = "true", collision = "true", shieldnow = "true"},
  301. ["Pillar of Flame"] = {name = "PillarofFlame", spellName = "BrandFissure", spellDelay = 250, projectileName = "BrandPOF_tar_green.troy", projectileSpeed = 900, range = 1100, radius = 240, type = "circular", cc = "false", collision = "false", shieldnow = "true"}
  302. }},
  303. ["Corki"] = {charName = "Corki", skillshots = {
  304. ["Missile Barrage"] = {name = "MissileBarrage", spellName = "MissileBarrage", spellDelay = 250, projectileName = "corki_MissleBarrage_mis.troy", projectileSpeed = 2000, range = 1300, radius = 40, type = "line", cc = "false", collision = "true", shieldnow = "true"},
  305. ["Missile Barrage big"] = {name = "MissileBarragebig", spellName = "MissileBarrage!", spellDelay = 250, projectileName = "Corki_MissleBarrage_DD_mis.troy", projectileSpeed = 2000, range = 1300, radius = 40, type = "line", cc = "false", collision = "true", shieldnow = "true"}
  306. }},
  307. ["TwistedFate"] = {charName = "TwistedFate", skillshots = {
  308. ["Loaded Dice"] = {name = "LoadedDice", spellName = "WildCards", spellDelay = 250, projectileName = "Roulette_mis.troy", projectileSpeed = 1000, range = 1450, radius = 40, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  309. }},
  310. ["Swain"] = {charName = "Swain", skillshots = {
  311. ["Nevermove"] = {name = "Nevermove", spellName = "SwainShadowGrasp", spellDelay = 250, projectileName = "swain_shadowGrasp_transform.troy", projectileSpeed = 1000, range = 900, radius = 180, type = "circular", cc = "true", collision = "false", shieldnow = "true"}
  312. }},
  313. ["Cassiopeia"] = {charName = "Cassiopeia", skillshots = {
  314. ["Noxious Blast"] = {name = "NoxiousBlast", spellName = "CassiopeiaNoxiousBlast", spellDelay = 250, projectileName = "CassNoxiousSnakePlane_green.troy", projectileSpeed = 500, range = 850, radius = 130, type = "circular", cc = "false", collision = "false", shieldnow = "true"},
  315. }},
  316. ["Sivir"] = {charName = "Sivir", skillshots = {
  317. ["Boomerang Blade"] = {name = "BoomerangBlade", spellName = "SivirQ", spellDelay = 250, projectileName = "Sivir_Base_Q_mis.troy", projectileSpeed = 1350, range = 1150, radius = 101, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  318. }},
  319. ["Ashe"] = {charName = "Ashe", skillshots = {
  320. ["Enchanted Arrow"] = {name = "EnchantedArrow", spellName = "EnchantedCrystalArrow", spellDelay = 250, projectileName = "Ashe_Base_R_mis.troy", projectileSpeed = 1600, range = 25000, radius = 120, type = "line", cc = "true", collision = "false", shieldnow = "true"},
  321. }},
  322. ["KogMaw"] = {charName = "KogMaw", skillshots = {
  323. ["Living Artillery"] = {name = "LivingArtillery", spellName = "KogMawLivingArtillery", spellDelay = 250, projectileName = "KogMawLivingArtillery_mis.troy", projectileSpeed = 1050, range = 2200, radius = 225, type = "circular", cc = "false", collision = "false", shieldnow = "true"}
  324. }},
  325. ["Khazix"] = {charName = "Khazix", skillshots = {
  326. ["KhazixW"] = {name = "KhazixW", spellName = "KhazixW", spellDelay = 250, projectileName = "Khazix_W_mis_enhanced.troy", projectileSpeed = 1700, range = 1025, radius = 70, type = "line", cc = "true", collision = "true", shieldnow = "true"},
  327. ["khazixwlong"] = {name = "khazixwlong", spellName = "khazixwlong", spellDelay = 250, projectileName = "Khazix_W_mis_enhanced.troy", projectileSpeed = 1700, range = 1025, radius = 70, type = "line", cc = "true", collision = "true", shieldnow = "true"},
  328. }},
  329. ["Zed"] = {charName = "Zed", skillshots = {
  330. ["ZedShuriken"] = {name = "ZedShuriken", spellName = "ZedShuriken", spellDelay = 250, projectileName = "Zed_Q_Mis.troy", projectileSpeed = 1700, range = 925, radius = 50, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  331. }},
  332. ["Leblanc"] = {charName = "Leblanc", skillshots = {
  333. ["Ethereal Chains"] = {name = "EtherealChains", spellName = "LeblancSoulShackle", spellDelay = 250, projectileName = "leBlanc_shackle_mis.troy", projectileSpeed = 1600, range = 960, radius = 70, type = "line", cc = "true", collision = "true", shieldnow = "true"},
  334. ["Ethereal Chains R"] = {name = "EtherealChainsR", spellName = "LeblancSoulShackleM", spellDelay = 250, projectileName = "leBlanc_shackle_mis_ult.troy", projectileSpeed = 1600, range = 960, radius = 70, type = "line", cc = "true", collision = "true", shieldnow = "true"},
  335. }},
  336. ["Draven"] = {charName = "Draven", skillshots = {
  337. ["Stand Aside"] = {name = "StandAside", spellName = "DravenDoubleShot", spellDelay = 250, projectileName = "Draven_E_mis.troy", projectileSpeed = 1400, range = 1100, radius = 130, type = "line", cc = "true", collision = "false", shieldnow = "true"},
  338. ["DravenR"] = {name = "DravenR", spellName = "DravenRCast", spellDelay = 500, projectileName = "Draven_R_mis!.troy", projectileSpeed = 2000, range = 25000, radius = 160, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  339. }},
  340. ["Elise"] = {charName = "Elise", skillshots = {
  341. ["Cocoon"] = {name = "Cocoon", spellName = "EliseHumanE", spellDelay = 250, projectileName = "Elise_human_E_mis.troy", projectileSpeed = 1450, range = 1100, radius = 70, type = "line", cc = "true", collision = "true", shieldnow = "true"}
  342. }},
  343. ["Lulu"] = {charName = "Lulu", skillshots = {
  344. ["LuluQ"] = {name = "LuluQ", spellName = "LuluQ", spellDelay = 250, projectileName = "Lulu_Q_Mis.troy", projectileSpeed = 1450, range = 1000, radius = 50, type = "line", cc = "true", collision = "false", shieldnow = "true"}
  345. }},
  346. ["Thresh"] = {charName = "Thresh", skillshots = {
  347. ["ThreshQ"] = {name = "ThreshQ", spellName = "ThreshQ", spellDelay = 500, projectileName = "Thresh_Q_whip_beam.troy", projectileSpeed = 1900, range = 1100, radius = 65, type = "line", cc = "true", collision = "true", shieldnow = "true"}
  348. }},
  349. ["Shen"] = {charName = "Shen", skillshots = {
  350. ["ShadowDash"] = {name = "ShadowDash", spellName = "ShenShadowDash", spellDelay = 0, projectileName = "shen_shadowDash_mis.troy", projectileSpeed = 3000, range = 575, radius = 50, type = "line", cc = "true", collision = "false", shieldnow = "true"}
  351. }},
  352. ["Quinn"] = {charName = "Quinn", skillshots = {
  353. ["QuinnQ"] = {name = "QuinnQ", spellName = "QuinnQ", spellDelay = 250, projectileName = "Quinn_Q_missile.troy", projectileSpeed = 1550, range = 1050, radius = 80, type = "line", cc = "false", collision = "true", shieldnow = "true"}
  354. }},
  355. ["Veigar"] = {charName = "Veigar", skillshots = {
  356. ["Dark Matter"] = {name = "VeigarDarkMatter", spellName = "VeigarDarkMatter", spellDelay = 250, projectileName = "!", projectileSpeed = 900, range = 900, radius = 225, type = "circular", cc = "false", collision = "false", shieldnow = "true"}
  357. }},
  358. ["Jayce"] = {charName = "Jayce", skillshots = {
  359. ["JayceShockBlast"] = {name = "JayceShockBlast", spellName = "jayceshockblast", spellDelay = 250, projectileName = "JayceOrbLightning.troy", projectileSpeed = 1450, range = 1050, radius = 70, type = "line", cc = "false", collision = "true", shieldnow = "true"},
  360. ["JayceShockBlastCharged"] = {name = "JayceShockBlastCharged", spellName = "jayceshockblast", spellDelay = 250, projectileName = "JayceOrbLightningCharged.troy", projectileSpeed = 2350, range = 1600, radius = 70, type = "line", cc = "false", collision = "true", shieldnow = "true"},
  361. }},
  362. ["Nami"] = {charName = "Nami", skillshots = {
  363. ["NamiQ"] = {name = "NamiQ", spellName = "NamiQ", spellDelay = 250, projectileName = "Nami_Q_mis.troy", projectileSpeed = 1500, range = 1625, radius = 225, type = "circle", cc = "true", collision = "false", shieldnow = "true"}
  364. }},
  365. ["Fizz"] = {charName = "Fizz", skillshots = {
  366. ["Fizz Ultimate"] = {name = "FizzULT", spellName = "FizzMarinerDoom", spellDelay = 250, projectileName = "Fizz_UltimateMissile.troy", projectileSpeed = 1350, range = 1275, radius = 80, type = "line", cc = "true", collision = "false", shieldnow = "true"},
  367. }},
  368. ["Varus"] = {charName = "Varus", skillshots = {
  369. ["Varus Q Missile"] = {name = "VarusQMissile", spellName = "somerandomspellnamethatwillnevergetcalled", spellDelay = 0, projectileName = "VarusQ_mis.troy", projectileSpeed = 1900, range = 1600, radius = 70, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  370. ["VarusR"] = {name = "VarusR", spellName = "VarusR", spellDelay = 250, projectileName = "VarusRMissile.troy", projectileSpeed = 1950, range = 1250, radius = 100, type = "line", cc = "true", collision = "false", shieldnow = "true"},
  371. }},
  372. ["Karma"] = {charName = "Karma", skillshots = {
  373. ["KarmaQ"] = {name = "KarmaQ", spellName = "KarmaQ", spellDelay = 250, projectileName = "TEMP_KarmaQMis.troy", projectileSpeed = 1700, range = 1050, radius = 90, type = "line", cc = "true", collision = "true", shieldnow = "true"},
  374. }},
  375. ["Aatrox"] = {charName = "Aatrox", skillshots = {
  376. ["Blade of Torment"] = {name = "BladeofTorment", spellName = "AatroxE", spellDelay = 250, projectileName = "AatroxBladeofTorment_mis.troy", projectileSpeed = 1200, range = 1075, radius = 75, type = "line", cc = "true", collision = "false", shieldnow = "true"},
  377. ["AatroxQ"] = {name = "AatroxQ", spellName = "AatroxQ", spellDelay = 250, projectileName = "AatroxQ.troy", projectileSpeed = 450, range = 650, radius = 145, type = "circle", cc = "true", collision = "false", shieldnow = "true"},
  378. }},
  379. ["Xerath"] = {charName = "Xerath", skillshots = {
  380. --["Xerath Arcanopulse"] =  {name = "xeratharcanopulse2", spellName = "xeratharcanopulse2", spellDelay = 250, projectileName = "hiu", projectileSpeed = 25000, range = 0, radius = 100, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  381. ["XerathArcaneBarrage2"] = {name = "XerathArcaneBarrage2", spellName = "XerathArcaneBarrage2", spellDelay = 500, projectileName = "Xerath_Base_W_cas.troy", projectileSpeed = 0, range = 1100, radius = 325, type = "circular", cc = "true", collision = "false", shieldnow = "true"},
  382. ["XerathMageSpear"] = {name = "XerathMageSpear", spellName = "XerathMageSpear", spellDelay = 250, projectileName = "Xerath_Base_E_mis.troy", projectileSpeed = 1600, range = 1050, radius = 125, type = "line", cc = "true", collision = "true", shieldnow = "true"},
  383. ["xerathlocuspulse"] = {name = "xerathlocuspulse", spellName = "xerathlocuspulse", spellDelay = 250, projectileName = "Xerath_Base_R_mis.troy", projectileSpeed = 300, range = 5600, radius = 265, type = "circular", cc = "false", collision = "false", shieldnow = "true"},
  384. }},
  385. ["Lucian"] = {charName = "Lucian", skillshots = {
  386. ["LucianQ"] =  {name = "LucianQ", spellName = "LucianQ", spellDelay = 350, projectileName = "Lucian_Q_laser.troy", projectileSpeed = 25000, range = 570*2, radius = 65, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  387. ["LucianW"] =  {name = "LucianW", spellName = "LucianW", spellDelay = 300, projectileName = "Lucian_W_mis.troy", projectileSpeed = 1600, range = 1000, radius = 80, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  388. }},
  389. ["Viktor"] = {charName = "Viktor", skillshots = {
  390. ["ViktorDeathRay1"] =  {name = "ViktorDeathRay1", spellName = "ViktorDeathRay!", spellDelay = 500, projectileName = "Viktor_DeathRay_Fix_Mis.troy", projectileSpeed = 780, range = 700, radius = 80, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  391. ["ViktorDeathRay2"] =  {name = "ViktorDeathRay2", spellName = "ViktorDeathRay!", spellDelay = 500, projectileName = "Viktor_DeathRay_Fix_Mis_Augmented.troy", projectileSpeed = 780, range = 700, radius = 80, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  392. }},
  393. ["Rumble"] = {charName = "Rumble", skillshots = {
  394. ["RumbleGrenade"] =  {name = "RumbleGrenade", spellName = "RumbleGrenade", spellDelay = 250, projectileName = "rumble_taze_mis.troy", projectileSpeed = 2000, range = 950, radius = 90, type = "line", cc = "true", collision = "true", shieldnow = "true"},
  395. }},
  396. ["Nocturne"] = {charName = "Nocturne", skillshots = {
  397. ["NocturneDuskbringer"] =  {name = "NocturneDuskbringer", spellName = "NocturneDuskbringer", spellDelay = 250, projectileName = "NocturneDuskbringer_mis.troy", projectileSpeed = 1400, range = 1125, radius = 60, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  398. }},
  399. ["Yasuo"] = {charName = "Yasuo", skillshots = {
  400. ["yasuoq3"] =  {name = "yasuoq3", spellName = "yasuoq3w", spellDelay = 250, projectileName = "Yasuo_Q_wind_mis.troy", projectileSpeed = 1200, range = 1000, radius = 80, type = "line", cc = "true", collision = "false", shieldnow = "true"},
  401. ["yasuoq1"] =  {name = "yasuoq1", spellName = "yasuoQW", spellDelay = 250, projectileName = "Yasuo_Q_WindStrike.troy", projectileSpeed = 25000, range = 475, radius = 40, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  402. ["yasuoq2"] =  {name = "yasuoq2", spellName = "yasuoq2w", spellDelay = 250, projectileName = "Yasuo_Q_windstrike_02.troy", projectileSpeed = 25000, range = 475, radius = 40, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  403. }},
  404. ["Orianna"] = {charName = "Orianna", skillshots = {
  405. ["OrianaIzunaCommand"] =  {name = "OrianaIzunaCommand", spellName = "OrianaIzunaCommand", spellDelay = 0, projectileName = "Oriana_Ghost_mis.troy", projectileSpeed = 1300, range = 800, radius = 80, type = "line", cc = "true", collision = "false", shieldnow = "true"},
  406. ["OrianaDetonateCommand"] =  {name = "OrianaDetonateCommand", spellName = "OrianaDetonateCommand", spellDelay = 100, projectileName = "Oriana_Shockwave_nova.troy", projectileSpeed = 400, range = 2000, radius = 400, type = "circular", cc = "true", collision = "false", shieldnow = "true"},  
  407. }},
  408. ["Ziggs"] = {charName = "Ziggs", skillshots = {
  409. ["ZiggsQ"] =  {name = "ZiggsQ", spellName = "ZiggsQ", spellDelay = 250, projectileName = "ZiggsQ.troy", projectileSpeed = 1700, range = 1400, radius = 155, type = "line", cc = "false", collision = "true", shieldnow = "true"},
  410. }},
  411. ["Annie"] = {charName = "Annie", skillshots = {
  412. ["AnnieR"] =  {name = "AnnieR", spellName = "InfernalGuardian", spellDelay = 100, projectileName = "nothing", projectileSpeed = 0, range = 600, radius = 300, type = "circular", cc = "true", collision = "false", shieldnow = "true"},
  413. }},
  414. ["Galio"] = {charName = "Galio", skillshots = {
  415. ["GalioResoluteSmite"] =  {name = "GalioResoluteSmite", spellName = "GalioResoluteSmite", spellDelay = 250, projectileName = "galio_concussiveBlast_mis.troy", projectileSpeed = 850, range = 2000, radius = 200, type = "circle", cc = "true", collision = "false", shieldnow = "true"},
  416. }},
  417. ["Jinx"] = {charName = "Jinx", skillshots = {
  418. ["W"] =  {name = "Zap", spellName = "JinxW", spellDelay = 600, projectileName = "Jinx_W_Beam.troy", projectileSpeed = 3300, range = 1450, radius = 70, type = "line", cc = "true", collision = "true", shieldnow = "true"},
  419. ["R"] =  {name = "SuperMegaDeathRocket", spellName = "JinxRWrapper", spellDelay = 600, projectileName = "Jinx_R_Mis.troy", projectileSpeed = 1700, range = 20000, radius = 120, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  420. }},
  421. ["Velkoz"] = {charName = "Velkoz", skillshots = {
  422. ["PlasmaFission"] =  {name = "PlasmaFission", spellName = "VelKozQ", spellDelay = 250, projectileName = "Velkoz_Base_Q_mis.troy", projectileSpeed = 1200, range = 1050, radius = 120, type = "line", cc = "true", collision = "true", shieldnow = "true"},
  423. ["Plasma Fission Split"] =  {name = "VelKozQSplit", spellName = "VelKozQ", spellDelay = 250, projectileName = "Velkoz_Base_Q_Split_mis.troy", projectileSpeed = 1200, range = 1050, radius = 120, type = "line", cc = "true", collision = "true", shieldnow = "true"},
  424. ["Void Rift"] =  {name = "VelkozW", spellName = "VelkozW", spellDelay = 250, projectileName = "Velkoz_Base_W_Turret.troy", projectileSpeed = 1200, range = 1050, radius = 125, type = "line", cc = "false", collision = "false", shieldnow = "true"},
  425. ["Tectonic Disruption"] =  {name = "VelkozE", spellName = "VelkozE", spellDelay = 250, projectileName = "DarkBinding_mis.troy", projectileSpeed = 1200, range = 800, radius = 225, type = "circular", cc = "true", collision = "false", shieldnow = "true"},
  426. }},
  427. ["Heimerdinger"] = {charName = "Heimerdinger", skillshots = {
  428. --["Micro-Rockets"] = {name = "MicroRockets", spellName = "HeimerdingerW1", spellDelay = 500, projectileName = "Heimerdinger_Base_w_Mis.troy", projectileSpeed = 902, range = 1325, radius = 100, type = "line", cc = "false", collision = "true", shieldnow = "true"},
  429. --["Storm Grenade"] = {name = "StormGrenade", spellName = "HeimerdingerE", spellDelay = 250, projectileName = "Heimerdinger_Base_E_Mis.troy", projectileSpeed = 2500, range = 970, radius = 180, type = "circular", cc = "true", collision = "false", shieldnow = "true"},
  430. --["Micro-RocketsUlt"] = {name = "MicroRocketsUlt", spellName = "HeimerdingerW2", spellDelay = 500, projectileName = "Heimerdinger_Base_W_Mis_Ult.troy", projectileSpeed = 902, range = 1325, radius = 100, type = "line", cc = "false", collision = "true", shieldnow = "true"},
  431. --["Storm Grenade"] = {name = "StormGrenade", spellName = "HeimerdingerE2", spellDelay = 250, projectileName = "Heimerdinger_Base_E_Mis_Ult.troy", projectileSpeed = 2500, range = 970, radius = 180, type = "line", cc = "true", collision = "false", shieldnow = "true"},
  432. }},
  433. ["Malzahar"] = {charName = "Malzahar", skillshots = {
  434. ["Call Of The Void"] = {name = "CallOfTheVoid", spellName ="AlZaharCalloftheVoid1", spellDelay = 0, projectileName = "AlzaharCallofthevoid_mis.troy", projectileSpeed = 1600, range = 450, radius = 100, type = "line", cc = "true", collision = "false", shieldnow = "true"},
  435. }}        
  436. }
  437. champions3 = {
  438. ["Aatrox"] = "AatroxW AatroxW2",
  439. ["Amumu"] = "AuraOfDespair",
  440. ["Anivia"] = "GlacialStorm",
  441. ["Annie"] = "MoltenShield",
  442. ["Ashe"] = "FrostShot",
  443. ["Blitzcrank"] = "Overdrive",
  444. ["Chogath"] = "VorpalSpikes",
  445. ["Corki"] = "GGun",
  446. ["Darius"] = "DariusCleave",
  447. ["DrMundo"] = "BurningAgony Masochism",
  448. ["Draven"] = "DravenSpinning DravenFury",
  449. ["Elise"] = "EliseSpiderW EliseRSpider EliseRHuman",
  450. ["Evelynn"] = "EvelynnQ EvelynnW",
  451. ["Fiora"] = "FioraRiposte FioraFlurry",
  452. ["Fizz"] = "FizzSeastonePassive",
  453. ["Galio"] = "GalioBulwark",
  454. ["Garen"] = "GarenQ GarenW GarenE",
  455. ["Gragas"] = "GragasBarrelRollToggle",
  456. ["Hecarim"] = "HecarimRapidSlash HecarimW HecarimRamp",
  457. ["Heimerdinger"] = "HeimerdingerR",
  458. ["Irelia"] = "IreliaHitenStyle IreliaTranscendentBlades",
  459. ["Janna"] = "HowlingGale SowTheWind EyeOfTheStorm",
  460. ["JarvanIV"] = "JarvanIVGoldenAegis JarvanIVDemacianStandard",
  461. ["Jax"] = "JaxEmpowerTwo JaxCounterStrike JaxRelentlessAssault",
  462. ["Jayce"] = "JayceStaticField JayceHyperCharge JayceAccelerationGate JayceStanceGtH JayceStanceHtG",
  463. ["Jinx"] = "JinxQ JinxE",
  464. ["Karma"] = "KarmaSolKimShield KarmaMantra",
  465. ["Karthus"] = "Defile",
  466. ["Kassadin"] = "NetherBlade",
  467. ["Katarina"] = "KatarinaW",
  468. ["Kayle"] = "JudicatorDivineBlessing JudicatorRighteousFury JudicatorIntervention",
  469. ["Kennen"] = "KennenLightningRush",
  470. ["KhaZix"] = "KhaZixR",
  471. ["KogMaw"] = "KogMawBioArcaneBarrage",
  472. ["Leona"] = "LeonaShieldOfDaybreak LeonaSolarBarrier",
  473. ["Lissandra"] = "LissandraW",
  474. ["Lucian"] = "LucianR",
  475. ["Lulu"] = "LuluW LuluE LuluR",
  476. ["Lux"] = "LuxLightStrikeToggle",
  477. ["Malphite"] = "Obduracy",
  478. ["Malzahar"] = "AlZaharNullZone",
  479. ["Maokai"] = "MaokaiDrain3Toggle",
  480. ["MasterYi"] = "WujuStyle Highlander",
  481. ["MissFortune"] = "MissFortuneViciousStrikes",
  482. ["Mordekaiser"] = "MordekaiserCreepingDeathCast",
  483. ["Morgana"] = "BlackShield",
  484. ["Nami"] = "NamiE",
  485. ["Nautilus"] = "NautilusPiercingGaze",
  486. ["Nidalee"] = "Takedown PrimalSurge AspectOfTheCougar",
  487. ["Nocturne"] = "NocturneShroudOfDarkness NocturneParanoia",
  488. ["Nunu"] = "BloodBoil",
  489. ["Olaf"] = "OlafFrenziedStrikes OlafRagnarok",
  490. ["Orianna"] = "OrianalzunaCommand OrianaDissonanceCommand OrianaRedactCommand OrianaDetonateCommand",
  491. ["Poppy"] = "PoppyDevastatingBlow PoppyParagonOfDemacia",
  492. ["Quinn"] = "QuinnW QuinnR QuinnValorQ QuinnRFinale",
  493. ["Rammus"] = "PowerBall DefensiveBallCurl Tremors2",
  494. ["Renekton"] = "RenektonPreExecute",
  495. ["Rengar"] = "RengarW RengarR",
  496. ["Rumble"] = "RumbleFlameThrower RumbleShield",
  497. ["Ryze"] = "DesperatePower",
  498. ["Sejuani"] = "SejuaniNorthernWinds",
  499. ["Shaco"] = "HallucinateGuide",
  500. ["Shen"] = "ShenFeint",
  501. ["Shyvana"] = "ShyvanaDoubleAttack ShyvanaImmolationAura",
  502. ["Singed"] = "PoisonTrail InsanityPotion",
  503. ["Sion"] = "DeathsCaressFull Enrage",
  504. ["Sivir"] = "SivirW SivirE SivirR",
  505. ["Skarner"] = "SkarnerExoskeleton",
  506. ["Sona"] = "SonaHymOfValor SonaAiraOfPerseverance SonaSongOfDiscord",
  507. ["Swain"] = "SwainMetamorphism",
  508. ["Syndra"] = "SyndraQ SyndraW SyndraR",
  509. ["Talon"] = "TalonNoxianDiplomacy",
  510. ["Teemo"] = "MoveQuick",
  511. ["Tristana"] = "RapidFire",
  512. ["Trundle"] = "TrundleTrollSmash",
  513. ["Tryndamere"] = "Bloodlust UndyingRage",
  514. ["Twisted Fate"] = "PickACard BlueCardLock RedCardLock GoldCardLock Destiny",
  515. ["Twitch"] = "HideInShadows FullAutomatic",
  516. ["Udyr"] = "UdyrTigerStance UdyrTurtleStance UdyrBearStance UdyrPhoenixStance",
  517. ["Urgot"] = "UrgotTerrorCapacitorActive2",
  518. ["Vayne"] = "VayneInquisition",
  519. ["Vi"] = "ViE",
  520. ["Vladimir"] = "VladimirSanguinePool",
  521. ["Volibear"] = "VolibearQ VolibearW",
  522. ["Warwick"] = "HuntersCall BloodScent",
  523. ["Wukong"] = "WukongQ WukongW WukongR",
  524. ["Xin Zhao"] = "XenZhaoComboTarget ZenZhaoBattleCry",
  525. ["Zac"] = "ZacW",
  526. ["Zed"] = "ZedPBAOEDummy",
  527. ["Ziggs"] = "ZiggsWToggle",
  528. ["Zilean"] = "Rewind TimeWarp",
  529. ["Zyra"] = "ZyraSeed"
  530.  
  531. }
  532.  
  533. wrotedisclaimer = false
  534. enemyes = {}
  535. nAllies = 0
  536. allies = {}
  537. hiu = nil
  538. hiuNum = 0
  539. nEnemies = 0
  540. evading             = false
  541. allowCustomMovement = true
  542. captureMovements    = true
  543. lastMovement        = {}
  544. detectedSkillshots  = {}
  545. nSkillshots = 0
  546. CastingSpell = false
  547. lastset = 0
  548. trueWidth = {}
  549. trueSpeed = {}
  550. trueDelay = {}
  551. haveflash = false
  552. flashSlot = nil
  553. flashready = false
  554. lastspell = "Q"
  555. useflash = false
  556. shieldslot = _E
  557. shieldtick = nil
  558. alreadywritten = false
  559. thatfile = SCRIPT_PATH.."movementblock.txt"
  560. currentbuffer = 0
  561. bufferset = false
  562. lastnonattack = 0
  563. hitboxTable = {['Yasuo'] = 65, ['VelKoz'] = 65, ['Xerath'] = 65, ['Kassadin'] = 65, ['Rengar'] = 65, ['Thresh'] = 55.0, ['Ziggs'] = 55.0, ['KogMaw'] = 65, ['Katarina'] = 65, ['Riven'] = 65, ['Ashe'] = 65, ['Soraka'] = 65, ['Jinx'] = 65, ['JarvanIV'] = 65, ['Tryndamere'] = 65, ['Singed'] = 65, ['Diana'] = 65, ['Ahri'] = 65, ['Lulu'] = 65, ['MasterYi'] = 65, ['Lissandra'] = 65, ['Draven'] = 65, ['FiddleSticks'] = 65, ['Maokai'] = 80.0, ['Sivir'] = 65, ['Corki'] = 65, ['Janna'] = 65, ['Nasus'] = 80.0, ['LeeSin'] = 65, ['Jax'] = 65, ['Blitzcrank'] = 80.0, ['Shen'] = 65, ['Nocturne'] = 65, ['Sona'] = 65, ['Caitlyn'] = 65, ['Trundle'] = 65, ['Malphite'] = 80.0, ['Mordekaiser'] = 80.0, ['Vi'] = 50, ['Renekton'] = 80.0, ['Anivia'] = 65, ['Fizz'] = 65, ['Heimerdinger'] = 55.0, ['Evelynn'] = 65, ['Rumble'] = 80.0, ['Leblanc'] = 65, ['Darius'] = 80.0, ['Viktor'] = 65, ['XinZhao'] = 65, ['Orianna'] = 65, ['Vladimir'] = 65, ['Nidalee'] = 65, ['Syndra'] = 65, ['Zac'] = 80.0, ['Olaf'] = 65, ['Veigar'] = 55.0, ['Twitch'] = 65, ['Alistar'] = 80.0, ['Akali'] = 65, ['Urgot'] = 80.0, ['Leona'] = 65, ['Talon'] = 65, ['Karma'] = 65, ['Jayce'] = 65, ['Galio'] = 80.0, ['Shaco'] = 65, ['Taric'] = 65, ['TwistedFate'] = 65, ['Varus'] = 65, ['Garen'] = 65, ['Swain'] = 65, ['Vayne'] = 65, ['Fiora'] = 65, ['Quinn'] = 65, ['Kayle'] = 65, ['Brand'] = 65, ['Teemo'] = 55.0, ['Amumu'] = 55.0, ['Annie'] = 55.0, ['Elise'] = 65, ['Nami'] = 65, ['Poppy'] = 55.0, ['AniviaEgg'] = 65, ['Tristana'] = 55.0, ['Graves'] = 65, ['Morgana'] = 65, ['Gragas'] = 80.0, ['MissFortune'] = 65, ['Warwick'] = 65, ['Cassiopeia'] = 65, ['DrMundo'] = 80.0, ['Volibear'] = 80.0, ['Irelia'] = 65, ['Lucian'] = 65, ['Yorick'] = 80.0, ['Udyr'] = 65, ['MonkeyKing'] = 65, ['Kennen'] = 55.0, ['Nunu'] = 65, ['Ryze'] = 65, ['Zed'] = 65, ['Nautilus'] = 80.0, ['Gangplank'] = 65, ['shopevo'] = 65, ['Lux'] = 65, ['Sejuani'] = 80.0, ['Ezreal'] = 65, ['Khazix'] = 65, ['Sion'] = 80.0, ['Aatrox'] = 65, ['Hecarim'] = 80.0, ['Pantheon'] = 65, ['Shyvana'] = 50.0, ['Zyra'] = 65, ['Karthus'] = 65, ['Rammus'] = 65, ['Zilean'] = 65, ['Chogath'] = 80.0, ['Malzahar'] = 65, ['KogMawDead'] = 65, ['QuinnValor'] = 65, ['Nidalee_Cougar'] = 65}
  564.  
  565.  
  566. function getTarget(targetId)
  567.         if targetId ~= 0 and targetId ~= nil then
  568.         return objManager:GetObjectByNetworkId(targetId)
  569.     end
  570.     return nil
  571. end
  572.  
  573. function OnSendPacket(p)
  574.         if VIP_USER then
  575.         local packet = Packet(p)
  576.         if packet:get('name') == 'S_MOVE' then
  577.             if packet:get('sourceNetworkId') == myHero.networkID then
  578.                 if captureMovements then
  579.                     if packet:get('targetNetworkId') == 0 then
  580.                         lastMovement.destination = Point2(packet:get('x'), packet:get('y'))
  581.                         lastMovement.type = packet:get('type')
  582.                         lastMovement.targetId = packet:get('targetNetworkId')
  583.                         lastnonattack = GetTickCount()
  584.                         elseif lastnonattack + 1000 < GetTickCount() then
  585.                         lastMovement.destination = Point2(packet:get('x'), packet:get('y'))
  586.                         lastMovement.type = packet:get('type')
  587.                         lastMovement.targetId = packet:get('targetNetworkId')
  588.                     end
  589.                    
  590.                     if evading then
  591.                         for i, detectedSkillshot in pairs(detectedSkillshots) do
  592.                             if detectedSkillshot and detectedSkillshot.evading and inDangerousArea(detectedSkillshot, Point2(myHero.x, myHero.z)) then
  593.                                 dodgeSkillshot(detectedSkillshot)
  594.                                 break
  595.                             end
  596.                         end
  597.                     end
  598.                 end
  599.                 if not allowCustomMovement then
  600.                         for i, detectedSkillshot in pairs(detectedSkillshots) do
  601.                             if detectedSkillshot and detectedSkillshot.evading and inDangerousArea(detectedSkillshot, Point2(myHero.x, myHero.z)) then
  602.                                 packet:block()
  603.                                 break
  604.                             end
  605.                         end
  606.                 end          
  607.             end
  608.             elseif packet:get('name') == 'S_CAST' then
  609.             if captureMovements and lastnonattack + 1000 < GetTickCount() then
  610.                 lastMovement.spellId = packet:get('spellId')
  611.                 lastMovement.type = 7
  612.                 lastMovement.targetId = packet:get('targetNetworkId')
  613.                 lastMovement.destination = Point2(packet:get('toX'), packet:get('toY'))
  614.                
  615.                 if evading then
  616.                     for i, detectedSkillshot in pairs(detectedSkillshots) do
  617.                         if detectedSkillshot and detectedSkillshot.evading and inDangerousArea(detectedSkillshot, Point2(myHero.x, myHero.z)) then
  618.                             dodgeSkillshot(detectedSkillshot)
  619.                             break
  620.                         end
  621.                     end
  622.                 end
  623.             end
  624.             if not (allowCustomMovement or
  625.                     spellStopMovement(GetMyHero().charName, packet:get('spellId'),
  626.                     packet.targetNetworkId == GetMyHero().NetworkId)) then
  627.                 if packet:get('spellId') == 12 then
  628.                 else
  629.                     for i, detectedSkillshot in pairs(detectedSkillshots) do
  630.                         if detectedSkillshot and detectedSkillshot.evading and inDangerousArea(detectedSkillshot, Point2(myHero.x, myHero.z)) then
  631.                             packet:block()
  632.                             break
  633.                         end
  634.                     end
  635.                 end
  636.             end
  637.         end
  638.     end
  639. end
  640.  
  641. function spellStopMovement(champName, champSkill, selfCast)
  642.     if GoodEvadeConfig.allowMove == false then
  643.         return false
  644.     end
  645.     local champSkill2
  646.     if(champSkill == 0) then
  647.         champSkill2 = GetMyHero():GetSpellData(0).name
  648.         if GoodEvadeConfig.stopCCMoves and (GetMyHero().charName == "Varus" or GetMyHero().charName == "Vi" or GetMyHero().charName == "Xerath") then
  649.             return true
  650.         else
  651.             return false
  652.         end
  653.     elseif(champSkill == 1) then
  654.         champSkill2 = GetMyHero():GetSpellData(1).name
  655.         if(GetMyHero().charName) == "LeeSin" and selfCast then
  656.             return true
  657.         end
  658.     elseif(champSkill == 2) then
  659.         champSkill2 = GetMyHero():GetSpellData(2).name
  660.     elseif(champSkill == 3) then
  661.         champSkill2 = GetMyHero():GetSpellData(3).name
  662.     else
  663.         champSkill2 = "null"
  664.     end
  665.     if(champions3[champName] ~= nil) then
  666.         return string.find(string.lower(champions3[champName]), string.lower(champSkill2)) ~= nil
  667.     end
  668.     return false
  669. end
  670.  
  671. function getLastMovementDestination()
  672.     mousePosition = Point2(mousePos.x, mousePos.z)
  673.     if VIP_USER then
  674.         if lastMovement.type == 3 then
  675.             heroPosition = Point2(myHero.x, myHero.z)
  676.             mousePosition = Point2(mousePos.x, mousePos.z)
  677.            
  678.             target = getTarget(lastMovement.targetId)
  679.             if _isValidTarget(target) then
  680.                 targetPosition = Point2(target.x, target.z)
  681.                
  682.                 local attackRange = (myHero.range + GetDistance(myHero.minBBox, myHero.maxBBox) / 2 + GetDistance(target.minBBox, target.maxBBox) / 2)
  683.                
  684.                 if attackRange <= heroPosition:distance(targetPosition) then
  685.                     return targetPosition + (heroPosition - targetPosition):normalized() * attackRange
  686.                 else
  687.                     return mousePosition
  688.                 end
  689.             else
  690.                 return mousePosition
  691.             end
  692.             elseif lastMovement.type == 7 then
  693.             heroPosition = Point2(myHero.x, myHero.z)
  694.             mousePosition = Point2(mousePos.x, mousePos.z)
  695.             target = getTarget(lastMovement.targetId)
  696.             if _isValidTarget(target) then
  697.                 targetPosition = Point2(target.x, target.z)
  698.                
  699.                 local castRange = myHero:GetSpellData(lastMovement.spellId).range
  700.                
  701.                 if castRange <= heroPosition:distance(targetPosition) then
  702.                     return targetPosition + (heroPosition - targetPosition):normalized() * castRange
  703.                 else
  704.                     return mousePosition
  705.                 end
  706.             else
  707.                 local castRange = myHero:GetSpellData(lastMovement.spellId).range
  708.                
  709.                 if castRange <= heroPosition:distance(lastMovement.destination) then
  710.                     return lastMovement.destination + (heroPosition - lastMovement.destination):normalized() * castRange
  711.                 else
  712.                     return mousePosition
  713.                 end
  714.             end
  715.         else
  716.             return lastMovement.destination
  717.         end
  718.         else return lastMovement.destination
  719.     end
  720. end
  721. function CheckBall(obj)
  722.     if obj == nil or obj.name == nil then return end  
  723.    
  724.     if (obj.name:find("Oriana_Ghost_mis") or obj.name:find("Oriana_Ghost_mis_protect") ) then
  725.         ball = nil
  726.         return
  727.     end
  728.    
  729.     if obj.name:find("yomu_ring_red") then
  730.         ball = obj
  731.         return
  732.     end
  733.    
  734.     if obj.name:find("Oriana_Ghost_bind") then
  735.         for i, target in pairs(enemyes) do
  736.             if GetDistance(target, obj) < 40 then
  737.                 ball = target
  738.             end
  739.         end
  740.     end
  741. end
  742.  
  743. local AutoUpdate = true
  744. local SELF = SCRIPT_PATH..GetCurrentEnv().FILE_NAME
  745. local URL = "https://raw.githubusercontent.com/Whatefang/FreakingGoodEvade/master/FreakingGoodEvade.lua"
  746. local UPDATE_TMP_FILE = LIB_PATH.."FGETmp.txt"
  747. local versionmessage = "<font color=\"#81BEF7\" >Changelog: Added Zyra skillshots. Malzahar Q is coded in but doesn't work very well. Heimer's spells are coded in but don't work at all, so I've disabled them. I'll look into fixing it later.</font>"
  748.  
  749. function Update()
  750. DownloadFile(URL, UPDATE_TMP_FILE, UpdateCallback)
  751. end
  752.  
  753. function UpdateCallback()
  754. file = io.open(UPDATE_TMP_FILE, "rb")
  755. if file ~= nil then
  756. content = file:read("*all")
  757. file:close()
  758. os.remove(UPDATE_TMP_FILE)
  759. if content then
  760. tmp, sstart = string.find(content, "local version = \"")
  761. if sstart then
  762. send, tmp = string.find(content, "\"", sstart+1)
  763. end
  764. if send then
  765. Version = tonumber(string.sub(content, sstart+1, send-1))
  766. end
  767. if (Version ~= nil) and (Version > tonumber(version)) and content:find("--EOS--") then
  768. file = io.open(SELF, "w")
  769. if file then
  770. file:write(content)
  771. file:flush()
  772. file:close()
  773. PrintChat("<font color=\"#81BEF7\" >FreakingGoodEvade:</font> <font color=\"#00FF00\">Successfully updated to: v"..Version..". Please reload the script with F9.</font>")
  774. else
  775. PrintChat("<font color=\"#81BEF7\" >FreakingGoodEvade:</font> <font color=\"#FF0000\">Error updating to new version (v"..Version..")</font>")
  776. end
  777. elseif (Version ~= nil) and (Version == tonumber(version)) then
  778. PrintChat("<font color=\"#81BEF7\" >FreakingGoodEvade:</font> <font color=\"#00FF00\">No updates found, latest version: v"..Version.." </font>")
  779. end
  780. end
  781. end
  782. end
  783.  
  784. function OnLoad()
  785.  
  786.     hitboxSize = hitboxTable[GetMyHero().charName]
  787.    
  788.     if hitboxSize == nil then
  789.         hitboxSize = 80.0
  790.     end
  791.  
  792.     ball = nil
  793.     GoodEvadeConfig = scriptConfig("Freaking Good Evade", "Freaking Good Evade")
  794.     GoodEvadeConfig:addParam("evadeBuffer", "Increase Skillshot width by", SCRIPT_PARAM_SLICE, 15, 0, 50, 0 )
  795.     GoodEvadeConfig:addParam("lineallways", "Always try to dodge line skillshots", SCRIPT_PARAM_ONOFF, true)
  796.     GoodEvadeConfig:addParam("fowdelay", "Delay for skillshots from FOW", SCRIPT_PARAM_SLICE, 1, 1, 20, 0)
  797.     GoodEvadeConfig:addParam("dodgeEnabled", "Dodge Skillshots", SCRIPT_PARAM_ONOFF, true)
  798.     GoodEvadeConfig:addParam("drawEnabled", "Draw Skillshots", SCRIPT_PARAM_ONOFF, true)
  799.     GoodEvadeConfig:addParam("dodgeCConly", "Dodge CC only spells", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  800.     GoodEvadeConfig:addParam("dodgeCConly2", "Toggle dodge CC only spells", SCRIPT_PARAM_ONKEYTOGGLE, false, 77)
  801.     GoodEvadeConfig:addParam("resetdodge", "Reset Dodge", SCRIPT_PARAM_ONKEYDOWN, false, 17)
  802.     GoodEvadeConfig:addParam("usedashes", "Dash to dodge spells", SCRIPT_PARAM_ONOFF, true)
  803.     GoodEvadeConfig:addParam("useSummonerFlash", "Flash to dodge dangerous spells", SCRIPT_PARAM_ONOFF, true)
  804.     GoodEvadeConfig:addParam("allowMove", "Allow use of 0 cast time spells", SCRIPT_PARAM_ONOFF, true)
  805.     GoodEvadeConfig:addParam("stopCCMoves", "Use 0 cast time spells with self cc", SCRIPT_PARAM_ONOFF, true)
  806.     GoodEvadeConfig:addParam("freemovementblock", "Free Users Movement Block", SCRIPT_PARAM_ONOFF, false)
  807.     GoodEvadeConfig:permaShow("dodgeEnabled")
  808.     for i = 1, heroManager.iCount do
  809.         local hero = heroManager:GetHero(i)
  810.         if hero.team ~= myHero.team then
  811.             for i, skillShotChampion in pairs(champions2) do
  812.                 if skillShotChampion.charName == hero.charName then
  813.                     table.insert(champions, skillShotChampion)
  814.                 end
  815.             end
  816.         end
  817.     end
  818.     GoodEvadeSkillshotConfig = scriptConfig("FGE skillshots", "FGE skillshots config")
  819.     for i, skillShotChampion in pairs(champions) do
  820.         for i, skillshot in pairs(skillShotChampion.skillshots) do
  821.             name = tostring(skillshot.name)
  822.             name2 = tostring(skillshot.name)
  823.             if skillshot.cc == "true" then
  824.                 GoodEvadeSkillshotConfig:addParam(name, "Dodge "..name2, SCRIPT_PARAM_SLICE, 2, 0, 2, 0)
  825.                 elseif skillshot.cc == "false" then GoodEvadeSkillshotConfig:addParam(name, "Dodge "..name2, SCRIPT_PARAM_SLICE, 1, 0, 2, 0)
  826.                 elseif skillshot.cc == "never" then GoodEvadeSkillshotConfig:addParam(name, "Dodge "..name2, SCRIPT_PARAM_SLICE, 0, 0, 2, 0)
  827.             end
  828.         end
  829.     end
  830.    
  831.     stopEvade()
  832.     isSivir = false
  833.     if myHero.charName == "Sivir" then
  834.         isSivir = true
  835.     end
  836.     isNocturne = false
  837.     if myHero.charName == "Nocturne" then
  838.         isNocturne = true
  839.     end
  840.     isVayne = false
  841.     if myHero.charName == "Vayne" then
  842.         isVayne = true
  843.     end
  844.     isGraves = false
  845.     if myHero.charName == "Graves" then
  846.         isGraves = true
  847.     end
  848.     isEzreal = false
  849.     if myHero.charName == "Ezreal" then
  850.         isEzreal = true
  851.     end
  852.     if myHero.charName == "Caitlyn"
  853.         then isCaitlyn  = true
  854.     end
  855.     isLeblanc = false
  856.     if myHero.charName == "Leblanc" then
  857.         isLeblanc = true
  858.     end
  859.     isRiven = false
  860.     if myHero.charName == "Riven" then
  861.         isRiven = true
  862.     end
  863.     isFizz = false
  864.     if myHero.charName == "Fizz" then
  865.         isFizz = true
  866.     end
  867.     isShen = false
  868.     if myHero.charName == "Shen" then
  869.         isShen = true
  870.     end
  871.     isShaco = false
  872.     if myHero.charName == "Shaco" then
  873.         isShaco = true
  874.     end
  875.     isRenekton = false          
  876.     if myHero.charName == "Renekton" then
  877.         isRenekton = true
  878.     end
  879.     isTristana = false
  880.     if myHero.charName == "Tristana" then
  881.         isTristana = true
  882.     end
  883.     isTryndamere = false
  884.     if myHero.charName == "Tryndamere" then
  885.         isTryndamere = true
  886.     end
  887.     isCorki = false
  888.     if myHero.charName == "Corki" then
  889.         isCorki = true
  890.     end
  891.     isLucian = false
  892.     if myHero.charName == "Lucian" then
  893.         isLucian = true
  894.     end
  895.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerFlash") then
  896.         haveflash = true
  897.         flashSlot = SUMMONER_1
  898.         elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerFlash") then
  899.         flashSlot = SUMMONER_2
  900.         haveflash = true
  901.     end
  902.    
  903.     lastMovement = {
  904.     destination = Point2(myHero.x, myHero.z),
  905.     moveCommand = Point2(myHero.x, myHero.z),
  906.     type = 2,
  907.     targetId = nil,
  908.     spellId = nil,
  909.     approachedPoint = nil
  910.     }
  911.    
  912.     for i = 1, heroManager.iCount do
  913.         local hero = heroManager:GetHero(i)
  914.         if hero.team ~= myHero.team then
  915.             table.insert(enemyes, hero)
  916.             elseif hero.team == myHero.team and hero.nEnemies ~= myHero.networkID then
  917.             table.insert(allies, hero)
  918.         end
  919.     end
  920.     isOrianna = false
  921.     for i, enemy in pairs(enemyes) do
  922.         if enemy.charName == "Orianna" then
  923.             isOrianna = true
  924.         end
  925.     end
  926.     if #enemyes == 5 then
  927.         for i, skillShotChampion in pairs(champions) do
  928.             if skillShotChampion.charName ~= enemyes[1].charName and skillShotChampion.charName ~= enemyes[2].charName and skillShotChampion.charName ~= enemyes[3].charName
  929.                 and skillShotChampion.charName ~= enemyes[4].charName and skillShotChampion.charName ~= enemyes[5].charName then
  930.                 champions[i] = nil
  931.             end
  932.         end
  933.     end
  934.    
  935.     player:RemoveCollision()
  936.     player:SetVisionRadius(1700)
  937.    
  938.     GoodEvadeConfig.dodgeEnabled = true
  939.     currentbuffer = GoodEvadeConfig.evadeBuffer
  940.     PrintChat(versionmessage)
  941.     if AutoUpdate then
  942.         DelayAction(Update, 3)
  943.     end
  944. end
  945.  
  946.  
  947.  
  948. function getSideOfLine(linePoint1, linePoint2, point)
  949.     if not point then return 0 end
  950.     result = ((linePoint2.x - linePoint1.x) * (point.y - linePoint1.y) - (linePoint2.y - linePoint1.y) * (point.x - linePoint1.x))
  951.     if result < 0 then
  952.         return -1
  953.         elseif result > 0 then
  954.         return 1
  955.     else
  956.         return 0
  957.     end
  958. end
  959. colstartpos = nil
  960. colendpos = nil
  961.  
  962. function dodgeSkillshot(skillshot)
  963.         if GoodEvadeConfig.dodgeEnabled and not myHero.dead and CastingSpell == false then
  964.         if skillshot.skillshot.type == "line" then
  965.             if skillshot.skillshot.collision == "true" and VIP_USER then
  966.                 heropos = Point2(myHero.x, myHero.z)
  967.                 endposition = skillshot.startPosition + (skillshot.endPosition - skillshot.startPosition):normalized() * (heropos:distance(skillshot.startPosition))
  968.                 colstartpos = Vector(skillshot.startPosition.x, myHero.y, skillshot.startPosition.y)
  969.                 colendpos = Vector(endposition.x, myHero.y, endposition.y)
  970.                 collisionshit = CollisionPE(skillshot.skillshot.range, skillshot.skillshot.projectileSpeed, skillshot.skillshot.spellDelay, skillshot.skillshot.radius)
  971.                 if collisionshit:GetMinionCollision(colstartpos, colendpos) then return end
  972.             end
  973.             dodgeLineShot(skillshot)
  974.         else
  975.             dodgeCircularShot(skillshot)
  976.         end
  977.     end
  978. end
  979.  
  980. function dodgeCircularShot(skillshot)
  981.     skillshot.evading = true
  982.     alreadydodged = false
  983.     heroPosition = Point2(myHero.x, myHero.z)
  984.    
  985.     moveableDistance = myHero.ms * math.max(skillshot.endTick - GetTickCount() - GetLatency()/2, 0) / 1000
  986.     evadeRadius = skillshot.skillshot.radius + hitboxSize / 2 + GoodEvadeConfig.evadeBuffer + moveBuffer
  987.    
  988.     safeTarget = skillshot.endPosition + (heroPosition - skillshot.endPosition):normalized() * evadeRadius
  989.    
  990.     if skillshot.skillshot.name == "UFSlash" or skillshot.skillshot.name == "AnnieR" then
  991.         if AM1(skillshot) then
  992.             alreadydodged = true
  993.             elseif AM2(skillshot, heroPosition) then
  994.             alreadydodged = true
  995.             elseif AM3(skillshot, safeTarget) then
  996.             alreadydodged = true
  997.         end
  998.     end
  999.     if not alreadydodged then
  1000.         if mainCircularskillshot1(skillshot, heroPosition, moveableDistance, evadeRadius, safeTarget) then
  1001.             alreadydodged = true
  1002.             elseif mainCircularskillshot2(skillshot) then
  1003.             alreadydodged = true
  1004.             elseif mainCircularskillshot3(skillshot, heroPosition) then
  1005.             alreadydodged = true
  1006.             elseif mainCircularskillshot4(skillshot, heroPosition, moveableDistance, evadeRadius, safeTarget) then
  1007.             alreadydodged = true
  1008.             elseif mainCircularskillshot5(skillshot, safeTarget) then
  1009.             alreadydodged = true
  1010.         end
  1011.     end
  1012. end
  1013.  
  1014. function haveShield()
  1015.         if isSivir and myHero:CanUseSpell(_E) == READY then
  1016.         return true
  1017.     end
  1018.     if isNocturne and myHero:CanUseSpell(_W) == READY then
  1019.         return true
  1020.     end
  1021.     return false
  1022. end
  1023.  
  1024. function FlashTo(x, y)
  1025.     CastSpell(flashSlot, x, y)
  1026. end
  1027.  
  1028.  
  1029. function dodgeLineShot(skillshot)
  1030.     alreadydodged = false
  1031.     heroPosition = Point2(myHero.x, myHero.z)
  1032.     local evadeTo1
  1033.     local evadeTo2
  1034.     skillshot.evading = true
  1035.     skillshotLine = Line2(skillshot.startPosition, skillshot.endPosition)
  1036.     distanceFromSkillshotPath = skillshotLine:distance(heroPosition)
  1037.     evadeDistance = skillshot.skillshot.radius + hitboxSize / 2 + GoodEvadeConfig.evadeBuffer + moveBuffer
  1038.     normalVector = Point2(skillshot.directionVector.y, -skillshot.directionVector.x):normalized()
  1039.     nessecaryMoveWidth = evadeDistance - distanceFromSkillshotPath
  1040.     evadeTo1 = heroPosition + normalVector * nessecaryMoveWidth
  1041.     evadeTo2 = heroPosition - normalVector * nessecaryMoveWidth
  1042.     if skillshot.skillshot.name == "Crescendo" then
  1043.         if dodgeCrescendo1(skillshot) then
  1044.             alreadydodged = true
  1045.             elseif dodgeCrescendo2(skillshot, evadeTo1, evadeTo2) then
  1046.             alreadydodged = true
  1047.         end
  1048.     end
  1049.     if not alreadydodged then
  1050.         if lineSkillshot1(skillshot, heroPosition, skillshotLine, distanceFromSkillshotPath, evadeDistance, normalVector, nessecaryMoveWidth, evadeTo1, evadeTo2)
  1051.             then alreadydodged = true
  1052.             elseif lineSkillshot2(skillshot)
  1053.             then alreadydodged = true
  1054.             elseif lineSkillshot3(skillshot, evadeTo1, evadeTo2)
  1055.             then alreadydodged = true
  1056.             elseif lineSkillshot4(skillshot, evadeTo1, evadeTo2)
  1057.             then alreadydodged = true
  1058.         end
  1059.     end
  1060. end
  1061.  
  1062. function _isDangerSkillshot(skillshot)
  1063.         if skillshot.skillshot.name == "LeonaZenithBlade"
  1064.         or skillshot.skillshot.name == "EnchantedArrow"
  1065.         or skillshot.skillshot.name == "LuxMaliceCannon"
  1066.         or skillshot.skillshot.name == "SejuaniR"
  1067.         or skillshot.skillshot.name == "Crescendo"
  1068.         or skillshot.skillshot.name == "TrueshotBarrage"
  1069.         or skillshot.skillshot.name == "RocketGrab"
  1070.         or skillshot.skillshot.name == "DredgeLine"
  1071.         or skillshot.skillshot.name == "ShadowDash"
  1072.         or skillshot.skillshot.name == "FizzULT"
  1073.         or skillshot.skillshot.name == "VarusR"
  1074.         or skillshot.skillshot.name == "SuperMegaDeathRocket"
  1075.         or skillshot.skillshot.name == "UFSlash"
  1076.         or skillshot.skillshot.name == "LeonaSolarFlare"
  1077.         or skillshot.skillshot.name == "AnnieR"
  1078.         or skillshot.skillshot.name == "OrianaDetonateCommand"
  1079.         then
  1080.         return true
  1081.     else
  1082.         return false
  1083.     end
  1084. end
  1085.  
  1086. function isreallydangerous(skillshot)
  1087.         if skillshot.skillshot.name == "UFSlash"
  1088.         or skillshot.skillshot.name == "Crescendo"
  1089.         or skillshot.skillshot.name == "FizzULT"
  1090.         or skillshot.skillshot.name == "EnchantedArrow"
  1091.         or skillshot.skillshot.name == "AnnieR"
  1092.         or skillshot.skillshot.name == "OrianaDetonateCommand"
  1093.         then return true
  1094.     else
  1095.         return false
  1096.     end
  1097. end
  1098.  
  1099. function InsideTheWall(evadeTestPoint)
  1100.     local heroPosition = Point2(myHero.x, myHero.z)
  1101.     local dist = evadeTestPoint:distance(heroPosition)
  1102.     local interval = 50
  1103.     local nChecks = math.ceil((dist+50)/50)
  1104.    
  1105.     if evadeTestPoint.x == 0 or evadeTestPoint.y == 0 then
  1106.         return true
  1107.     end
  1108.     for k=1, nChecks, 1 do
  1109.         local checksPos = evadeTestPoint + (evadeTestPoint - heroPosition):normalized()*(interval*k)
  1110.         if IsWall(D3DXVECTOR3(checksPos.x, myHero.y, checksPos.y)) then
  1111.             return true
  1112.         end
  1113.     end
  1114.     if IsWall(D3DXVECTOR3(evadeTestPoint.x + 20, myHero.y, evadeTestPoint.y + 20)) then return true end
  1115.     if IsWall(D3DXVECTOR3(evadeTestPoint.x + 20, myHero.y, evadeTestPoint.y - 20)) then return true end
  1116.     if IsWall(D3DXVECTOR3(evadeTestPoint.x - 20, myHero.y, evadeTestPoint.y - 20)) then return true end
  1117.     if IsWall(D3DXVECTOR3(evadeTestPoint.x - 20, myHero.y, evadeTestPoint.y + 20)) then return true end
  1118.    
  1119.     return false
  1120. end
  1121.  
  1122. function findBestDirection(skillshot, referencePoint, possiblePoints)
  1123.     if not skillshot then return closestPoint end
  1124.     closestPoint = nil
  1125.     closestDistance = nil
  1126.     side1 = getSideOfLine(skillshot.startPosition, skillshot.endPosition, Point2(myHero.x, myHero.z))
  1127.     for i, point in pairs(possiblePoints) do
  1128.         if point ~= nil and skillshot ~= nil then
  1129.             side2 = getSideOfLine(skillshot.startPosition, skillshot.endPosition, point)
  1130.             distToSkillshot = Line2(skillshot.startPosition, skillshot.endPosition):distance(point)
  1131.             mindistSkillshot = skillshot.skillshot.radius + hitboxSize / 2 + GoodEvadeConfig.evadeBuffer
  1132.             distance = point:distance(referencePoint)
  1133.             if (closestDistance == nil or distance <= closestDistance) and not InsideTheWall(point)
  1134.                 and distToSkillshot > mindistSkillshot and (side1 == side2 or side1 == 0) then
  1135.                 closestDistance = distance
  1136.                 closestPoint = point
  1137.             end
  1138.         end
  1139.     end
  1140.    
  1141.     return closestPoint
  1142. end
  1143.  
  1144. function calculateLongitudinalApproachLength(skillshot, d)
  1145.     v1 = skillshot.skillshot.projectileSpeed
  1146.     v2 = myHero.ms
  1147.     longitudinalDistance = math.max(skillshotPosition(skillshot, GetTickCount()):distance(getPerpendicularFootpoint(skillshot.startPosition, skillshot.endPosition, Point2(myHero.x, myHero.z))) - hitboxSize / 2 - skillshot.skillshot.radius, 0)  + v1 * math.max(skillshot.startTick - GetTickCount(), 0) / 1000
  1148.    
  1149.     preResult = -d^2 * v1^4 + d^2 * v2^2 * v1^2 + longitudinalDistance^2 * v2^2 * v1^2
  1150.     if preResult >= 0 then
  1151.         result = (math.sqrt(preResult) - longitudinalDistance * v2^2) / (v1^2 - v2^2)
  1152.         if result >= 0 then
  1153.             return result
  1154.         end
  1155.     end
  1156.    
  1157.     return -1
  1158. end
  1159.  
  1160. function calculateLongitudinalRetreatLength(skillshot, d)
  1161.     v1 = skillshot.skillshot.projectileSpeed
  1162.     v2 = myHero.ms
  1163.     longitudinalDistance = math.max(skillshotPosition(skillshot, GetTickCount()):distance(getPerpendicularFootpoint(skillshot.startPosition, skillshot.endPosition, Point2(myHero.x, myHero.z))) - hitboxSize / 2 - skillshot.skillshot.radius, 0) + v1 * math.max(skillshot.startTick - GetTickCount(), 0) / 1000
  1164.    
  1165.     preResult = -d^2 * v1^4 + d^2 * v2^2 * v1^2 + longitudinalDistance^2 * v2^2 * v1^2
  1166.     if preResult >= 0 then
  1167.         result = (math.sqrt(preResult) + longitudinalDistance * v2^2) / (v1^2 - v2^2)
  1168.         if result >= 0 then
  1169.             return result
  1170.         end
  1171.     end
  1172.    
  1173.     return -1
  1174. end
  1175.  
  1176. function inDangerousArea(skillshot, coordinate)
  1177.         if skillshot.skillshot.type == "line" then
  1178.         return inRange(skillshot, coordinate)
  1179.         and not skillshotHasPassed(skillshot, coordinate)
  1180.         and Line2(skillshot.startPosition, skillshot.endPosition):distance(coordinate) < (skillshot.skillshot.radius + hitboxSize / 2 + GoodEvadeConfig.evadeBuffer)
  1181.         and coordinate:distance(skillshot.startPosition + skillshot.directionVector) <= coordinate:distance(skillshot.startPosition - skillshot.directionVector)
  1182.     else
  1183.         return coordinate:distance(skillshot.endPosition) <= skillshot.skillshot.radius + hitboxSize / 2 + GoodEvadeConfig.evadeBuffer
  1184.     end
  1185. end
  1186.  
  1187. function inRange(skillshot, coordinate)
  1188.     return getPerpendicularFootpoint(skillshot.startPosition, skillshot.endPosition, coordinate):distance(skillshot.startPosition) <= skillshot.skillshot.range
  1189. end
  1190.  
  1191. function OnCreateObj(object)
  1192.         if object ~= nil and object.type == "obj_GeneralParticleEmmiter" then
  1193.         for i, skillShotChampion in pairs(champions) do
  1194.             for i, skillshot in pairs(skillShotChampion.skillshots) do
  1195.                 if GoodEvadeSkillshotConfig[tostring(skillshot.name)] == 2 then
  1196.                     if skillshot.projectileName == object.name then
  1197.                         if(object.name == "hiu") then
  1198.                             --table.insert(hiu, object)
  1199.                         else
  1200.                             for i, detectedSkillshot in pairs(detectedSkillshots) do
  1201.                                 if detectedSkillshot.skillshot.projectileName == skillshot.projectileName then
  1202.                                     return
  1203.                                 end
  1204.                             end
  1205.                             for i = 1, heroManager.iCount, 1 do
  1206.                                 currentHero = heroManager:GetHero(i)
  1207.                                 if currentHero.team == myHero.team and skillShotChampion.charName == currentHero.charName then
  1208.                                     return
  1209.                                 end
  1210.                             end
  1211.                            
  1212.                             if GoodEvadeSkillshotConfig[tostring(skillshot.name)] == 2 or (GoodEvadeSkillshotConfig[tostring(skillshot.name)] == 1 and nEnemies <= 2 and not (GoodEvadeConfig.dodgeCConly or GoodEvadeConfig.dodgeCConly2)) then
  1213.                                 if skillshot.type == "line" then
  1214.                                     if(skillshotToAdd ~= nil) then
  1215.                                         skillshotToAdd2 = {object = object, startPosition = nil, endPosition = nil, directionVector = nil, startTick = GetTickCount(), endTick = GetTickCount() + skillshot.range/skillshot.projectileSpeed*1000, skillshot = skillshot, evading = false, drawit = true, alreadydashed = false}
  1216.                                     else
  1217.                                         skillshotToAdd = {object = object, startPosition = nil, endPosition = nil, directionVector = nil, startTick = GetTickCount(), endTick = GetTickCount() + skillshot.range/skillshot.projectileSpeed*1000, skillshot = skillshot, evading = false, drawit = true, alreadydashed = false}
  1218.                                     end
  1219.                                     elseif skillshot.type == "circular" then
  1220.                                     endPosition = Point2(object.x, object.z)
  1221.                                     startPosition = Point2(object.x, object.z)
  1222.                                     table.insert(detectedSkillshots, {startPosition = startPosition, endPosition = endPosition,
  1223.                                     directionVector = (endPosition - startPosition):normalized(), startTick = GetTickCount() + skillshot.spellDelay,
  1224.                                     endTick = GetTickCount() + skillshot.spellDelay + skillshot.projectileSpeed, skillshot = skillshot, evading = false, drawit = false, alreadydashed = false})
  1225.                                 end
  1226.                             end
  1227.                         end
  1228.                         return
  1229.                     end
  1230.                 end
  1231.             end
  1232.         end
  1233.     end
  1234. end
  1235. function OnAnimation(unit, animationName)
  1236.         if CastingSpell == true then
  1237.         if unit.isMe and (animationName == "Idle1" or animationName == "Run") then CastingSpell = false end
  1238.     end
  1239. end
  1240.  
  1241. function OnProcessSpell(unit, spell)
  1242.         if unit.isMe and myHero.charName == "MasterYi" and spell.name == myHero:GetSpellData(_W).name then
  1243.         CastingSpell = true
  1244.         elseif unit.isMe and myHero.charName == "Nunu" and spell.name == myHero:GetSpellData(_R).name then
  1245.         CastingSpell = true
  1246.         elseif unit.isMe and myHero.charName == "MissFortune" and spell.name == myHero:GetSpellData(_R).name then
  1247.         CastingSpell = true
  1248.         elseif unit.isMe and myHero.charName == "Malzahar" and spell.name == myHero:GetSpellData(_R).name then
  1249.         CastingSpell = true
  1250.         elseif unit.isMe and myHero.charName == "Katarina" and spell.name == myHero:GetSpellData(_R).name then
  1251.         CastingSpell = true
  1252.         elseif unit.isMe and myHero.charName == "Janna" and spell.name == myHero:GetSpellData(_R).name then
  1253.         CastingSpell = true
  1254.         elseif unit.isMe and myHero.charName == "Galio" and spell.name == myHero:GetSpellData(_R).name then
  1255.         CastingSpell = true
  1256.         elseif unit.isMe and myHero.charName == "FiddleSticks" and spell.name == myHero:GetSpellData(_W).name then
  1257.         CastingSpell = true
  1258.         elseif unit.isMe and myHero.charName == "FiddleSticks" and spell.name == myHero:GetSpellData(_R).name then
  1259.         CastingSpell = true
  1260.     end
  1261.     if unit.isMe and isLeblanc then
  1262.         if spell.name == myHero:GetSpellData(_Q).name then lastspell = "Q"
  1263.             elseif spell.name == myHero:GetSpellData(_W).name then lastspell = "W"
  1264.             elseif spell.name == myHero:GetSpellData(_E).name then lastspell = "E"
  1265.         end
  1266.     end
  1267.     if not myHero.dead and unit.team ~= myHero.team then
  1268.         for i, skillShotChampion in pairs(champions) do
  1269.             if skillShotChampion.charName == unit.charName then
  1270.                 for i, skillshot in pairs(skillShotChampion.skillshots) do
  1271.                     if skillshot.spellName == spell.name then
  1272.                         startPosition = Point2(spell.startPos.x, spell.startPos.z)
  1273.                         endPosition = Point2(spell.endPos.x, spell.endPos.z)
  1274.                         if isOrianna and unit.charName == "Orianna" then
  1275.                             ball = nil
  1276.                             for i = 1, objManager.maxObjects, 1 do
  1277.                                 local obj = objManager:GetObject(i)
  1278.                                 CheckBall(obj)
  1279.                             end
  1280.                             if ball ~= nil then
  1281.                                 startPosition = Point2(ball.x, ball.z)
  1282.                                 if skillshot.spellName == "OrianaDetonateCommand" then
  1283.                                     endPosition = Point2(ball.x, ball.z)
  1284.                                 end
  1285.                             end
  1286.                         end
  1287.                         directionVector = (endPosition - startPosition):normalized()
  1288.                         if isOrianna and unit.charName == "Orianna" then
  1289.                             if skillshot.spellName == "OrianaIzunaCommand" then skillshot.range = startPosition:distance(endPosition) end
  1290.                         end
  1291.                         if GoodEvadeSkillshotConfig[tostring(skillshot.name)] == 2 or (GoodEvadeSkillshotConfig[tostring(skillshot.name)] == 1 and nEnemies <= 2 and not (GoodEvadeConfig.dodgeCConly or GoodEvadeConfig.dodgeCConly2)) then
  1292.                             if skillshot.type == "line" then
  1293.                                 table.insert(detectedSkillshots, {startPosition = startPosition, endPosition = startPosition + directionVector * skillshot.range,
  1294.                                 directionVector = directionVector, startTick = GetTickCount() + skillshot.spellDelay,
  1295.                                 endTick = GetTickCount() + skillshot.spellDelay + skillshot.range/skillshot.projectileSpeed*1000, skillshot = skillshot, evading = false, drawit = true, alreadydashed = false})
  1296.                                 elseif skillshot.type == "circular" then
  1297.                                 table.insert(detectedSkillshots, {startPosition = startPosition, endPosition = endPosition,
  1298.                                 directionVector = directionVector, startTick = GetTickCount() + skillshot.spellDelay,
  1299.                                 endTick = GetTickCount() + skillshot.spellDelay + skillshot.projectileSpeed, skillshot = skillshot, evading = false, drawit = true, alreadydashed = false})
  1300.                             else
  1301.                                 local ssrange = endPosition:distance(startPosition)
  1302.                                 table.insert(detectedSkillshots, {startPosition = startPosition, endPosition = endPosition,
  1303.                                 directionVector = directionVector, startTick = GetTickCount() + skillshot.spellDelay,
  1304.                                 endTick = GetTickCount() + skillshot.spellDelay + (skillshot.projectileSpeed * (ssrange/skillshot.range)), skillshot = skillshot, evading = false, drawit = true, alreadydashed = false})
  1305.                             end
  1306.                         end
  1307.                         return
  1308.                     end
  1309.                 end
  1310.             end
  1311.         end
  1312.     end
  1313. end
  1314.  
  1315. function skillshotPosition(skillshot, tickCount)
  1316.         if skillshot.skillshot.type == "line" then
  1317.         return skillshot.startPosition + skillshot.directionVector * math.max(tickCount - skillshot.startTick, 0) * skillshot.skillshot.projectileSpeed / 1000
  1318.     else
  1319.         return skillshot.endPosition
  1320.     end
  1321. end
  1322.  
  1323. function skillshotHasPassed(skillshot, coordinate)
  1324.     footOfPerpendicular = getPerpendicularFootpoint(skillshot.startPosition, skillshot.endPosition, coordinate)
  1325.     currentSkillshotPosition = skillshotPosition(skillshot, GetTickCount() - 2 * GetLatency())
  1326.     side1 = getSideOfLine(coordinate, footOfPerpendicular, currentSkillshotPosition)
  1327.     side2 =  getSideOfLine(coordinate, footOfPerpendicular, skillshot.startPosition)
  1328.     return side1 ~= side2 and currentSkillshotPosition:distance(footOfPerpendicular) >= (skillshot.skillshot.radius + hitboxSize / 2)
  1329. end
  1330.  
  1331. function getPerpendicularFootpoint(linePoint1, linePoint2, point)
  1332.     distanceFromLine = Line2(linePoint1, linePoint2):distance(point)
  1333.     directionVector = (linePoint2 - linePoint1):normalized()
  1334.    
  1335.     footOfPerpendicular = point + Point2(-directionVector.y, directionVector.x) * distanceFromLine
  1336.     if Line2(linePoint1, linePoint2):distance(footOfPerpendicular) > distanceFromLine then
  1337.         footOfPerpendicular = point - Point2(-directionVector.y, directionVector.x) * distanceFromLine
  1338.     end
  1339.    
  1340.     return footOfPerpendicular
  1341. end
  1342.  
  1343. function OnTick()
  1344.         if GoodEvadeConfig.freemovementblock then
  1345.         if evading and not alreadywritten then
  1346.             local file = io.open(thatfile, "w")
  1347.             file:write("1")
  1348.             file:close()
  1349.             alreadywritten = true
  1350.             elseif not evading and alreadywritten then
  1351.             local file = io.open(thatfile, "w")
  1352.             file:write("0")
  1353.             file:close()
  1354.             alreadywritten = false
  1355.         end
  1356.         if not wrotedisclaimer then
  1357.             PrintChat("<font color=\"#FF0000\" >You just enabled free user movement block, this function will only work if you followed tutorial in main thread of the script before allowing it.</font>")
  1358.             wrotedisclaimer = true
  1359.         end
  1360.     end
  1361.     if skillshotToAdd ~= nil and skillshotToAdd.object ~= nil and skillshotToAdd.object.valid and (GetTickCount() - skillshotToAdd.startTick) >= GoodEvadeConfig.fowdelay and skillshotToAdd.startPosition == nil then
  1362.             skillshotToAdd.startPosition = Point2(skillshotToAdd.object.x, skillshotToAdd.object.z)
  1363.         elseif skillshotToAdd ~= nil and skillshotToAdd.object ~= nil and skillshotToAdd.object.valid and (GetTickCount() - skillshotToAdd.startTick) >= (GoodEvadeConfig.fowdelay+1) then
  1364.             skillshotToAdd.directionVector = (Point2(skillshotToAdd.object.x, skillshotToAdd.object.z) - skillshotToAdd.startPosition):normalized()
  1365.             skillshotToAdd.endPosition = skillshotToAdd.startPosition + skillshotToAdd.directionVector * skillshotToAdd.skillshot.range        
  1366.             table.insert(detectedSkillshots, skillshotToAdd)
  1367.             skillshotToAdd = nil
  1368.     end
  1369.     if skillshotToAdd2 ~= nil and skillshotToAdd2.object ~= nil and skillshotToAdd2.object.valid and (GetTickCount() - skillshotToAdd2.startTick) >= GoodEvadeConfig.fowdelay and skillshotToAdd2.startPosition == nil then
  1370.             skillshotToAdd2.startPosition = Point2(skillshotToAdd2.object.x, skillshotToAdd2.object.z)
  1371.         elseif skillshotToAdd2 ~= nil and skillshotToAdd2.object ~= nil and skillshotToAdd2.object.valid and (GetTickCount() - skillshotToAdd2.startTick) >= (GoodEvadeConfig.fowdelay+1) then
  1372.             skillshotToAdd2.directionVector = (Point2(skillshotToAdd2.object.x, skillshotToAdd2.object.z) - skillshotToAdd2.startPosition):normalized()
  1373.             skillshotToAdd2.endPosition = skillshotToAdd2.startPosition + skillshotToAdd2.directionVector * skillshotToAdd2.skillshot.range        
  1374.             table.insert(detectedSkillshots, skillshotToAdd2)
  1375.             skillshotToAdd2 = nil
  1376.     end
  1377.     if(hiu ~= nil) then
  1378.         if(huiNum ~= 2) then
  1379.             hiuNum = hiuNum + 1
  1380.         else
  1381.             local hiu1
  1382.             local hiu2
  1383.             local hero
  1384.            
  1385.             for i = 1, heroManager.iCount do
  1386.                 hero = heroManager:GetHero(i)
  1387.                 if hero.team ~= myHero.team then
  1388.                     if(hero.charName == "Xerath") then
  1389.                         break
  1390.                     end
  1391.                 end
  1392.             end
  1393.            
  1394.             for selectedHiu in pairs(hiu) do
  1395.                
  1396.                 if(hiu1 == nil) then
  1397.                     hiu1 = selectedHiu
  1398.                 else
  1399.                     if(hero:GetDistance(Point2(selectedHiu.x, selectedHiu.z) < hero:GetDistance(Point2(hiu1.x, hiu1.z)))) then
  1400.                         hiu1 = selectedHiu
  1401.                     end
  1402.                 end
  1403.             end
  1404.            
  1405.             for selectedHiu in pairs(hiu) do
  1406.                
  1407.                 if(hiu2 == nil) then
  1408.                     hiu2 = selectedHiu
  1409.                 else
  1410.                     if(hero:GetDistance(Point2(selectedHiu.x, selectedHiu.z) > hero:GetDistance(Point2(hiu2.x, hiu2.z)))) then
  1411.                         hiu2 = selectedHiu
  1412.                     end
  1413.                 end
  1414.             end
  1415.         end
  1416.        
  1417.         if(hiu1 ~= nil and hiu2 ~=nil) then
  1418.             local range = math.sqrt((hiu2.x - hiu1.x) ^ 2 + (hiu2.z - hiu1.z) ^ 2)
  1419.             champions2["Xerath"].skillshots["Xerath Arcanopulse"].range = range
  1420.             table.insert(detectedSkillshots, {
  1421.                          startPosition = Point2(hiu1.x, hiu1.z),
  1422.                          endPosition = Point2(hiu1.x, hiu1.z)  + (Point2(hiu2.x, hiu2.z) - Point2(hiu1.x,hiu1.z)):normalized() * range,
  1423.                          directionVector = (Point2(hiu2.x, hiu2.z) - Point2(hiu1.x, hiu1.z)):normalized(),
  1424.                          startTick = GetTickCount(),
  1425.                          endTick = GetTickCount() + range/25000*1000,
  1426.                          skillshot = champions2["Xerath"].skillshots["Xerath Arcanopulse"],
  1427.                          evading = false,
  1428.                          drawit = true,
  1429.                          alreadydashed = false})
  1430.                          hiu = nil
  1431.                          hiuNum = nil
  1432.         end
  1433.        
  1434.     end
  1435.     if shieldtick ~= nil then
  1436.         if GetTickCount() >= shieldtick then
  1437.             if haveShield() then
  1438.                 if isSivir then
  1439.                     CastSpell(_E)
  1440.                     elseif isNocturne then
  1441.                     CastSpell(_W)
  1442.                 end
  1443.                 else shieldtick = nil
  1444.             end
  1445.         end
  1446.     end
  1447.     if evading then
  1448.         for i, detectedSkillshot in pairs(detectedSkillshots) do
  1449.             if detectedSkillshot and detectedSkillshot.evading and inDangerousArea(detectedSkillshot, Point2(myHero.x, myHero.z)) then
  1450.                 dodgeSkillshot(detectedSkillshot)
  1451.             end
  1452.         end
  1453.     end
  1454.     if haveflash then
  1455.         if myHero:CanUseSpell(flashSlot) == READY then
  1456.             flashready = true
  1457.             else flashready = false
  1458.         end
  1459.     end
  1460.     if GoodEvadeConfig.resetdodge then
  1461.         stopEvade()
  1462.         detectedSkillshots = {}
  1463.     end
  1464.     if AutoCarry ~= nil then
  1465.         if AutoCarry.MainMenu ~= nil then
  1466.             if AutoCarry.MainMenu.AutoCarry or AutoCarry.MainMenu.LastHit or AutoCarry.MainMenu.MixedMode or AutoCarry.MainMenu.LaneClear
  1467.                 then
  1468.                 if not bufferset then
  1469.                     currentbuffer = GoodEvadeConfig.evadeBuffer
  1470.                     bufferset = true
  1471.                 end
  1472.                 if not VIP_USER then
  1473.                     if lastset < GetTickCount()
  1474.                         then lastMovement.destination = Point2(mousePos.x, mousePos.z)
  1475.                         lastset = GetTickCount() + 100
  1476.                     end
  1477.                 end
  1478.             end
  1479.             elseif AutoCarry.Keys ~= nil then
  1480.             if AutoCarry.Keys.AutoCarry or AutoCarry.Keys.MixedMode or AutoCarry.Keys.LastHit or AutoCarry.Keys.LaneClear then
  1481.                 if not bufferset then
  1482.                     currentbuffer = GoodEvadeConfig.evadeBuffer
  1483.                     bufferset = true
  1484.                 end
  1485.                 if not VIP_USER then
  1486.                     if lastset < GetTickCount()
  1487.                         then lastMovement.destination = Point2(mousePos.x, mousePos.z)
  1488.                         lastset = GetTickCount() + 100
  1489.                     end
  1490.                 end
  1491.             end
  1492.         end
  1493.         elseif MMA_Loaded ~= nil then
  1494.         if _G.MMA_Orbwalker or _G.MMA_HybridMode or _G.MMA_LaneClear or _G.MMA_LastHit then
  1495.             if not bufferset then
  1496.                 currentbuffer = GoodEvadeConfig.evadeBuffer
  1497.                 bufferset = true
  1498.             end
  1499.             if not VIP_USER then
  1500.                 if lastset < GetTickCount()
  1501.                     then lastMovement.destination = Point2(mousePos.x, mousePos.z)
  1502.                     lastset = GetTickCount() + 100
  1503.                 end
  1504.             end
  1505.         end
  1506.     end
  1507.     nSkillshots = 0
  1508.     for _, detectedSkillshot in pairs(detectedSkillshots) do
  1509.         if detectedSkillshot then nSkillshots = nSkillshots + 1 end
  1510.     end
  1511.    
  1512.     if not allowCustomMovement and nSkillshots == 0 then
  1513.         stopEvade()
  1514.     end
  1515.    
  1516.     hitboxSize = hitboxTable[GetMyHero().charName]
  1517.    
  1518.     if hitboxSize == nil then
  1519.         hitboxSize = 80.0
  1520.     end
  1521.    
  1522.     nEnemies = CountEnemyHeroInRange(1500)
  1523.     table.sort(enemyes, function(x,y) return GetDistance(x) < GetDistance(y) end)
  1524.    
  1525.    
  1526.     heroPosition = Point2(myHero.x, myHero.z)
  1527.     for i, detectedSkillshot in ipairs(detectedSkillshots) do
  1528.         if detectedSkillshot.endTick <= GetTickCount() then
  1529.             table.remove(detectedSkillshots, i)
  1530.             i = i-1
  1531.             if(detectedSkillshot.skillshot.name == "BoomerangBlade" and detectedSkillshot.done ~= true) then
  1532.                 directionVector = (detectedSkillshot.startPosition - detectedSkillshot.endPosition):normalized()
  1533.                 newSkillshot = {startPosition = detectedSkillshot.endPosition, endPosition = detectedSkillshot.startPosition,
  1534.                                 directionVector = directionVector, startTick = GetTickCount(),
  1535.                                 endTick = GetTickCount() + detectedSkillshot.skillshot.range/detectedSkillshot.skillshot.projectileSpeed*1000, skillshot = detectedSkillshot.skillshot, evading = detectedSkillshot.evading, drawit = true, alreadydashed = detectedSkillshot.alreadydashed, done = true}
  1536.                
  1537.                 table.insert(detectedSkillshots, newSkillshot)
  1538.             end
  1539.            
  1540.             if detectedSkillshot.evading then
  1541.                 continueMovement(detectedSkillshot)
  1542.             end
  1543.         else
  1544.             if evading then
  1545.                 if detectedSkillshot.evading and not inDangerousArea(detectedSkillshot, heroPosition) then
  1546.                     if detectedSkillshot.skillshot.type == "line" then
  1547.                        
  1548.                         side1 = getSideOfLine(detectedSkillshot.startPosition, detectedSkillshot.endPosition, heroPosition)
  1549.                         side2 = getSideOfLine(detectedSkillshot.startPosition, detectedSkillshot.endPosition, getLastMovementDestination())
  1550.                         if skillshotHasPassed(detectedSkillshot, heroPosition) then
  1551.                             continueMovement(detectedSkillshot)
  1552.                            
  1553.                             elseif not inDangerousArea(detectedSkillshot, getLastMovementDestination()) and (side1 == side2) and (side1 ~= 0) then
  1554.                             continueMovement(detectedSkillshot)
  1555.                            
  1556.                             elseif not inRange(detectedSkillshot, heroPosition) and not inRange(detectedSkillshot, getLastMovementDestination()) then
  1557.                             continueMovement(detectedSkillshot)
  1558.                            
  1559.                             elseif lastMovement.approachedPoint ~= getLastMovementDestination() then
  1560.                             footpoint = getPerpendicularFootpoint(detectedSkillshot.startPosition, detectedSkillshot.endPosition, getLastMovementDestination())
  1561.                             closestSafePoint = footpoint + Point2(-detectedSkillshot.directionVector.y, detectedSkillshot.directionVector.x) * (detectedSkillshot.skillshot.radius + hitboxSize / 2 + GoodEvadeConfig.evadeBuffer + moveBuffer)
  1562.                             if (getSideOfLine(detectedSkillshot.startPosition, detectedSkillshot.endPosition, heroPosition) ~= getSideOfLine(detectedSkillshot.startPosition, detectedSkillshot.endPosition, closestSafePoint)) then
  1563.                                 closestSafePoint = footpoint - Point2(-detectedSkillshot.directionVector.y, detectedSkillshot.directionVector.x) * (detectedSkillshot.skillshot.radius + hitboxSize / 2 + GoodEvadeConfig.evadeBuffer + moveBuffer)
  1564.                             end
  1565.                            
  1566.                             captureMovements = false
  1567.                             allowCustomMovement = true
  1568.                     if skillshot ~= nil then
  1569.                         if skillshot.spellName ~= nil then
  1570.                             if GoodEvadeSkillshotConfig[tostring(skillshot.name)] == 2 and (nSkillshots > 1) and NeedDash(skillshot, true) then
  1571.                                 DashTo(closestSafePoint.x, closestSafePoint.y)
  1572.                             end
  1573.                         end
  1574.                                 myHero:MoveTo(closestSafePoint.x, closestSafePoint.y)
  1575.                                 lastMovement.moveCommand = Point2(closestSafePoint.x, closestSafePoint.y)
  1576.                                 allowCustomMovement = false
  1577.                                 captureMovements = true
  1578.                                
  1579.                                 lastMovement.approachedPoint = getLastMovementDestination()
  1580.                             end
  1581.                         end
  1582.                     else
  1583.                         evadeRadius = detectedSkillshot.skillshot.radius + hitboxSize / 2 + GoodEvadeConfig.evadeBuffer + moveBuffer
  1584.                         directionVector = (heroPosition - detectedSkillshot.endPosition):normalized()
  1585.                         tangentDirectionVector = Point2(-directionVector.y, directionVector.x)
  1586.                         movementTargetSideOfLine = getSideOfLine(heroPosition, heroPosition + tangentDirectionVector, getLastMovementDestination())
  1587.                         skillshotSideOfLine = getSideOfLine(heroPosition, heroPosition + tangentDirectionVector, detectedSkillshot.endPosition)
  1588.                        
  1589.                         if movementTargetSideOfLine == 0 or movementTargetSideOfLine ~= skillshotSideOfLine then
  1590.                             continueMovement(detectedSkillshot)
  1591.                         else
  1592.                             if getLastMovementDestination():distance(detectedSkillshot.endPosition) <= evadeRadius then
  1593.                                 closestTarget = detectedSkillshot.endPosition + (getLastMovementDestination() - detectedSkillshot.endPosition):normalized() * evadeRadius
  1594.                             else
  1595.                                 closestTarget = nil
  1596.                             end
  1597.                            
  1598.                             dx = detectedSkillshot.endPosition.x - heroPosition.x
  1599.                             dy = detectedSkillshot.endPosition.y - heroPosition.y
  1600.                             D_squared = dx * dx + dy * dy
  1601.                             if D_squared < evadeRadius * evadeRadius then
  1602.                                 safePoint1 = heroPosition - tangentDirectionVector * (evadeRadius / 2 + smoothing)
  1603.                                 safePoint2 = heroPosition + tangentDirectionVector * (evadeRadius / 2 + smoothing)
  1604.                             else
  1605.                                 intersectionPoints = Circle2(detectedSkillshot.endPosition, evadeRadius):intersectionPoints(Circle2(heroPosition, math.sqrt(D_squared - evadeRadius * evadeRadius)))
  1606.                                 if #intersectionPoints == 2 then
  1607.                                     safePoint1 = heroPosition - (heroPosition - intersectionPoints[1]):normalized() * (evadeRadius / 2 + smoothing)
  1608.                                     safePoint2 = heroPosition - (heroPosition - intersectionPoints[2]):normalized() * (evadeRadius / 2 + smoothing)
  1609.                                 else
  1610.                                     safePoint1 = heroPosition - tangentDirectionVector * (evadeRadius / 2 + smoothing)
  1611.                                     safePoint2 = heroPosition + tangentDirectionVector * (evadeRadius / 2 + smoothing)
  1612.                                 end
  1613.                             end
  1614.                            
  1615.                             local theta = ((-detectedSkillshot.endPosition + safePoint2):polar() - (-detectedSkillshot.endPosition + safePoint1):polar()) % 360
  1616.                             if closestTarge and (
  1617.                                 (
  1618.                                 theta < 180 and (
  1619.                                 getSideOfLine(detectedSkillshot.endPosition, safePoint2, closestTarget) == getSideOfLine(detectedSkillshot.endPosition, safePoint2, heroPosition) and
  1620.                                 getSideOfLine(detectedSkillshot.endPosition, safePoint1, closestTarget) == getSideOfLine(detectedSkillshot.endPosition, safePoint1, heroPosition)
  1621.                                 )
  1622.                                 ) or (
  1623.                                 theta > 180 and (
  1624.                                 getSideOfLine(detectedSkillshot.endPosition, safePoint2, closestTarget) == getSideOfLine(detectedSkillshot.endPosition, safePoint2, heroPosition) or
  1625.                                 getSideOfLine(detectedSkillshot.endPosition, safePoint1, closestTarget) == getSideOfLine(detectedSkillshot.endPosition, safePoint1, heroPosition)
  1626.                                 )
  1627.                                 )
  1628.                                 ) then
  1629.                                 possibleMovementTargets = {closestTarget, safePoint1, safePoint2}
  1630.                             else
  1631.                                 possibleMovementTargets = {safePoint1, safePoint2}
  1632.                             end
  1633.                            
  1634.                             closestPoint = findBestDirection(skillshot,getLastMovementDestination(), possibleMovementTargets)
  1635.                             if closestPoint ~= nil then
  1636.                                 captureMovements = false
  1637.                                 allowCustomMovement = true
  1638.                             if skillshot ~= nil then if skillshot.spellName ~= nil then if GoodEvadeSkillshotConfig[tostring(skillshot.name)] == 2 and (nSkillshots > 1) and NeedDash(skillshot, true) then DashTo(closestPoint.x, closestPoint.y) end
  1639.                                         myHero:MoveTo(closestPoint.x, closestPoint.y)
  1640.                                         lastMovement.moveCommand = Point2(closestPoint.x, closestPoint.y)
  1641.                                         allowCustomMovement = false
  1642.                                         captureMovements = true
  1643.                                     end
  1644.                                 end
  1645.                             end
  1646.                         end
  1647.                     end
  1648.                 end
  1649.                 elseif inDangerousArea(detectedSkillshot, heroPosition) then
  1650.                 dodgeSkillshot(detectedSkillshot)
  1651.             end
  1652.         end
  1653.     end
  1654. end
  1655.  
  1656. function DashTo(x, y)
  1657.         if GoodEvadeConfig.usedashes then
  1658.         if isVayne and  myHero:CanUseSpell(_Q) == READY then
  1659.             CastSpell(_Q, x, y)
  1660.             elseif isRiven and  myHero:CanUseSpell(_E) == READY then
  1661.             CastSpell(_E, x, y)
  1662.             elseif isGraves and myHero:CanUseSpell(_E) == READY then
  1663.             CastSpell(_E, x, y)
  1664.             elseif isEzreal and myHero:CanUseSpell(_E) == READY then
  1665.             CastSpell(_E, x, y)
  1666.             elseif isKassadin and myHero:CanUseSpell(_R) == READY then
  1667.             CastSpell(_R, x, y)
  1668.             elseif isLeblanc and myHero:CanUseSpell(_W) == READY then
  1669.             CastSpell(_W, x, y)
  1670.             elseif isLeblanc and myHero:CanUseSpell(_R) == READY and lastspell == "W" then
  1671.             CastSpell(_R, x, y)
  1672.             elseif isFizz and myHero:CanUseSpell(_E) == READY then
  1673.             CastSpell(_E, x, y)
  1674.             elseif isShaco and myHero:CanUseSpell(_Q) == READY then
  1675.             CastSpell(_Q, x, y)
  1676.             elseif isCorki and myHero:CanUseSpell(_W) == READY then
  1677.             CastSpell(_W, x, y)
  1678.             elseif isRenekton and myHero:CanUseSpell(_E) == READY then
  1679.             CastSpell(_E, x, y)
  1680.             elseif isLucian and myHero:CanUseSpell(_E) == READY then
  1681.             CastSpell(_E, x, y)
  1682.             elseif haveflash and flashready and useflash and GoodEvadeConfig.useSummonerFlash then
  1683.             CastSpell(flashSlot, x, y)
  1684.             useflash = false
  1685.             elseif isCaitlyn and myHero:CanUseSpell(_E) == READY then
  1686.             myPos = Point2(myHero.x, myHero.z)
  1687.             castpos = myPos + (myPos - (Point2(x, y)))
  1688.             CastSpell(_E, castpos.x, castpos.y)
  1689.             elseif isTristana and myHero:CanUseSpell(_W) == READY then
  1690.             CastSpell(_W, x, y)
  1691.             elseif isShen and myHero:CanUseSpell(_E) == READY then
  1692.             CastSpell(_E, x, y)
  1693.             elseif isTryndamere and myHero:CanUseSpell(_E) == READY then
  1694.             CastSpell(_E, x, y)
  1695.         end  
  1696.     end                          
  1697. end
  1698. function NeedDash(skillshot, forceDash)
  1699.         if GoodEvadeConfig.usedashes then
  1700.         useflash = false
  1701.         local hp = myHero.health / myHero.maxHealth
  1702.         if isVayne and myHero:CanUseSpell(_Q) == READY and skillshot.skillshot.cc == "true" then
  1703.             if forceDash or hp < 0.4 then
  1704.                 dashrange = 300
  1705.             return true end
  1706.             if nSkillshots > 1 or _isDangerSkillshot(skillshot) then
  1707.                 dashrange = 300
  1708.             return true end
  1709.             elseif isRiven and myHero:CanUseSpell(_E) == READY and skillshot.skillshot.cc == "true" then
  1710.             if forceDash or hp < 0.4 then
  1711.                 dashrange = 325
  1712.             return true end
  1713.             if nSkillshots > 1 or _isDangerSkillshot(skillshot) then
  1714.                 dashrange = 325
  1715.             return true end
  1716.             elseif isGraves and myHero:CanUseSpell(_E) == READY and skillshot.skillshot.cc == "true" then
  1717.             if forceDash or hp < 0.4 then
  1718.                 dashrange = 425
  1719.             return true end
  1720.             if _isDangerSkillshot(skillshot) then
  1721.                 dashrange = 425
  1722.             return true end
  1723.             if _isDangerSkillshot(skillshot) then
  1724.                 dashrange = 660
  1725.             return true end
  1726.             elseif isShaco and myHero:CanUseSpell(_Q) == READY and skillshot.skillshot.cc == "true" then
  1727.             if skillshot or hp < 0.4 then
  1728.                 dashrange = 400
  1729.             return true end
  1730.             if _isDangerSkillshot(skillshot) then
  1731.                 dashrange = 400
  1732.             return true end
  1733.             elseif isEzreal and myHero:CanUseSpell(_E) == READY and skillshot.skillshot.cc == "true" then
  1734.             if forceDash or hp < 0.4 then
  1735.                 dashrange = 450
  1736.             return true end
  1737.             if _isDangerSkillshot(skillshot) then
  1738.                 dashrange = 450
  1739.             return true end
  1740.             elseif isFizz and myHero:CanUseSpell(_E) == READY and skillshot.skillshot.cc == "true" then
  1741.             if skillshot or hp < 0.4 then
  1742.                 dashrange = 400
  1743.             return true end
  1744.             if _isDangerSkillshot(skillshot) then
  1745.                 dashrange = 400
  1746.             return true end
  1747.             elseif isKassadin and myHero:CanUseSpell(_R) == READY and skillshot.skillshot.cc == "true" then
  1748.             if forceDash or hp < 0.4 then
  1749.                 dashrange = 700
  1750.             return true end
  1751.             if _isDangerSkillshot(skillshot) then
  1752.                 dashrange = 700
  1753.             return true end
  1754.             elseif isLeblanc and myHero:CanUseSpell(_W) == READY and skillshot.skillshot.cc == "true" then
  1755.             if forceDash or hp < 0.4 then
  1756.                 dashrange = 600
  1757.             return true end
  1758.             if _isDangerSkillshot(skillshot) then
  1759.                 dashrange = 600
  1760.             return true end
  1761.             elseif isLeblanc and myHero:CanUseSpell(_R) == READY and skillshot.skillshot.cc == "true" and lastspell == "W" then
  1762.             if forceDash or hp < 0.4 then
  1763.                 dashrange = 600
  1764.             return true end
  1765.             if _isDangerSkillshot(skillshot) then
  1766.                 dashrange = 600
  1767.             return true end
  1768.             elseif isRenekton and myHero:CanUseSpell(_E) == READY and skillshot.skillshot.cc == "true" then
  1769.             if forceDash or hp < 0.4 then
  1770.                 dashrange = 450
  1771.             return true end
  1772.             if _isDangerSkillshot(skillshot) then
  1773.                 dashrange = 450
  1774.             return true end
  1775.             elseif isCorki and myHero:CanUseSpell(_W) == READY and skillshot.skillshot.cc == "true" then
  1776.             if _isDangerSkillshot(skillshot) then
  1777.                 dashrange = 800
  1778.             return true end
  1779.             elseif isLucian and myHero:CanUseSpell(_E) == READY and skillshot.skillshot.cc == "true" then
  1780.             if forceDash or hp < 0.4 then
  1781.                 dashrange = 425
  1782.             return true end
  1783.             if _isDangerSkillshot(skillshot) then
  1784.                 dashrange = 425
  1785.             return true end
  1786.             elseif GoodEvadeConfig.useSummonerFlash and haveflash and flashready and isreallydangerous(skillshot) then
  1787.             dashrange = 400
  1788.             useflash = true
  1789.             return true
  1790.             elseif isTryndamere and myHero:CanUseSpell(_E) == READY and skillshot.skillshot.cc == "true" then
  1791.             if forceDash or hp < 0.4 then
  1792.                 dashrange = 660
  1793.             return true end
  1794.             elseif isCaitlyn and myHero:CanUseSpell(_E) == READY and skillshot.skillshot.cc == "true" then
  1795.             if forceDash or hp < 0.4 then
  1796.                 dashrange = 400
  1797.             return true end
  1798.             elseif isTristana and myHero:CanUseSpell(_W) == READY and skillshot.skillshot.cc == "true" then
  1799.             if _isDangerSkillshot(skillshot) then
  1800.                 dashrange = 900
  1801.             return true end
  1802.             elseif isShen and myHero:CanUseSpell(_E) == READY and skillshot.skillshot.cc == "true" then
  1803.             if forceDash or hp < 0.4 then
  1804.                 dashrange = 600
  1805.             return true end
  1806.             if _isDangerSkillshot(skillshot) then
  1807.                 dashrange = 600
  1808.             return true end
  1809.         end                              
  1810.         return false
  1811.     end
  1812. end
  1813.  
  1814. function evadeTo(x, y, forceDash)
  1815.     startEvade()
  1816.     evadePoint = Point2(x, y)
  1817.     allowCustomMovement = true
  1818.     captureMovements = false
  1819.     if forceDash then
  1820.         local evadePos = Point2(x, y)
  1821.         local myPos = Point2(myHero.x, myHero.z)
  1822.         local ourdistance = evadePos:distance(myPos)
  1823.         local dashPos = myPos - (myPos - evadePos):normalized() * dashrange
  1824.         DashTo(dashPos.x, dashPos.y)
  1825.     end    
  1826.     myHero:MoveTo(x, y)
  1827.     lastMovement.moveCommand = Point2(x, y)
  1828.     captureMovements = true
  1829.     allowCustomMovement = false
  1830.     evading = true
  1831.     evadingTick = GetTickCount()
  1832. end
  1833.  
  1834. function continueMovement(skillshot)
  1835.         if VIP_USER then
  1836.         if evading then
  1837.             skillshot.evading = false
  1838.             lastMovement.approachedPoint = nil
  1839.            
  1840.             stopEvade()
  1841.            
  1842.             if lastMovement.type == 2 then
  1843.                 captureMovements = false
  1844.                 myHero:MoveTo(getLastMovementDestination().x, getLastMovementDestination().y)
  1845.                 captureMovements = true
  1846.             elseif lastMovement.type == 3 then
  1847.                 target = getTarget(lastMovement.targetId)
  1848.                
  1849.                 if _isValidTarget(target) then
  1850.                     captureMovements = false
  1851.                     myHero:Attack(target)
  1852.                     captureMovements = true
  1853.                 else
  1854.                     captureMovements = false
  1855.                     myHero:MoveTo(myHero.x, myHero.z)
  1856.                     captureMovements = true
  1857.                 end
  1858.             elseif lastMovement.type == 10 then
  1859.                 myHero:HoldPosition()
  1860.             elseif lastMovement.type == 7 then
  1861.                 lastMovement.type = 3
  1862.             end
  1863.         end
  1864.         elseif evading then
  1865.         skillshot.evading = false
  1866.         lastMovement.approachedPoint = nil
  1867.         stopEvade()    
  1868.         if continuetarget == nil then
  1869.             captureMovements = false
  1870.             myHero:MoveTo(getLastMovementDestination().x, getLastMovementDestination().y)
  1871.             captureMovements = true
  1872.             elseif continuetarget ~= nil then
  1873.             target = continuetarget
  1874.             if _isValidTarget(target) then
  1875.                 captureMovements = false
  1876.                 myHero:Attack(target)
  1877.                 captureMovements = true
  1878.             else
  1879.                 captureMovements = false
  1880.                 myHero:MoveTo(myHero.x, myHero.z)
  1881.                 captureMovements = true
  1882.             end
  1883.         end
  1884.     end
  1885. end
  1886.  
  1887. function drawLineshit(point1, point2, color, width)
  1888.     apoint = WorldToScreen(D3DXVECTOR3(point1.x, 0, point1.y))
  1889.     bpoint = WorldToScreen(D3DXVECTOR3(point2.x, 0, point2.y))
  1890.    
  1891.    
  1892.     DrawLine(apoint.x, apoint.y, bpoint.x, bpoint.y, width, color)
  1893. end  
  1894.  
  1895. function drawRectshit(point1, point2, diameter, color, width)
  1896.     apoint = WorldToScreen(D3DXVECTOR3(point1.x, 1, point1.y))
  1897.     bpoint = WorldToScreen(D3DXVECTOR3(point2.x, 1, point2.y))
  1898.    
  1899.     local drawLines = diameter / width
  1900.    
  1901.     for i = 0, drawLines, 1 do
  1902.         if(i == 0 or i == (drawLines - 1)) then
  1903.             DrawLine(apoint.x - (diameter / 2) + (i * width), apoint.y - (diameter / 2) + (i * width),
  1904.                      bpoint.x - (diameter / 2) + (i * width), bpoint.y - (diameter / 2) + (i * width), width, ARGB(255, 255, 0, 0))
  1905.         else
  1906.             DrawLine(apoint.x - (diameter / 2) + (i * width), apoint.y - (diameter / 2) + (i * width),
  1907.                      bpoint.x - (diameter / 2) + (i * width), bpoint.y - (diameter / 2) + (i * width), width, ARGB(200, 255, 0, 0))
  1908.         end
  1909.     end
  1910. end  
  1911.  
  1912. function OnDraw()
  1913.         if GoodEvadeConfig.drawEnabled then
  1914.         DrawCircle(GetMyHero().x, GetMyHero().y + 5, GetMyHero().z, hitboxSize, 0xFFFFFF)
  1915.         --DrawLine(GetMyHero().x, GetMyHero().y + 5, GetMyHero().z, GetMyHero().x + 50, GetMyHero().y + 5, GetMyHero().z + 50, 5, 0xFFFF0000)
  1916.         for i, detectedSkillshot in pairs(detectedSkillshots) do
  1917.             skillshotPos = skillshotPosition(detectedSkillshot, GetTickCount())
  1918.             if detectedSkillshot.drawit == true then
  1919.                 if detectedSkillshot.skillshot.type == "line" then
  1920.                     --DrawHitBox(detectedSkillshot.object, 2, ARGB(255, 255, 0, 0))
  1921.                     drawLineshit(detectedSkillshot.startPosition, detectedSkillshot.endPosition, 0xFFFF0000, 3)
  1922.                     --drawRectshit(detectedSkillshot.startPosition, detectedSkillshot.endPosition, detectedSkillshot.skillshot.radius * 2, 0xFFFF0000, 1)
  1923.                     DrawCircle(skillshotPos.x, myHero.y, skillshotPos.y, detectedSkillshot.skillshot.radius, 0xFFFFFF)
  1924.                 else
  1925.                     DrawCircle(skillshotPos.x, myHero.y, skillshotPos.y, detectedSkillshot.skillshot.radius, 0x00FF00)
  1926.                 end
  1927.             end
  1928.         end
  1929.     end
  1930. end
  1931.  
  1932. function _isValidTarget(target)
  1933.     return target ~= nil and target.valid and target.dead == false and target.bTargetable and target.bMagicImunebMagicImune ~= true and target.bInvulnerable ~= true and target.visible
  1934. end
  1935.  
  1936. function startEvade()
  1937.     allowCustomMovement = false
  1938.     if AutoCarry
  1939.         then if AutoCarry.MainMenu ~= nil then
  1940.             if AutoCarry.CanAttack ~= nil then
  1941.                 _G.AutoCarry.CanAttack = false
  1942.                 _G.AutoCarry.CanMove = false
  1943.             end
  1944.             elseif AutoCarry.Keys ~= nil then
  1945.             if AutoCarry.MyHero ~= nil then
  1946.                 _G.AutoCarry.MyHero:MovementEnabled(false)
  1947.                 _G.AutoCarry.MyHero:AttacksEnabled(false)
  1948.             end
  1949.         end
  1950.         elseif MMA_Loaded then
  1951.         _G.MMA_AttackAvailable = false
  1952.         _G.MMA_AbleToMove = false
  1953.     end
  1954.     _G.evade = true
  1955.     evading = true
  1956. end
  1957.  
  1958. function stopEvade()
  1959.     allowCustomMovement = true
  1960.     if AutoCarry then if AutoCarry.MainMenu ~= nil then
  1961.             if AutoCarry.CanAttack ~= nil then
  1962.                 _G.AutoCarry.CanAttack = true
  1963.                 _G.AutoCarry.CanMove = true
  1964.             end
  1965.             elseif AutoCarry.Keys ~= nil then
  1966.             if AutoCarry.MyHero ~= nil then
  1967.                 _G.AutoCarry.MyHero:MovementEnabled(true)
  1968.                 _G.AutoCarry.MyHero:AttacksEnabled(true)
  1969.             end
  1970.         end
  1971.         elseif MMA_Loaded then
  1972.         _G.MMA_AttackAvailable = true
  1973.         _G.MMA_AbleToMove = true
  1974.     end
  1975.     _G.evade = false
  1976.     evading = false
  1977. end
  1978.  
  1979. function OnWndMsg(msg, key)
  1980.         if not VIP_USER then
  1981.         if msg == WM_RBUTTONDOWN then
  1982.             if evading then
  1983.                 for i, detectedSkillshot in pairs(detectedSkillshots) do
  1984.                     if detectedSkillshot and detectedSkillshot.evading and inDangerousArea(detectedSkillshot, Point2(myHero.x, myHero.z)) then
  1985.                         dodgeSkillshot(detectedSkillshot)
  1986.                     end
  1987.                 end
  1988.             end
  1989.             lastMovement.destination = Point2(mousePos.x, mousePos.z)
  1990.         end
  1991.     end
  1992. end
  1993. -- beggining of circular skillshot dodging functions --
  1994. function mainCircularskillshot5(skillshot, safeTarget)
  1995.         if NeedDash(skillshot, true) and not skillshot.alreadydashed then
  1996.         evadeTo(safeTarget.x, safeTarget.y, true)
  1997.         skillshot.alreadydashed = true
  1998.         return true
  1999.         else return false
  2000.     end
  2001.     return false
  2002. end
  2003.  
  2004. function mainCircularskillshot4(skillshot, heroPosition, moveableDistance, evadeRadius, safeTarget)
  2005.         if NeedDash(skillshot, true) and not skillshot.alreadydashed then
  2006.         moveableDistance = (myHero.ms * math.max(skillshot.endTick - GetTickCount() - GetLatency()/2, 0) / 1000) + dashrange
  2007.         evadeRadius = skillshot.skillshot.radius + hitboxSize / 2 + GoodEvadeConfig.evadeBuffer + moveBuffer
  2008.        
  2009.         safeTarget = skillshot.endPosition + (heroPosition - skillshot.endPosition):normalized() * evadeRadius
  2010.         if getLastMovementDestination():distance(skillshot.endPosition) <= evadeRadius then
  2011.             closestTarget = skillshot.endPosition + (getLastMovementDestination() - skillshot.endPosition):normalized() * evadeRadius
  2012.         else
  2013.             closestTarget = nil
  2014.         end
  2015.        
  2016.         lineDistance = Line2(heroPosition, getLastMovementDestination()):distance(skillshot.endPosition)
  2017.         directionTarget = heroPosition + (getLastMovementDestination() - heroPosition):normalized() * (math.sqrt(heroPosition:distance(skillshot.endPosition)^2 - lineDistance^2) + math.sqrt(evadeRadius^2 - lineDistance^2))
  2018.         if directionTarget:distance(skillshot.endPosition) >= evadeRadius + 1 then
  2019.             directionTarget = heroPosition + (getLastMovementDestination() - heroPosition):normalized() * (math.sqrt(evadeRadius^2 - lineDistance^2) - math.sqrt(heroPosition:distance(skillshot.endPosition)^2 - lineDistance^2))
  2020.         end
  2021.        
  2022.         possibleMovementTargets = {}
  2023.         intersectionPoints = Circle2(skillshot.endPosition, evadeRadius):intersectionPoints(Circle2(heroPosition, moveableDistance))
  2024.         if #intersectionPoints == 2 then
  2025.             leftTarget = intersectionPoints[1]
  2026.             rightTarget = intersectionPoints[2]
  2027.            
  2028.             local theta = ((-skillshot.endPosition + leftTarget):polar() - (-skillshot.endPosition + rightTarget):polar()) % 360
  2029.             if ((theta >= 180 and getSideOfLine(skillshot.endPosition, leftTarget, directionTarget) == getSideOfLine(skillshot.endPosition, leftTarget, heroPosition) and getSideOfLine(skillshot.endPosition, rightTarget, directionTarget) == getSideOfLine(skillshot.endPosition, rightTarget, heroPosition)) or (theta <= 180 and (getSideOfLine(skillshot.endPosition, leftTarget, directionTarget) == getSideOfLine(skillshot.endPosition, leftTarget, heroPosition) or getSideOfLine(skillshot.endPosition, rightTarget, directionTarget) == getSideOfLine(skillshot.endPosition, rightTarget, heroPosition)))) then
  2030.                 table.insert(possibleMovementTargets, directionTarget)
  2031.             end
  2032.            
  2033.             if closestTarget ~= nil and ((theta >= 180 and getSideOfLine(skillshot.endPosition, leftTarget, closestTarget) == getSideOfLine(skillshot.endPosition, leftTarget, heroPosition) and getSideOfLine(skillshot.endPosition, rightTarget, closestTarget) == getSideOfLine(skillshot.endPosition, rightTarget, heroPosition)) or (theta <= 180 and (getSideOfLine(skillshot.endPosition, leftTarget, closestTarget) == getSideOfLine(skillshot.endPosition, leftTarget, heroPosition) or getSideOfLine(skillshot.endPosition, rightTarget, closestTarget) == getSideOfLine(skillshot.endPosition, rightTarget, heroPosition)))) then
  2034.                 table.insert(possibleMovementTargets, closestTarget)
  2035.             end
  2036.            
  2037.            
  2038.             table.insert(possibleMovementTargets, safeTarget)
  2039.             table.insert(possibleMovementTargets, leftTarget)
  2040.             table.insert(possibleMovementTargets, rightTarget)
  2041.         else
  2042.             if skillshot.skillshot.radius <= moveableDistance then
  2043.                 table.insert(possibleMovementTargets, closestTarget)
  2044.                 table.insert(possibleMovementTargets, directionTarget)
  2045.                 table.insert(possibleMovementTargets, safeTarget)
  2046.             end
  2047.         end
  2048.        
  2049.         closestPoint = findBestDirection(skillshot, getLastMovementDestination(), possibleMovementTargets)
  2050.         if closestPoint ~= nil then
  2051.             closestPoint = closestPoint + (closestPoint - heroPosition):normalized() * smoothing
  2052.             evadeTo(closestPoint.x, closestPoint.y, true)
  2053.             skillshot.alreadydashed = true
  2054.             return true
  2055.             else return false
  2056.         end
  2057.         else return false
  2058.     end
  2059.     return false
  2060. end
  2061.  
  2062. function mainCircularskillshot3(skillshot, heroPosition)
  2063.         if getLastMovementDestination():distance(heroPosition) > 20 and NeedDash(skillshot, true) and not skillshot.alreadydashed then
  2064.         dashpos = getLastMovementDestination() + (getLastMovementDestination() - heroPosition):normalized() * dashrange
  2065.         if dashpos:distance(skillshot.endPosition) > skillshot.skillshot.radius and not InsideTheWall(dashpos) then
  2066.             evadeTo(dashpos.x, dashpos.y, true)
  2067.             skillshot.alreadydashed = true
  2068.             return true
  2069.             else return false
  2070.         end
  2071.         else return false
  2072.     end
  2073.     return false
  2074. end
  2075.  
  2076. function mainCircularskillshot2(skillshot)
  2077.         if haveShield() then
  2078.         for i, detectedSkillshot in ipairs(detectedSkillshots) do
  2079.             if detectedSkillshot.skillshot.name == skillshot.skillshot.name then
  2080.                 table.remove(detectedSkillshots, i)
  2081.                 i = i-1
  2082.                 if detectedSkillshot.evading then
  2083.                     continueMovement(detectedSkillshot)
  2084.                 end
  2085.             end
  2086.         end
  2087.         if skillshot.skillshot.shieldnow == "true" then
  2088.             if isSivir then
  2089.                 CastSpell(_E)
  2090.                 elseif isNocturne then
  2091.                 CastSpell(_W)
  2092.             end
  2093.             return true
  2094.             elseif skillshot.skillshot.shieldnow == "false" then
  2095.             shieldtick = skillshot.endTick - 50 - GetLatency()
  2096.             return true
  2097.         end
  2098.         else return false
  2099.     end
  2100.     return false
  2101. end
  2102.  
  2103. function mainCircularskillshot1(skillshot, heroPosition, moveableDistance, evadeRadius, safeTarget)
  2104.     if getLastMovementDestination():distance(skillshot.endPosition) <= evadeRadius then
  2105.         closestTarget = skillshot.endPosition + (getLastMovementDestination() - skillshot.endPosition):normalized() * evadeRadius
  2106.     else
  2107.         closestTarget = nil
  2108.     end
  2109.    
  2110.     lineDistance = Line2(heroPosition, getLastMovementDestination()):distance(skillshot.endPosition)
  2111.     directionTarget = heroPosition + (getLastMovementDestination() - heroPosition):normalized() * (math.sqrt(heroPosition:distance(skillshot.endPosition)^2 - lineDistance^2) + math.sqrt(evadeRadius^2 - lineDistance^2))
  2112.     if directionTarget:distance(skillshot.endPosition) >= evadeRadius + 1 then
  2113.         directionTarget = heroPosition + (getLastMovementDestination() - heroPosition):normalized() * (math.sqrt(evadeRadius^2 - lineDistance^2) - math.sqrt(heroPosition:distance(skillshot.endPosition)^2 - lineDistance^2))
  2114.     end
  2115.    
  2116.     possibleMovementTargets = {}
  2117.     intersectionPoints = Circle2(skillshot.endPosition, evadeRadius):intersectionPoints(Circle2(heroPosition, moveableDistance))
  2118.     if #intersectionPoints == 2 then
  2119.         leftTarget = intersectionPoints[1]
  2120.         rightTarget = intersectionPoints[2]
  2121.        
  2122.         local theta = ((-skillshot.endPosition + leftTarget):polar() - (-skillshot.endPosition + rightTarget):polar()) % 360
  2123.         if ((theta >= 180 and getSideOfLine(skillshot.endPosition, leftTarget, directionTarget) == getSideOfLine(skillshot.endPosition, leftTarget, heroPosition) and getSideOfLine(skillshot.endPosition, rightTarget, directionTarget) == getSideOfLine(skillshot.endPosition, rightTarget, heroPosition)) or (theta <= 180 and (getSideOfLine(skillshot.endPosition, leftTarget, directionTarget) == getSideOfLine(skillshot.endPosition, leftTarget, heroPosition) or getSideOfLine(skillshot.endPosition, rightTarget, directionTarget) == getSideOfLine(skillshot.endPosition, rightTarget, heroPosition)))) then
  2124.             table.insert(possibleMovementTargets, directionTarget)
  2125.         end
  2126.        
  2127.         if closestTarget ~= nil and ((theta >= 180 and getSideOfLine(skillshot.endPosition, leftTarget, closestTarget) == getSideOfLine(skillshot.endPosition, leftTarget, heroPosition) and getSideOfLine(skillshot.endPosition, rightTarget, closestTarget) == getSideOfLine(skillshot.endPosition, rightTarget, heroPosition)) or (theta <= 180 and (getSideOfLine(skillshot.endPosition, leftTarget, closestTarget) == getSideOfLine(skillshot.endPosition, leftTarget, heroPosition) or getSideOfLine(skillshot.endPosition, rightTarget, closestTarget) == getSideOfLine(skillshot.endPosition, rightTarget, heroPosition)))) then
  2128.             table.insert(possibleMovementTargets, closestTarget)
  2129.         end
  2130.        
  2131.        
  2132.         table.insert(possibleMovementTargets, safeTarget)
  2133.         table.insert(possibleMovementTargets, leftTarget)
  2134.         table.insert(possibleMovementTargets, rightTarget)
  2135.     else
  2136.         if skillshot.skillshot.radius <= moveableDistance then
  2137.             table.insert(possibleMovementTargets, closestTarget)
  2138.             table.insert(possibleMovementTargets, directionTarget)
  2139.             table.insert(possibleMovementTargets, safeTarget)
  2140.         end
  2141.     end
  2142.    
  2143.     closestPoint = findBestDirection(skillshot, getLastMovementDestination(), possibleMovementTargets)
  2144.     if closestPoint ~= nil then
  2145.         closestPoint = closestPoint + (closestPoint - heroPosition):normalized() * smoothing
  2146.         evadeTo(closestPoint.x, closestPoint.y)
  2147.         return true
  2148.         else return false
  2149.     end
  2150.     return false
  2151. end
  2152.  
  2153. function AM1(skillshot)        
  2154.         if haveShield() then
  2155.         for i, detectedSkillshot in ipairs(detectedSkillshots) do
  2156.             if detectedSkillshot.skillshot.name == skillshot.skillshot.name then
  2157.                 table.remove(detectedSkillshots, i)
  2158.                 i = i-1
  2159.                 if detectedSkillshot.evading then
  2160.                     continueMovement(detectedSkillshot)
  2161.                 end
  2162.             end
  2163.         end
  2164.         if isSivir then
  2165.             CastSpell(_E)
  2166.             elseif isNocturne then
  2167.             CastSpell(_W)
  2168.         end
  2169.         return true
  2170.         else return false
  2171.     end
  2172.     return false
  2173. end
  2174.  
  2175. function AM2(skillshot, heroPosition)
  2176.         if GoodEvadeConfig.useSummonerFlash and flashready and getLastMovementDestination():distance(heroPosition) > 20 and not skillshot.alreadydashed then
  2177.         dashpos = getLastMovementDestination() + (getLastMovementDestination() - heroPosition):normalized() * 400
  2178.         if dashpos:distance(skillshot.endPosition) > skillshot.skillshot.radius and not InsideTheWall(dashpos) then
  2179.             FlashTo(dashpos.x, dashpos.y)
  2180.             skillshot.alreadydashed = true
  2181.             for i, detectedSkillshot in ipairs(detectedSkillshots) do
  2182.                 if detectedSkillshot.skillshot.name == skillshot.skillshot.name then
  2183.                     table.remove(detectedSkillshots, i)
  2184.                     i = i-1
  2185.                     if detectedSkillshot.evading then
  2186.                         continueMovement(detectedSkillshot)
  2187.                     end
  2188.                 end
  2189.             end
  2190.             return true
  2191.             else return false
  2192.         end
  2193.         else return false
  2194.     end
  2195.     return false
  2196. end
  2197.  
  2198. function AM3(skillshot, safeTarget)
  2199.         if GoodEvadeConfig.useSummonerFlash and flashready and not skillshot.alreadydashed then
  2200.         FlashTo(safeTarget.x, safeTarget.y)
  2201.         skillshot.alreadydashed = true
  2202.         for i, detectedSkillshot in ipairs(detectedSkillshots) do
  2203.             if detectedSkillshot.skillshot.name == skillshot.skillshot.name then
  2204.                 table.remove(detectedSkillshots, i)
  2205.                 i = i-1
  2206.                 if detectedSkillshot.evading then
  2207.                     continueMovement(detectedSkillshot)
  2208.                 end
  2209.             end
  2210.         end
  2211.         return true
  2212.         else return false
  2213.     end
  2214.     return false
  2215. end
  2216. -- end of circular skillshot dodging functions --
  2217. -- beggining of line skillshot dodging functions --
  2218. function lineSkillshot1(skillshot, heroPosition, skillshotLine, distanceFromSkillshotPath, evadeDistance, normalVector, nessecaryMoveWidth, evadeTo1, evadeTo2)
  2219.         if skillshotLine:distance(evadeTo1) >= skillshotLine:distance(evadeTo2) then
  2220.         longitudinalApproachLength = calculateLongitudinalApproachLength(skillshot, nessecaryMoveWidth)
  2221.         if longitudinalApproachLength >= 0 then
  2222.             evadeToTarget1 = evadeTo1 - skillshot.directionVector * longitudinalApproachLength
  2223.         end
  2224.        
  2225.         longitudinalApproachLength = calculateLongitudinalApproachLength(skillshot, evadeDistance + distanceFromSkillshotPath)
  2226.         if longitudinalApproachLength >= 0 then
  2227.             evadeToTarget2 = heroPosition - normalVector * (evadeDistance + distanceFromSkillshotPath) - skillshot.directionVector * longitudinalApproachLength
  2228.         end
  2229.        
  2230.         longitudinalRetreatLength = calculateLongitudinalRetreatLength(skillshot, nessecaryMoveWidth)
  2231.         if longitudinalRetreatLength >= 0 then
  2232.             evadeToTarget3 = evadeTo1 + skillshot.directionVector * longitudinalRetreatLength
  2233.         end
  2234.        
  2235.         longitudinalRetreatLength = calculateLongitudinalRetreatLength(skillshot, evadeDistance + distanceFromSkillshotPath)
  2236.         if longitudinalRetreatLength >= 0 then
  2237.             evadeToTarget4 = heroPosition - normalVector * (evadeDistance + distanceFromSkillshotPath) + skillshot.directionVector * longitudinalRetreatLength
  2238.         end
  2239.        
  2240.         safeTarget = evadeTo1
  2241.        
  2242.         closestPoint = getLastMovementDestination() + normalVector * (evadeDistance - skillshotLine:distance(getLastMovementDestination()))
  2243.         closestPoint2 = getPerpendicularFootpoint(skillshot.startPosition, skillshot.endPosition, getLastMovementDestination()) + normalVector * evadeDistance
  2244.     else
  2245.         longitudinalApproachLength = calculateLongitudinalApproachLength(skillshot, nessecaryMoveWidth)
  2246.         if longitudinalApproachLength >= 0 then
  2247.             evadeToTarget1 = evadeTo2 - skillshot.directionVector * longitudinalApproachLength
  2248.         end
  2249.        
  2250.         longitudinalApproachLength = calculateLongitudinalApproachLength(skillshot, evadeDistance + distanceFromSkillshotPath)
  2251.         if longitudinalApproachLength >= 0 then
  2252.             evadeToTarget2 = heroPosition + normalVector * (evadeDistance + distanceFromSkillshotPath) - skillshot.directionVector * longitudinalApproachLength
  2253.         end
  2254.        
  2255.         longitudinalRetreatLength = calculateLongitudinalRetreatLength(skillshot, nessecaryMoveWidth)
  2256.         if longitudinalRetreatLength >= 0 then
  2257.             evadeToTarget3 = evadeTo2 + skillshot.directionVector * longitudinalRetreatLength
  2258.         end
  2259.        
  2260.         longitudinalRetreatLength = calculateLongitudinalRetreatLength(skillshot, evadeDistance + distanceFromSkillshotPath)
  2261.         if longitudinalRetreatLength >= 0 then
  2262.             evadeToTarget4 = heroPosition + normalVector * (evadeDistance + distanceFromSkillshotPath) + skillshot.directionVector * longitudinalRetreatLength
  2263.         end
  2264.        
  2265.         safeTarget = evadeTo2
  2266.        
  2267.         closestPoint = getLastMovementDestination() - normalVector * (evadeDistance - skillshotLine:distance(getLastMovementDestination()))
  2268.         closestPoint2 = getPerpendicularFootpoint(skillshot.startPosition, skillshot.endPosition, getLastMovementDestination()) - normalVector * evadeDistance
  2269.     end
  2270.    
  2271.     if skillshotLine:distance(getLastMovementDestination()) <= evadeDistance then
  2272.         directionTarget = findBestDirection(skillshot,getLastMovementDestination(), {closestPoint, closestPoint2, getPerpendicularFootpoint(skillshot.startPosition, skillshot.endPosition, getLastMovementDestination()) - normalVector * evadeDistance, getPerpendicularFootpoint(skillshot.startPosition, skillshot.endPosition, getLastMovementDestination()) + normalVector * evadeDistance})
  2273.     else
  2274.         if getSideOfLine(skillshot.startPosition, skillshot.endPosition, getLastMovementDestination()) == getSideOfLine(skillshot.startPosition, skillshot.endPosition, heroPosition) then
  2275.             if skillshotLine:distance(heroPosition) <= skillshotLine:distance(getLastMovementDestination()) then
  2276.                 directionTarget = heroPosition + (getLastMovementDestination()-heroPosition):normalized() * ((evadeDistance - distanceFromSkillshotPath) * heroPosition:distance(getLastMovementDestination())) / (skillshotLine:distance(getLastMovementDestination()) - distanceFromSkillshotPath)
  2277.             else
  2278.                 directionTarget = heroPosition + (getLastMovementDestination()-heroPosition):normalized() * ((evadeDistance + distanceFromSkillshotPath) * heroPosition:distance(getLastMovementDestination())) / (distanceFromSkillshotPath - skillshotLine:distance(getLastMovementDestination()))
  2279.             end
  2280.         else
  2281.             directionTarget = heroPosition + (getLastMovementDestination() - heroPosition):normalized() * (evadeDistance + distanceFromSkillshotPath) * heroPosition:distance(getLastMovementDestination()) / (skillshotLine:distance(getLastMovementDestination()) + distanceFromSkillshotPath)
  2282.         end
  2283.     end
  2284.    
  2285.     evadeTarget = nil
  2286.     if (evadeToTarget1 ~= nil and evadeToTarget3 ~= nil and Line2(evadeToTarget1, evadeToTarget3):distance(directionTarget) <= 1 and getSideOfLine(evadeToTarget1, getPerpendicularFootpoint(skillshot.startPosition, skillshot.endPosition, evadeToTarget1), directionTarget) ~= getSideOfLine(evadeToTarget3, getPerpendicularFootpoint(skillshot.startPosition, skillshot.endPosition, evadeToTarget3), directionTarget)) or (evadeToTarget2 ~= nil and evadeToTarget4 ~= nil and Line2(evadeToTarget2, evadeToTarget4):distance(directionTarget) <= 1 and getSideOfLine(evadeToTarget2, getPerpendicularFootpoint(skillshot.startPosition, skillshot.endPosition, evadeToTarget2), directionTarget) ~= getSideOfLine(evadeToTarget4, getPerpendicularFootpoint(skillshot.startPosition, skillshot.endPosition, evadeToTarget4), directionTarget)) or (evadeToTarget1 ~= nil and evadeToTarget3 == nil and getSideOfLine(heroPosition, evadeToTarget1, skillshot.startPosition) ~= getSideOfLine(heroPosition, evadeToTarget1, directionTarget)) or (evadeToTarget2 ~= nil and evadeToTarget4 == nil and getSideOfLine(heroPosition, evadeToTarget2, skillshot.startPosition) ~= getSideOfLine(heroPosition, evadeToTarget2, directionTarget)) then
  2287.         evadeTarget = directionTarget
  2288.     else
  2289.         possibleMovementTargets = {}
  2290.        
  2291.         if (evadeToTarget1 ~= nil and evadeToTarget3 ~= nil and Line2(evadeToTarget1, evadeToTarget3):distance(closestPoint2) <= 1 and getSideOfLine(evadeToTarget1, getPerpendicularFootpoint(skillshot.startPosition, skillshot.endPosition, evadeToTarget1), closestPoint2) ~= getSideOfLine(evadeToTarget3, getPerpendicularFootpoint(skillshot.startPosition, skillshot.endPosition, evadeToTarget3), closestPoint2)) or (evadeToTarget2 ~= nil and evadeToTarget4 ~= nil and Line2(evadeToTarget2, evadeToTarget4):distance(closestPoint2) <= 1 and getSideOfLine(evadeToTarget2, getPerpendicularFootpoint(skillshot.startPosition, skillshot.endPosition, evadeToTarget2), closestPoint2) ~= getSideOfLine(evadeToTarget4, getPerpendicularFootpoint(skillshot.startPosition, skillshot.endPosition, evadeToTarget4), closestPoint2)) or (evadeToTarget1 ~= nil and evadeToTarget3 == nil and getSideOfLine(heroPosition, evadeToTarget1, skillshot.startPosition) ~= getSideOfLine(heroPosition, evadeToTarget1, closestPoint2)) or (evadeToTarget2 ~= nil and evadeToTarget4 == nil and getSideOfLine(heroPosition, evadeToTarget2, skillshot.startPosition) ~= getSideOfLine(heroPosition, evadeToTarget2, closestPoint2)) then
  2292.             table.insert(possibleMovementTargets, closestPoint2)
  2293.         end
  2294.        
  2295.         if evadeToTarget1 ~= nil then
  2296.             table.insert(possibleMovementTargets, evadeToTarget1)
  2297.         end
  2298.        
  2299.         if evadeToTarget2 ~= nil then
  2300.             table.insert(possibleMovementTargets, evadeToTarget2)
  2301.         end
  2302.        
  2303.         if evadeToTarget3 ~= nil then
  2304.             table.insert(possibleMovementTargets, evadeToTarget3)
  2305.         end
  2306.        
  2307.         if evadeToTarget4 ~= nil then
  2308.             table.insert(possibleMovementTargets, evadeToTarget4)
  2309.         end
  2310.        
  2311.         evadeTarget = findBestDirection(skillshot,getLastMovementDestination(), possibleMovementTargets)
  2312.     end
  2313.    
  2314.     if evadeTarget then
  2315.         if getSideOfLine(skillshot.startPosition, skillshot.endPosition, evadeTarget) == getSideOfLine(skillshot.startPosition, skillshot.endPosition, getLastMovementDestination()) and skillshotLine:distance(getLastMovementDestination()) > evadeDistance then
  2316.             pathDirectionVector = (evadeTarget - heroPosition)
  2317.             if getSideOfLine(skillshot.startPosition, skillshot.endPosition, heroPosition) == getSideOfLine(skillshot.startPosition, skillshot.endPosition, evadeTarget) then
  2318.                 evadeTarget = evadeTarget + pathDirectionVector:normalized() * (pathDirectionVector:len() + smoothing / (evadeDistance - distanceFromSkillshotPath) * pathDirectionVector:len())
  2319.             else
  2320.                 evadeTarget = evadeTarget + pathDirectionVector:normalized() * (pathDirectionVector:len() + smoothing / (evadeDistance + distanceFromSkillshotPath) * pathDirectionVector:len())
  2321.             end
  2322.         end
  2323.         evadeTo(evadeTarget.x, evadeTarget.y)
  2324.         return true
  2325.         else return false
  2326.     end
  2327.     return false
  2328. end
  2329.  
  2330. function lineSkillshot2(skillshot)
  2331.         if haveShield() then
  2332.         for i, detectedSkillshot in ipairs(detectedSkillshots) do
  2333.             if detectedSkillshot.skillshot.name == skillshot.skillshot.name then
  2334.                 table.remove(detectedSkillshots, i)
  2335.                 i = i-1
  2336.                 if detectedSkillshot.evading then
  2337.                     continueMovement(detectedSkillshot)
  2338.                 end
  2339.             end
  2340.         end
  2341.         if isSivir then
  2342.             CastSpell(_E)
  2343.             elseif isNocturne then
  2344.             CastSpell(_W)
  2345.         end
  2346.         return true
  2347.         else return false
  2348.     end
  2349.     return false
  2350. end
  2351.  
  2352. function lineSkillshot3(skillshot, evadeTo1, evadeTo2)
  2353.         if not skillshot.alreadydashed then
  2354.         local safeTarget = nil
  2355.         if NeedDash(skillshot, true)
  2356.             then if (evadeTo1:distance(lastMovement.destination) > evadeTo2:distance(lastMovement.destination)) and not InsideTheWall(evadeTo2) then
  2357.                 safeTarget = evadeTo2
  2358.                 elseif (evadeTo2:distance(lastMovement.destination) > evadeTo1:distance(lastMovement.destination)) and not InsideTheWall(evadeTo1) then
  2359.                 safeTarget = evadeTo1
  2360.                 elseif InsideTheWall(evadeTo2) then
  2361.                 safeTarget = evadeTo1
  2362.                 elseif InsideTheWall(evadeTo1) then
  2363.                 safeTarget = evadeTo2
  2364.             end
  2365.             if safeTarget ~= nil then
  2366.                 evadeTo(safeTarget.x, safeTarget.y, true)
  2367.                 skillshot.alreadydashed = true
  2368.                 return true
  2369.                 else return false
  2370.             end
  2371.             else return false
  2372.         end
  2373.         else return false
  2374.     end
  2375.     return false
  2376. end
  2377.  
  2378. function lineSkillshot4(skillshot, evadeTo1, evadeTo2)
  2379.         if GoodEvadeConfig.lineallways then
  2380.         if skillshotLine:distance(evadeTo1) >= skillshotLine:distance(evadeTo2) then
  2381.             if not InsideTheWall(evadeTo1) then
  2382.                 safeTarget = evadeTo1
  2383.                 elseif not InsideTheWall(evadeTo2) then
  2384.                 safeTarget = evadeTo2
  2385.             else
  2386.                 safeTarget = getLastMovementDestination()
  2387.             end
  2388.            
  2389.         else
  2390.             if not InsideTheWall(evadeTo2) then
  2391.                 safeTarget = evadeTo2
  2392.                 elseif not InsideTheWall(evadeTo1) then
  2393.                 safeTarget = evadeTo1
  2394.             else
  2395.                 safeTarget = getLastMovementDestination()
  2396.             end
  2397.         end
  2398.        
  2399.         if safeTarget ~= nil then
  2400.             evadeTo(safeTarget.x, safeTarget.y)
  2401.             return true
  2402.             else return false
  2403.         end
  2404.         else return false
  2405.     end
  2406.     return false
  2407. end
  2408.  
  2409. function dodgeCrescendo1(skillshot)
  2410.         if haveShield() then
  2411.         for i, detectedSkillshot in ipairs(detectedSkillshots) do
  2412.             if detectedSkillshot.skillshot.name == skillshot.skillshot.name then
  2413.                 table.remove(detectedSkillshots, i)
  2414.                 i = i-1
  2415.                 if detectedSkillshot.evading then
  2416.                     continueMovement(detectedSkillshot)
  2417.                 end
  2418.             end
  2419.         end
  2420.         if isSivir then
  2421.             CastSpell(_E)
  2422.         elseif isNocturne then
  2423.             CastSpell(_W)
  2424.         end
  2425.         return true
  2426.         else return false
  2427.     end
  2428.     return false
  2429. end
  2430.  
  2431. function dodgeCrescendo2(skillshot, evadeTo1, evadeTo2)
  2432.     local safeTarget = nil
  2433.     if haveflash and useflash and GoodEvadeConfig.useSummonerFlash and not skillshot.alreadydashed
  2434.         then if (evadeTo1:distance(lastMovement.destination) > evadeTo2:distance(lastMovement.destination)) and not InsideTheWall(evadeTo2) then
  2435.             safeTarget = evadeTo2
  2436.             elseif (evadeTo2:distance(lastMovement.destination) > evadeTo1:distance(lastMovement.destination)) and not InsideTheWall(evadeTo1) then
  2437.             safeTarget = evadeTo1
  2438.             elseif InsideTheWall(evadeTo2) then
  2439.             safeTarget = evadeTo1
  2440.             elseif InsideTheWall(evadeTo1) then
  2441.             safeTarget = evadeTo2
  2442.         end
  2443.         if safeTarget ~= nil then
  2444.             FlashTo(safeTarget.x, safeTarget.y)
  2445.             skillshot.alreadydashed = true
  2446.             return true
  2447.             else return false
  2448.         end
  2449.         else return false
  2450.     end
  2451.     return false
  2452. end
  2453. -- end of line skillshot dodging functions --
Advertisement
Add Comment
Please, Sign In to add comment