Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.89 KB | None | 0 0
  1.  
  2. local GameHeroCount = Game.HeroCount
  3. local GameHero = Game.Hero
  4.  
  5. local myHero = myHero
  6. local LocalGameTimer = Game.Timer
  7. local GameMissile = Game.Missile
  8. local GameMissileCount = Game.MissileCount
  9.  
  10. local lastQ = 0
  11.  
  12. local lastW = 0
  13. local lastE = 0
  14. local lastR = 0
  15. local lastIG = 0
  16. local lastMove = 0
  17. local HITCHANCE_NORMAL = 2
  18. local HITCHANCE_HIGH = 3
  19. local HITCHANCE_IMMOBILE = 4
  20.  
  21. local Enemys = {}
  22. local Allys = {}
  23.  
  24. local orbwalker
  25. local TargetSelector
  26.  
  27. -- [ AutoUpdate ] --
  28. do
  29.    
  30.     local Version = 0.05
  31.    
  32.     local Files = {
  33.         Lua = {
  34.             Path = SCRIPT_PATH,
  35.             Name = "Soraka.lua",
  36.             Url = "https://raw.githubusercontent.com/ShadowFusion/MJGA/master/Soraka.lua"
  37.         },
  38.         Version = {
  39.             Path = SCRIPT_PATH,
  40.             Name = "Soraka.version",
  41.             Url = "https://raw.githubusercontent.com/ShadowFusion/MJGA/master/Soraka.version"    -- check if Raw Adress correct pls.. after you have create the version file on Github
  42.         }
  43.     }
  44.    
  45.     local function AutoUpdate()
  46.        
  47.         local function DownloadFile(url, path, fileName)
  48.             DownloadFileAsync(url, path .. fileName, function() end)
  49.             while not FileExist(path .. fileName) do end
  50.         end
  51.        
  52.         local function ReadFile(path, fileName)
  53.             local file = io.open(path .. fileName, "r")
  54.             local result = file:read()
  55.             file:close()
  56.             return result
  57.         end
  58.        
  59.         DownloadFile(Files.Version.Url, Files.Version.Path, Files.Version.Name)
  60.         local textPos = myHero.pos:To2D()
  61.         local NewVersion = tonumber(ReadFile(Files.Version.Path, Files.Version.Name))
  62.         if NewVersion > Version then
  63.             DownloadFile(Files.Lua.Url, Files.Lua.Path, Files.Lua.Name)
  64.             print("New ShadowAIO Vers. Press 2x F6")     -- <-- you can change the massage for users here !!!!
  65.         else
  66.             print(Files.Version.Name .. ": No Updates Found")   --  <-- here too
  67.         end
  68.    
  69.     end
  70.    
  71.     AutoUpdate()
  72.  
  73. end
  74.  
  75. local Champions = {
  76.     ["Soraka"] = true,
  77. }
  78.  
  79. --Checking Champion
  80. if Champions[myHero.charName] == nil then
  81.     print('Shadow AIO does not support ' .. myHero.charName) return
  82. end
  83.  
  84.  
  85. Callback.Add("Load", function()
  86.     orbwalker = _G.SDK.Orbwalker
  87.     TargetSelector = _G.SDK.TargetSelector
  88.     if FileExist(COMMON_PATH .. "GamsteronPrediction.lua") then
  89.         require('GamsteronPrediction');
  90.     else
  91.         print("Requires GamsteronPrediction please download the file thanks!");
  92.         return
  93.     end
  94.     if FileExist(COMMON_PATH .. "DamageLib.lua") then
  95.         print("HELAAAAAL YIGEEEEEEEN ARISTO FIX EDITIONU INDIRDIN YIGEEENIIMM")
  96.  
  97.     end
  98.        
  99.     require('damagelib')
  100.     local _IsHero = _G[myHero.charName]();
  101.     _IsHero:LoadMenu();
  102. end)
  103.  
  104. local function IsValid(unit)
  105.     if (unit
  106.         and unit.valid
  107.         and unit.isTargetable
  108.         and unit.alive
  109.         and unit.visible
  110.         and unit.networkID
  111.         and unit.health > 0
  112.         and not unit.dead
  113.     ) then
  114.     return true;
  115. end
  116. return false;
  117. end
  118.  
  119. local function MinionsNear(pos,range)
  120.     local pos = pos.pos
  121.     local N = 0
  122.         for i = 1, Game.MinionCount() do
  123.         local Minion = Game.Minion(i)
  124.         local Range = range * range
  125.         if IsValid(Minion, 800) and Minion.team == TEAM_ENEMY and GetDistanceSqr(pos, Minion.pos) < Range then
  126.             N = N + 1
  127.         end
  128.     end
  129.     return N   
  130. end
  131.  
  132. local function GetAllyHeroes()
  133.     AllyHeroes = {}
  134.     for i = 1, Game.HeroCount() do
  135.         local Hero = Game.Hero(i)
  136.         if Hero.isAlly and not Hero.isMe then
  137.             table.insert(AllyHeroes, Hero)
  138.         end
  139.     end
  140.     return AllyHeroes
  141. end
  142.  
  143. local function Ready(spell)
  144.     return myHero:GetSpellData(spell).currentCd == 0 and myHero:GetSpellData(spell).level > 0 and myHero:GetSpellData(spell).mana <= myHero.mana and Game.CanUseSpell(spell) == 0
  145. end
  146.  
  147. local function OnAllyHeroLoad(cb)
  148.     for i = 1, GameHeroCount() do
  149.         local obj = GameHero(i)
  150.         if obj.isAlly then
  151.             cb(obj)
  152.         end
  153.     end
  154. end
  155.  
  156. local function OnEnemyHeroLoad(cb)
  157.     for i = 1, GameHeroCount() do
  158.         local obj = GameHero(i)
  159.         if obj.isEnemy then
  160.             cb(obj)
  161.         end
  162.     end
  163. end
  164.  
  165. function GetCastLevel(unit, slot)
  166.     return unit:GetSpellData(slot).level == 0 and 1 or unit:GetSpellData(slot).level
  167. end
  168.  
  169. local function GetStatsByRank(slot1, slot2, slot3, spell)
  170.     local slot1 = 0
  171.     local slot2 = 0
  172.     local slot3 = 0
  173.     return (({slot1, slot2, slot3})[myHero:GetSpellData(spell).level or 1])
  174. end
  175.  
  176. function IsImmobileTarget(unit)
  177.     for i = 0, unit.buffCount do
  178.         local buff = unit:GetBuff(i)
  179.         if buff and (buff.type == 5 or buff.type == 11 or buff.type == 29 or buff.type == 24 or buff.name == "recall") and buff.count > 0 then
  180.             return true
  181.         end
  182.     end
  183.     return false   
  184. end
  185.  
  186. function IsFacing(unit)
  187.     local V = Vector((unit.pos - myHero.pos))
  188.     local D = Vector(unit.dir)
  189.     local Angle = 180 - math.deg(math.acos(V*D/(V:Len()*D:Len())))
  190.     if math.abs(Angle) < 80 then
  191.         return true  
  192.     end
  193.     return false
  194. end
  195.  
  196.  
  197. local Heroes = {"Soraka"}
  198. if not table.contains(Heroes, myHero.charName) then return end
  199.        
  200. class "Soraka"
  201. function Soraka:__init()
  202.    
  203.     self.Q = {Type = _G.SPELLTYPE_CIRCLE, Radius = 150}
  204.     self.W = {Type = _G.SPELLTYPE_LINE, Range = 1450, Radius = 40.25, Speed = 3200, Collision = true, MaxCollision = 1, CollisionTypes = {0, 2, 3}}
  205.     self.E = {Type = _G.SPELLTYPE_CIRCLE, Range = 900, Radius = 50}
  206.     self.R = {Type = _G.SPELLTYPE_CIRCLE, Range = 20000, Radius = 225, Speed = 1500}
  207.  
  208.    
  209.  
  210.     OnAllyHeroLoad(function(hero)
  211.         Allys[hero.networkID] = hero
  212.     end)
  213.    
  214.     OnEnemyHeroLoad(function(hero)
  215.         Enemys[hero.networkID] = hero
  216.     end)
  217.                                       --- you need Load here your Menu        
  218.     Callback.Add("Tick", function() self:Tick() end)
  219.     Callback.Add("Draw", function() self:Draw() end)
  220.    
  221.     orbwalker:OnPreMovement(function(args)
  222.         if lastMove + 180 > GetTickCount() then
  223.             args.Process = false
  224.         else
  225.             args.Process = true
  226.             lastMove = GetTickCount()
  227.         end
  228.     end)
  229. end
  230.  
  231. local Icons = {
  232.     ["SorakaIcon"] = "https://vignette.wikia.nocookie.net/leagueoflegends/images/6/65/Soraka_OriginalSquare.png",
  233.     ["Q"] = "https://vignette.wikia.nocookie.net/leagueoflegends/images/4/4d/Pow-Pow.png",
  234.     ["W"] = "https://vignette.wikia.nocookie.net/leagueoflegends/images/7/76/Zap%21.png",
  235.     ["E"] = "https://vignette.wikia.nocookie.net/leagueoflegends/images/b/bb/Flame_Chompers%21.png",
  236.     ["R"] = "https://vignette.wikia.nocookie.net/leagueoflegends/images/a/a8/Super_Mega_Death_Rocket%21.png",
  237.     ["EXH"] = "https://vignette2.wikia.nocookie.net/leagueoflegends/images/4/4a/Exhaust.png"
  238.     }
  239.  
  240. function Soraka:LoadMenu()
  241.     self.shadowMenu = MenuElement({type = MENU, id = "shadowSoraka", name = "Shadow Soraka", leftIcon = Icons["SorakaIcon"]})
  242.  
  243.  
  244.     -- COMBO --
  245.     self.shadowMenu:MenuElement({type = MENU, id = "combo", name = "Combo"})
  246.     self.shadowMenu.combo:MenuElement({id = "Q", name = "Use Q in Combo", value = true, leftIcon = Icons.Q})
  247.     self.shadowMenu.combo:MenuElement({id = "W", name = "Use W in Combo", value = true, leftIcon = Icons.W})
  248.     self.shadowMenu.combo:MenuElement({id = "E", name = "Use E in  Combo", value = true, leftIcon = Icons.E})
  249.     self.shadowMenu.combo:MenuElement({id = "EONCC", name = "Auto Use E on CC Targets", value = true, leftIcon = Icons.E})
  250.  
  251.  
  252.      -- JUNGLE KILLSTEAL --
  253.     self.shadowMenu:MenuElement({type = MENU, id = "junglekillsteal", name = "Jungle Steal"})
  254.     self.shadowMenu.junglekillsteal:MenuElement({id = "W", name = "Use W in Jungle Steal", value = true, leftIcon = Icons.W})
  255.  
  256.  
  257.     -- KILL STEAL --
  258.     self.shadowMenu:MenuElement({type = MENU, id = "killsteal", name = "Kill Steal"})
  259.     self.shadowMenu.killsteal:MenuElement({id = "killstealw", name = "Kill steal with W", value = true, leftIcon = Icons.W})
  260.     self.shadowMenu.killsteal:MenuElement({id = "killstealr", name = "Kill steal with R", value = true, leftIcon = Icons.R})
  261.     self.shadowMenu.killsteal:MenuElement({id = "killstealrangemax", name = "Max Distance willing to use R at", value = 0, min = 0, max = 20000})
  262.  
  263. end
  264.  
  265.  
  266. function Soraka:Draw()
  267. end
  268.  
  269. function Soraka:Tick()
  270.     if myHero.dead or Game.IsChatOpen() or (ExtLibEvade and ExtLibEvade.Evading == true) then
  271.         return
  272.     end
  273.     self:autoe()
  274.     self:killsteal()
  275.     self:junglekillsteal()
  276.     if orbwalker.Modes[0] then
  277.         self:Combo()
  278.     elseif orbwalker.Modes[3] then
  279.     end
  280. end
  281.  
  282. function Soraka:autoe()
  283.     local target = TargetSelector:GetTarget(self.E.Range, 1)
  284.     if target and IsValid(target) then
  285.     if Ready(_E) and self.shadowMenu.combo.E:Value() and self.shadowMenu.combo.EONCC:Value() and IsImmobileTarget(target) then
  286.         self:CastE(target)
  287.  
  288.     end
  289.     end
  290. end
  291. function Soraka:killsteal()
  292.     local target = TargetSelector:GetTarget(self.R.Range, 1)
  293.     if target and IsValid(target) then      
  294.     local d = myHero.pos:DistanceTo(target.pos)
  295.     local wdmg = getdmg("W", target, myHero)
  296.     local rdmg = getdmg("R", target, myHero)
  297.         if Ready(_R) and target and IsValid(target) and (target.health <= rdmg) and self.shadowMenu.killsteal.killstealr:Value() and d <= self.shadowMenu.killsteal.killstealrangemax:Value() then
  298.             self:CastR(target)
  299.         end
  300.         if Ready(_W) and target and IsValid(target) and (target.health <= wdmg) and self.shadowMenu.killsteal.killstealw:Value() then
  301.             self:CastW(target)
  302.         end
  303.     end
  304. end
  305.  
  306. function Soraka:Combo()
  307.     local target = TargetSelector:GetTarget(self.W.Range, 1)
  308.     if target == nil then return end
  309.     if Ready(_W) and target and IsValid(target) then
  310.         if self.shadowMenu.combo.W:Value() then
  311.            self:CastW(target)
  312.             --self:CastSpell(HK_Etarget)
  313.         end                                                     ---- you have "end" forget
  314.     end
  315.  
  316.     local target = TargetSelector:GetTarget(self.E.Range, 1)
  317.     if target == nil then return end
  318.     local posBehind = myHero.pos:Extended(target.pos, target.distance + 100)
  319.     if Ready(_E) and target and IsValid(target) then
  320.         if self.shadowMenu.combo.E:Value() then
  321.             self:CastE(target)
  322.             --self:CastSpell(HK_Etarget)
  323.         end
  324.     end
  325.  
  326.  
  327.  
  328.    
  329.     local distance = target.pos:DistanceTo(myHero.pos)
  330.     local target = TargetSelector:GetTarget(self.Q.Range, 1)
  331.     if target == nil then return end
  332.     if Ready(_Q) and target and IsValid(target)then
  333.         if self.shadowMenu.combo.Q:Value() then
  334.             if distance > 615 and not self:HasSecondQ() or (distance < 615 and self:HasSecondQ()) then
  335.                 Control.CastSpell(HK_Q)
  336.             end
  337.         end    
  338.     end
  339. end
  340.  
  341. function Soraka:junglekillsteal()
  342.     if self.shadowMenu.junglekillsteal.W:Value() then
  343.         for i = 1, Game.MinionCount() do
  344.             local obj = Game.Minion(i)
  345.             if obj.team ~= myHero.team then
  346.                 if obj ~= nil and obj.valid and obj.visible and not obj.dead then
  347.                     local wdmg = getdmg("W", obj, myHero, 1)
  348.                     if Ready(_W) and self.shadowMenu.junglekillsteal.W:Value() and obj and obj.team == 300 and obj.valid and obj.visible and not obj.dead and (obj.pos:DistanceTo(myHero.pos) < self.W.Range and obj.health < wdmg) then
  349.                         Control.CastSpell(HK_W, obj);
  350.                     end
  351.                 end
  352.             end
  353.         end
  354.     end
  355. end
  356.  
  357. function Soraka:HasSecondQ()
  358.     return Soraka:GotBuff(myHero, "SorakaQ") > 0
  359. end
  360.  
  361. function Soraka:GotBuff(unit, buffname)
  362.     for i = 0, unit.buffCount do
  363.         local buff = unit:GetBuff(i)
  364.         if buff and buff.name == buffname and buff.count > 0 then return buff.count end
  365.     end
  366.     return 0
  367. end
  368.  
  369. function Soraka:CastW(target)
  370.     if Ready(_W) and lastW + 350 < GetTickCount() and orbwalker:CanMove() then
  371.         local Pred = GamsteronPrediction:GetPrediction(target, self.W, myHero)
  372.         if Pred.Hitchance >= _G.HITCHANCE_NORMAL then
  373.             Control.CastSpell(HK_W, Pred.CastPosition)
  374.             lastW = GetTickCount()
  375.         end
  376.     end
  377. end
  378.  
  379. function Soraka:CastE(target)
  380.     if Ready(_E) and lastE + 350 < GetTickCount() and orbwalker:CanMove() then
  381.         local Pred = GamsteronPrediction:GetPrediction(target, self.E, myHero)
  382.         if Pred.Hitchance >= _G.HITCHANCE_NORMAL then
  383.             Control.CastSpell(HK_E, Pred.CastPosition)
  384.             lastE = GetTickCount()
  385.         end
  386.     end
  387. end
  388.  
  389. function Soraka:CastR(target)
  390.     if Ready(_R) and lastR + 350 < GetTickCount() and orbwalker:CanMove() then
  391.         local Pred = GamsteronPrediction:GetPrediction(target, self.R, myHero)
  392.         if Pred.Hitchance >= _G.HITCHANCE_NORMAL then
  393.             Control.CastSpell(HK_R, Pred.CastPosition)
  394.             lastR = GetTickCount()
  395.         end
  396.     end
  397. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement