Guest User

Tada 3.7 =)

a guest
Mar 8th, 2013
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 33.02 KB | None | 0 0
  1. -- #################################################################################################
  2. -- ##                                                                                             ##
  3. -- ##                     Glory Ryze Script                                                       ##
  4. -- ##                                Version 3.7 final                                            ##
  5. -- ##                                         based of Ultimate Ryze by bnsfg                     ##
  6. -- ##                                                                                             ##
  7. -- ##                            Completely Rewritten by Wursti                                   ##
  8. -- ##                                                                                             ##
  9. -- #################################################################################################
  10.  
  11. -- #################################################################################################
  12. -- ##                               Main Features & Changelog                                     ##
  13. -- #################################################################################################
  14. -- ## 2.0 - First Rewritten Release                                                               ##
  15. -- ## 2.1 - New Long Combo                                                                        ##
  16. -- ##     - Cage fleeing Enemies                                                                  ##
  17. -- ## 2.2 - New Harass (Auto Q Enemy in Range)                                                    ##
  18. -- ##     - Combo Switcher (Burst > Long                                                          ##
  19. -- ## 2.3 - Auto AA Farm                                                                          ##
  20. -- ## 2.4 - Fixed Bugs + Siege and Super Minion W and Q Farm if Q Framing Enabled                 ##
  21. -- ## 2.41- Fixed Critical Typo                                                                   ##
  22. -- ## 2.42- AA Farm was Toggle should be Hotkey so fixed as Hotkey                                ##
  23. -- ## 2.43- Fixed Bug that Siege Minion caused Auto Q stop working for smaller Minions            ##
  24. -- ## 2.44- Mouse Follow Toggle                                                                   ##
  25. -- ## 2.5 - Auto Cage if Enemy under Tower Harass (Many Thx at vadash)                            ##
  26. -- ## 2.6 - W Cage Only Nearest Champion  (Thx at Trus for findClosestEnemy)                      ##
  27. -- ## 2.7 - Improved OnDraw (Show Killable-Text even with Circles Disabled)                       ##
  28. -- ##     - New Menu "Ryze Combo Config" En- and Disable all PermaShow Info (Need Reload F9)      ##
  29. -- ## 3.0 - Power Farmer:                                                                         ##
  30. -- ##     - Combo Jungle Creeps if no Target is around (Thx at AutoSmite by eXtragoZ)             ##
  31. -- ##       Q - R(if Activated in Settings) - Q - W - Q - E - Q and so on...                      ##
  32. -- ##     - Fixed a possible Bug in Long Combo                                                    ##
  33. -- ##     - Redesigned Settings Menu for some Cleanup                                             ##
  34. -- ## 3.1 - New Item Support (DFG,HXG,BWC) and Ignite Support (Thx at Burn)                       ##
  35. -- ## 3.2 - Improved Tower Caging (Cage if Enemy casts against you in Tower Range -> No flee)     ##
  36. -- ## 3.3 - New Steal Objectives Mode                                                             ##
  37. -- ## 3.4 - Multiple Changes at Combos                                                            ##
  38. -- ## 3.5 - Jungle Creeps Combo now a Hotkey                                                      ##
  39. -- ##     - Added small Camps to Combo                                                            ##
  40. -- ##     - New Follow Cursor Modes:                                                              ##
  41. -- ##                                - Follow Cursor if Combo Key pressed                         ##
  42. -- ##                                - Follow Cursor if Spell is Casted                           ##
  43. -- ## 3.6 - Auto Muramana Toggle :)                                                               ##
  44. -- ## 3.61- Bugfixed!                                                                             ##
  45. -- ## 3.7 - I hope this Relese fixed the non Save of Settings
  46. -- #################################################################################################
  47.  
  48. -- #################################################################################################
  49. -- ## TODO:                                                                                       ##
  50. -- #################################################################################################
  51.  
  52. -- #################################################################################################
  53. -- ## Please Send me your Feedback so I can improve this Script further :)                        ##
  54. -- #################################################################################################
  55.  
  56.  
  57. if GetMyHero().charName ~= "Ryze" then return end
  58.  
  59. qRange = 650
  60. wRange = 625
  61. eRange = 675 -- Real range is 675
  62. rRange = 200 -- Range of your ulti AOE
  63. AARange = 550
  64. JungleRange = 1000
  65. turretRange = 950
  66. killable = {}
  67. turrets = {}
  68. qcasted = true
  69. waitDelay = 400
  70. nextTick = 0
  71. CageTurret = nil
  72. Switch = false
  73. targeting = false
  74. local ignite = nil
  75. local DFGSlot, HXGSlot, BWCSlot = nil, nil, nil
  76. local DFGREADY, HXGREADY, BWCREADY, IREADY = false, false, false, false
  77.  
  78. function OnLoad()
  79.     lastcast = _R
  80.     RyzeConfig = scriptConfig("Ryze Combo", "Ryze_Config")
  81.     RyzeConfigConfig = scriptConfig("Ryze Combo Visual Config", "Ryze_Config_Config")
  82.     RyzeSettings = scriptConfig("Ryze Combo Settings", "Ryze_Settings")
  83.     RyzeConfig:addParam("BurstActive", "Burst Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  84.     RyzeConfig:addParam("LongActive", "Long Combo", SCRIPT_PARAM_ONKEYDOWN, false, 88)
  85.     RyzeConfig:addParam("Ignite", "Ignite if Killable", SCRIPT_PARAM_ONKEYTOGGLE, true, 79)
  86.     RyzeConfig:addParam("JungleActive", "Jungle Creeps Combo", SCRIPT_PARAM_ONKEYDOWN, false, 66)
  87.     RyzeConfig:addParam("useUlti", "Use ultimate in combos", SCRIPT_PARAM_ONOFF, true)
  88.     RyzeConfig:addParam("useUltiJungle", "Use ultimate in Jungle combos", SCRIPT_PARAM_ONOFF, true)
  89.     RyzeConfig:addParam("useMura", "Auto use Muramana if Champs around", SCRIPT_PARAM_ONOFF, true)
  90.     RyzeSettings:addParam("minMuraMana", "Min Mana Muramana", SCRIPT_PARAM_SLICE, 25, 0, 100, 2)
  91.     RyzeConfig:addParam("cageW", "Cage Enemy unter Tower Harass", SCRIPT_PARAM_ONKEYTOGGLE, true, 85)
  92.     RyzeConfig:addParam("autoQFarm", "Auto Q Farm", SCRIPT_PARAM_ONKEYTOGGLE, false, 84)
  93.     RyzeConfig:addParam("PowerFarm", "Power Farm", SCRIPT_PARAM_ONKEYTOGGLE, false, 73)
  94.     RyzeConfig:addParam("autoAAFarm", "Auto AA Farm", SCRIPT_PARAM_ONKEYDOWN, false, 220)
  95.     RyzeSettings:addParam("autoAAFollow", "Auto AA Follow Cursor Toggle", SCRIPT_PARAM_ONOFF, true)
  96.     RyzeSettings:addParam("autoMouseFollow", "Go to Cursor at Spell Cast", SCRIPT_PARAM_ONOFF, false)
  97.     RyzeSettings:addParam("autoComboFollow", "Auto Follow Cursor if Combo Key pressed", SCRIPT_PARAM_ONOFF, true)
  98.     RyzeConfig:addParam("autoQToggle", "Auto Q Harass (Toggle)", SCRIPT_PARAM_ONKEYTOGGLE, false, 90)
  99.     RyzeConfig:addParam("autoQHarass", "Auto Q Harass (Hotkey)", SCRIPT_PARAM_ONKEYDOWN, false, 65)
  100.     RyzeSettings:addParam("qMinMana", "Auto Q Farm min mana %",  SCRIPT_PARAM_SLICE, 50, 0, 100, 2)
  101.     RyzeSettings:addParam("qMinManaHarass", "Auto Q Harass min mana %", SCRIPT_PARAM_SLICE, 50, 0, 100, 2)
  102.     RyzeSettings:addParam("PowerMinMana", "Power Farm min mana %", SCRIPT_PARAM_SLICE, 50, 0, 100, 2)
  103.     RyzeConfig:addParam("CageHunter", "Cage nearest Enemy Champion", SCRIPT_PARAM_ONKEYDOWN, false, 67)
  104.     RyzeSettings:addParam("whunt", "First cage with W range", SCRIPT_PARAM_SLICE, 550, 0, 625, 0)
  105.     RyzeSettings:addParam("wflee", "First cage in Long Combo if fleeing", SCRIPT_PARAM_SLICE, 550, 0, 625, 0)
  106.     RyzeSettings:addParam("winsta", "Cage without waiting on Q if fleeing", SCRIPT_PARAM_ONKEYTOGGLE, true, 77)
  107.     RyzeSettings:addParam("ComboSwitch", "Switch Combo",    SCRIPT_PARAM_ONKEYTOGGLE, true, 78)
  108.     RyzeSettings:addParam("minCDRnew", "CDR % to switch Combo", SCRIPT_PARAM_SLICE, 35, 0, 40, 0)
  109.     RyzeConfigConfig:addParam("BurstActiveshow", "Show: Burst Combo", SCRIPT_PARAM_ONOFF, true)
  110.     RyzeConfigConfig:addParam("LongActiveshow", "Show: Long Combo", SCRIPT_PARAM_ONOFF, true)
  111.     RyzeConfigConfig:addParam("useUltishow", "Show: Use ultimate in combos", SCRIPT_PARAM_ONOFF, true)
  112.     RyzeConfigConfig:addParam("cageWshow", "Show: Cage Enemy unter Tower Harass", SCRIPT_PARAM_ONOFF, true)
  113.     RyzeConfigConfig:addParam("CageHuntershow", "Show: Cage nearest Enemy Champion", SCRIPT_PARAM_ONOFF, true)
  114.     RyzeConfigConfig:addParam("winstashow", "Show: Cage without waiting on Q if fleeing", SCRIPT_PARAM_ONOFF, true)
  115.     RyzeConfigConfig:addParam("autoQFarmshow", "Show: Auto Q Farm", SCRIPT_PARAM_ONOFF, true)
  116.     RyzeConfigConfig:addParam("PowerFarmshow", "Show: Power Farm", SCRIPT_PARAM_ONOFF, true)
  117.     RyzeConfigConfig:addParam("autoAAFarmshow", "Show: autoAAFarm", SCRIPT_PARAM_ONOFF, true)
  118.     RyzeConfigConfig:addParam("autoQToggleshow", "Show: Auto Q Harass (Toggle)", SCRIPT_PARAM_ONOFF, true)
  119.     RyzeConfigConfig:addParam("autoQHarassshow", "Show: Auto Q Harass (Hotkey)", SCRIPT_PARAM_ONOFF, true)
  120.     RyzeConfigConfig:addParam("ComboSwitchshow", "Show: Switch Combo", SCRIPT_PARAM_ONOFF, true)
  121.     RyzeConfigConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  122.     if RyzeConfigConfig.BurstActiveshow then RyzeConfig:permaShow("BurstActive") end
  123.     if RyzeConfigConfig.LongActiveshow then RyzeConfig:permaShow("LongActive") end
  124.     if RyzeConfigConfig.useUltishow then RyzeConfig:permaShow("useUlti") end
  125.     if RyzeConfigConfig.cageWshow then RyzeConfig:permaShow("cageW") end
  126.     if RyzeConfigConfig.CageHuntershow then RyzeConfig:permaShow("CageHunter") end
  127.     if RyzeConfigConfig.winstashow then RyzeSettings:permaShow("winsta") end
  128.     if RyzeConfigConfig.autoQFarmshow then RyzeConfig:permaShow("autoQFarm") end
  129.     if RyzeConfigConfig.PowerFarmshow then RyzeConfig:permaShow("PowerFarm") end
  130.     if RyzeConfigConfig.autoAAFarmshow then RyzeConfig:permaShow("autoAAFarm") end
  131.     if RyzeConfigConfig.autoQToggleshow then RyzeConfig:permaShow("autoQToggle") end
  132.     if RyzeConfigConfig.autoQHarassshow then RyzeConfig:permaShow("autoQHarass") end
  133.     if RyzeConfigConfig.ComboSwitchshow then RyzeSettings:permaShow("ComboSwitch") end
  134.     PrintChat ("Glory Ryze 3.7 final by Wursti loaded! Original scripts by bnsfg and TRUS.")
  135.     PrintChat ("Report Bugs and give Feedback Please :) THX!!")
  136.     ts = TargetSelector(TARGET_LOW_HP,qRange,DAMAGE_MAGIC,false)
  137.     ts.name = "Ryze"
  138.     ASLoadMinions()
  139.     RyzeConfig:addTS(ts)
  140.     enemyMinions = minionManager(MINION_ENEMY, qRange, player, MINION_SORT_HEALTH_ASC)
  141.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then
  142.         ignite = SUMMONER_1
  143.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then
  144.         ignite = SUMMONER_2
  145.     end
  146.     for i = 1, objManager.maxObjects do
  147.         local object = objManager:getObject(i)
  148.         if object ~= nil and object.type == "obj_AI_Turret" then
  149.             local turretName = object.name
  150.             turrets[turretName] =
  151.             {
  152.                 object = object,
  153.                 team = object.team,
  154.                 range = turretRange,
  155.                 x = object.x,
  156.                 y = object.y,
  157.                 z = object.z,
  158.                 active = false,
  159.             }
  160.         end
  161.     end
  162. end
  163.  
  164.  
  165. function doSpell(ts, spell, range)
  166.     if ts.target ~= nil and GetMyHero():CanUseSpell(spell) == READY and GetDistance(ts.target)<=range then
  167.         CastSpell(spell, ts.target)
  168.     end
  169. end
  170.  
  171. function findClosestEnemy()
  172. local closestEnemy = nil
  173. local currentEnemy = nil
  174. for i=1, heroManager.iCount do
  175.     currentEnemy = heroManager:GetHero(i)
  176.     if currentEnemy.team ~= myHero.team and not currentEnemy.dead and currentEnemy.visible then
  177.         if closestEnemy == nil then
  178.             closestEnemy = currentEnemy
  179.         elseif GetDistance(currentEnemy) < GetDistance(closestEnemy) then
  180.             closestEnemy = currentEnemy
  181.         end
  182.     end
  183. end
  184. return closestEnemy
  185. end
  186.  
  187. function OnDraw()
  188.     if myHero.dead then return end  
  189.     if RyzeConfig.LongActive then DrawCircle(myHero.x, myHero.y, myHero.z, RyzeSettings.wflee, 0xFFFF0000) end
  190.     if RyzeConfigConfig.drawcircles then DrawCircle(myHero.x, myHero.y, myHero.z, RyzeSettings.whunt, 0xFFFFFF00) end
  191.     if RyzeConfigConfig.drawcircles then DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0xFF80FF00) end
  192.     if RyzeConfigConfig.drawcircles then DrawCircle(myHero.x, myHero.y, myHero.z, wRange, 0xFFE01B6A) end
  193.    
  194.     if ts.target ~= nil then
  195.         local enemyInRange = 0
  196.         for i = 1, heroManager.iCount, 1 do
  197.             local hero = heroManager:getHero(i)
  198.             if ValidTarget(hero) then
  199.                 enemyInRange = enemyInRange + 1
  200.                 if killable[i] == 1 then
  201.                     if RyzeConfigConfig.drawcircles then DrawCircle(hero.x, hero.y, hero.z, 110, 0xFF0000) end
  202.                     PrintFloatText(hero,0,"Cooldown")
  203.                 elseif killable[i] == 2 then
  204.                     if RyzeConfigConfig.drawcircles then DrawCircle(hero.x, hero.y, hero.z, 110, 0xFF0000) end
  205.                     if RyzeConfigConfig.drawcircles then DrawCircle(hero.x, hero.y, hero.z, 150, 0xFF0000) end
  206.                     PrintFloatText(hero,0,"Kill!")
  207.                 end
  208.             end
  209.         end
  210.         if RyzeConfigConfig.drawcircles then DrawCircle(ts.target.x, ts.target.y, ts.target.z, 100, 0xFF80FF00) end
  211.     end
  212.     if MonsterTarget ~= nil and ValidTarget(MonsterTarget) then
  213.         if RyzeConfigConfig.drawcircles then DrawCircle(MonsterTarget.x, MonsterTarget.y, MonsterTarget.z, 100, 0xFF80FF00) end
  214.         if MonsterKillable == true and RyzeConfigConfig.drawcircles then
  215.             DrawCircle(MonsterTarget.x, MonsterTarget.y, MonsterTarget.z, 150, 0xFF0000)
  216.             DrawCircle(MonsterTarget.x, MonsterTarget.y, MonsterTarget.z, 160, 0xFF0000)
  217.             DrawCircle(MonsterTarget.x, MonsterTarget.y, MonsterTarget.z, 170, 0xFF0000)
  218.         end
  219.     end
  220. end
  221.  
  222.  
  223. function Damg()
  224.         for i=1, heroManager.iCount do
  225.                 local hero = heroManager:GetHero(i)
  226.                 if ValidTarget(hero) then
  227.                         local qdmg = getDmg("Q",hero,myHero)
  228.                         local edmg = getDmg("E",hero,myHero)
  229.                         local wdmg = getDmg("W",hero,myHero)
  230.                         local aa = getDmg("AD",hero,myHero)
  231.                         if IREADY then
  232.                             idmg =  getDmg("IGNITE",hero,myHero)
  233.                         else
  234.                             idmg = 0
  235.                         end                      
  236.                         local combo1 = qdmg + edmg + wdmg + qdmg + idmg
  237.                         local combo2 = idmg
  238.                
  239.                 if myHero:CanUseSpell(_Q) == READY then
  240.                         combo2 = qdmg + combo2
  241.                 end
  242.                
  243.                 if myHero:CanUseSpell(_E) == READY then
  244.                         combo2 = edmg + combo2
  245.                 end
  246.                
  247.                 if myHero:CanUseSpell(_W) then
  248.                         combo2 = edmg + combo2
  249.                 end
  250.                
  251.                 if myHero:CanUseSpell(_Q) and myHero:CanUseSpell(_E) and myHero:CanUseSpell(_W) == READY then
  252.                         combo2 = edmg + combo2
  253.                 end
  254.  
  255.                 if combo2 >= hero.health then
  256.                         killable[i] = 2
  257.                 elseif combo1 >= hero.health then
  258.                         killable[i] = 1
  259.                 else
  260.                         killable[i] = 0
  261.                 end
  262.         end
  263.     end
  264. end
  265.  
  266. function OnTick()
  267. checkTurretState()
  268. ts:update()
  269. Damg()
  270. enemyMinions:update()
  271. DFGSlot, HXGSlot, BWCSlot = GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144)
  272. DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  273. HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  274. BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  275. IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  276. if math.abs(myHero.cdr*100) >= RyzeSettings.minCDRnew and RyzeSettings.ComboSwitch then
  277.     Switch = true
  278. else
  279.     Switch = false
  280. end
  281. CageTurret = findClosestTurret()
  282. if myHero:GetDistance(CageTurret.object) <= 900 and CageTurret.team == player.team then
  283.     InTurretRange = true
  284. else
  285.     InTurretRange = false
  286. end
  287. if not myHero.dead then
  288.     if RyzeConfig.useMura then
  289.         MuramanaToggle(1000, ((player.mana / player.maxMana) > (RyzeSettings.minMuraMana / 100)))
  290.     end
  291.     if RyzeConfig.BurstActive and ValidTarget(ts.target) and Switch == false then
  292.         if DFGREADY then
  293.             CastSpell(DFGSlot, ts.target)
  294.         end
  295.         if HXGREADY then
  296.             CastSpell(HXGSlot, ts.target)
  297.         end
  298.         if BWCREADY then
  299.             CastSpell(BWCSlot, ts.target)
  300.         end
  301.         if myHero:CanUseSpell(_W) == READY and myHero:GetDistance(ts.target) > RyzeSettings.whunt then
  302.             doSpell(ts, _W, wRange)
  303.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  304.         elseif myHero:CanUseSpell(_Q) == READY and myHero:GetDistance(ts.target) <= RyzeSettings.whunt then
  305.             doSpell(ts, _Q, qRange)
  306.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  307.             if RyzeConfig.useUlti and myHero:CanUseSpell(_R) == READY then
  308.                 CastSpell(_R)
  309.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  310.             end
  311.         elseif myHero:CanUseSpell(_Q) == READY then
  312.             doSpell(ts, _Q, qRange)
  313.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  314.         elseif RyzeConfig.useUlti and myHero:CanUseSpell(_R) == READY then
  315.             CastSpell(_R)
  316.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  317.         elseif myHero:CanUseSpell(_E) == READY then
  318.             doSpell(ts, _E, wRange)
  319.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  320.         elseif myHero:CanUseSpell(_W) == READY then
  321.             doSpell(ts, _W, eRange)
  322.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  323.         end
  324.     elseif (RyzeConfig.LongActive or (Switch and RyzeConfig.BurstActive)) and ValidTarget(ts.target) then
  325.         if DFGREADY then
  326.             CastSpell(DFGSlot, ts.target)
  327.         end
  328.         if HXGREADY then
  329.             CastSpell(HXGSlot, ts.target)
  330.         end
  331.         if BWCREADY then
  332.             CastSpell(BWCSlot, ts.target)
  333.         end
  334.         if myHero:CanUseSpell(_Q) == READY and myHero:GetDistance(ts.target) <= RyzeSettings.whunt then
  335.             doSpell(ts, _Q, qRange)
  336.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  337.             qcasted = true
  338.             if RyzeConfig.useUlti and myHero:CanUseSpell(_R) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN then
  339.                 CastSpell(_R)
  340.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  341.                 qcasted = false
  342.             end
  343.         elseif myHero:CanUseSpell(_W) == READY and myHero:GetDistance(ts.target) > RyzeSettings.whunt then
  344.             doSpell(ts, _W, wRange)
  345.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  346.             qcasted = false
  347.             if myHero:CanUseSpell(_Q) == READY then
  348.                 doSpell(ts, _Q, qRange)
  349.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  350.                 qcasted = true
  351.             end
  352.         elseif myHero:CanUseSpell(_Q) == READY then
  353.             doSpell(ts, _Q, qRange)
  354.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  355.             qcasted = true
  356.         elseif RyzeConfig.useUlti and myHero:CanUseSpell(_R) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN then
  357.             CastSpell(_R)
  358.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  359.             qcasted = false
  360.         elseif myHero:CanUseSpell(_W) == READY and ((qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN and myHero:GetDistance(ts.target) >= RyzeSettings.wflee) or (RyzeSettings.winsta == true and myHero:GetDistance(ts.target) >= RyzeSettings.wflee)) then
  361.             doSpell(ts, _W, wRange)
  362.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  363.             qcasted = false
  364.         elseif myHero:CanUseSpell(_E) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN then
  365.             doSpell(ts, _E, wRange)
  366.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  367.             qcasted = false
  368.         elseif myHero:CanUseSpell(_W) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN then
  369.             doSpell(ts, _W, wRange)
  370.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  371.             qcasted = false
  372.         end
  373.     elseif RyzeConfig.JungleActive then
  374.         closest = findClosestEnemy()
  375.         if ValidTarget(closest) then
  376.             if myHero:GetDistance(closest) > JungleRange then
  377.                 SaveJungle = true
  378.             end
  379.         elseif closest == nil then
  380.             SaveJungle = true
  381.         else
  382.             SaveJungle = false
  383.         end
  384.         if ValidTarget(MonsterTarget) then
  385.             if myHero:GetDistance(MonsterTarget) > eRange then
  386.                 MiniMonster = false
  387.                 CheckMonster(Vilemaw)
  388.                 CheckMonster(Nashor)
  389.                 CheckMonster(Dragon)
  390.                 CheckMonster(Golem1)
  391.                 CheckMonster(Golem2)
  392.                 CheckMonster(Lizard1)
  393.                 CheckMonster(Lizard2)
  394.             end
  395.         else
  396.             MiniMonster = false
  397.             CheckMonster(Vilemaw)
  398.             CheckMonster(Nashor)
  399.             CheckMonster(Dragon)
  400.             CheckMonster(Golem1)
  401.             CheckMonster(Golem2)
  402.             CheckMonster(Lizard1)
  403.             CheckMonster(Lizard2)
  404.         end
  405.         if SaveJungle == true and MiniMonster == false and targeting == true then
  406.             if myHero:CanUseSpell(_Q) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=qRange then
  407.                 CastSpell(_Q, MonsterTarget)
  408.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  409.                 qcasted = true
  410.             elseif RyzeConfig.useUltiJungle and myHero:CanUseSpell(_R) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=qRange then
  411.                 CastSpell(_R)
  412.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  413.                 qcasted = false
  414.             elseif myHero:CanUseSpell(_E) == READY and qcasted == true and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=eRange then
  415.                 CastSpell(_E, MonsterTarget)
  416.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  417.                 qcasted = false
  418.             elseif myHero:CanUseSpell(_W) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=wRange then
  419.                 CastSpell(_W, MonsterTarget)
  420.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  421.                 qcasted = false
  422.             end
  423.         if ValidTarget(MonsterTarget) then
  424.             if ((MonsterDMG("Q",_Q,MonsterTarget,qRange) + MonsterDMG("W",_W,MonsterTarget,wRange)) >= MonsterTarget.health) then
  425.                 MonsterKillable = true
  426.                 if myHero:CanUseSpell(_Q) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=qRange then
  427.                     CastSpell(_Q, MonsterTarget)
  428.                 end
  429.                 if myHero:CanUseSpell(_W) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=wRange then
  430.                     CastSpell(_W, MonsterTarget)
  431.                 end
  432.                 if myHero:CanUseSpell(_E) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=eRange then
  433.                     CastSpell(_E, MonsterTarget)
  434.                 end
  435.             else
  436.                 MonsterKillable = false
  437.             end
  438.         end
  439.         end
  440.         if SaveJungle == true and (not ValidTarget(MonsterTarget) or (MiniMonster == true and targeting == true)) then
  441.             MiniMonster = true
  442.             CheckMonster(Wolf1)
  443.             CheckMonster(Wolf2)
  444.             CheckMonster(Golem1)
  445.             CheckMonster(Golem2)
  446.             CheckMonster(Wraith1)
  447.             CheckMonster(Wraith2)
  448.             if myHero:CanUseSpell(_R) == READY and RyzeConfig.useUltiJungle and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=eRange then
  449.                 CastSpell(_R)
  450.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  451.             elseif myHero:CanUseSpell(_E) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=eRange then
  452.                 CastSpell(_E, MonsterTarget)
  453.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  454.             elseif myHero:CanUseSpell(_Q) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=qRange then
  455.                 CastSpell(_Q, MonsterTarget)
  456.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  457.             elseif myHero:CanUseSpell(_W) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=wRange then
  458.                 CastSpell(_W, MonsterTarget)
  459.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  460.             end
  461.         end
  462.     elseif RyzeConfig.autoQFarm and RyzeSettings.qMinMana<=((myHero.mana/myHero.maxMana)*100) and RyzeConfig.BurstActive == false and RyzeConfig.LongActive == false and RyzeConfig.autoQHarass == false and RyzeConfig.autoQToggle == false then
  463.         MinionSelect = {}
  464.         for index, minion in pairs(enemyMinions.objects) do
  465.             local myQ = getDmg("Q",minion,myHero)
  466.             local myW = getDmg("W",minion,myHero)
  467.             if (minion.maxHealth >= 700+27*math.floor(GetGameTimer()/180000)) then
  468.                 local ProMinion = minion
  469.                 if myHero:CanUseSpell(_Q) == READY and myHero:GetDistance(ProMinion) ~= nil and myHero:GetDistance(ProMinion) <= qRange and ProMinion.health ~= nil and ProMinion.health <= player:CalcDamage(ProMinion, myQ) and ProMinion.visible ~= nil and ProMinion.visible == true and  RyzeConfig.BurstActive == false and RyzeConfig.LongActive == false then
  470.                     CastSpell(_Q, ProMinion)
  471.                 elseif myHero:CanUseSpell(_W) == READY and myHero:GetDistance(ProMinion) ~= nil and myHero:GetDistance(ProMinion) <= wRange and ProMinion.health ~= nil and ProMinion.health <= player:CalcDamage(ProMinion, myW) and ProMinion.visible ~= nil and ProMinion.visible == true and  RyzeConfig.BurstActive == false and RyzeConfig.LongActive == false then
  472.                     CastSpell(_W, ProMinion)
  473.                 end
  474.             end
  475.             if myHero:CanUseSpell(_Q) == READY and myHero:GetDistance(minion) ~= nil and myHero:GetDistance(minion) <= qRange and minion.health ~= nil and minion.health <= player:CalcDamage(minion, myQ) and minion.visible ~= nil and minion.visible == true and  RyzeConfig.BurstActive == false and RyzeConfig.LongActive == false then
  476.                 CastSpell(_Q, minion)
  477.             end
  478.         end
  479.     elseif RyzeConfig.PowerFarm and RyzeSettings.PowerMinMana<=((myHero.mana/myHero.maxMana)*100) and RyzeConfig.BurstActive == false and RyzeConfig.LongActive == false and RyzeConfig.autoQHarass == false and RyzeConfig.autoQToggle == false then
  480.         MinionSelect = {}
  481.         for index, minion in pairs(enemyMinions.objects) do
  482.             local myQ = getDmg("Q",minion,myHero)
  483.             local myW = getDmg("W",minion,myHero)
  484.             local myE = getDmg("E",minion,myHero)
  485.             if etarget ~= minion and wtarget ~= minion and myHero:CanUseSpell(_Q) == READY and myHero:GetDistance(minion) ~= nil and myHero:GetDistance(minion) <= qRange and minion.health ~= nil and minion.health <= player:CalcDamage(minion, myQ) and minion.visible ~= nil and minion.visible == true and  RyzeConfig.BurstActive == false and RyzeConfig.LongActive == false then
  486.                 CastSpell(_Q, minion)
  487.                 qtarget = minion
  488.             end
  489.             if etarget ~= minion and qtarget ~= minion and myHero:CanUseSpell(_W) == READY and myHero:GetDistance(minion) ~= nil and myHero:GetDistance(minion) <= wRange and minion.health ~= nil and minion.health <= player:CalcDamage(minion, myW) and minion.visible ~= nil and minion.visible == true and  RyzeConfig.BurstActive == false and RyzeConfig.LongActive == false then
  490.                 CastSpell(_W, minion)
  491.                 wtarget = minion
  492.             end
  493.             if qtarget ~= minion and wtarget ~= minion and myHero:CanUseSpell(_E) == READY and myHero:GetDistance(minion) ~= nil and myHero:GetDistance(minion) <= eRange and minion.health ~= nil and minion.health <= player:CalcDamage(minion, myE) and minion.visible ~= nil and minion.visible == true and  RyzeConfig.BurstActive == false and RyzeConfig.LongActive == false then
  494.                 CastSpell(_E, minion)
  495.                 etarget = minion
  496.             end
  497.         end
  498.     end
  499.     if RyzeConfig.autoAAFarm and GetTickCount() > nextTick then
  500.         if RyzeSettings.autoAAFollow then
  501.             player:MoveTo(mousePos.x, mousePos.z)
  502.         end
  503.         for index, minion in pairs(enemyMinions.objects) do
  504.             local myAA = getDmg("AD",minion,myHero)
  505.             if myHero:GetDistance(minion) ~= nil and  myHero:GetDistance(minion) <= AARange and minion.health ~= nil and minion.health <= myAA and minion.visible ~= nil and minion.visible == true then
  506.                 player:Attack(minion)
  507.             end
  508.          nextTick = GetTickCount() + waitDelay
  509.         end
  510.     end
  511.     if (RyzeConfig.autoQHarass or RyzeConfig.autoQToggle) and RyzeSettings.qMinManaHarass<=((myHero.mana/myHero.maxMana)*100) and RyzeConfig.BurstActive == false and RyzeConfig.LongActive == false and ValidTarget(ts.target) then
  512.         if myHero:CanUseSpell(_Q) == READY then
  513.             doSpell(ts, _Q, qRange)
  514.         end
  515.     end
  516.     if RyzeConfig.CageHunter and myHero:CanUseSpell(_W) == READY then
  517.         closest = findClosestEnemy()
  518.         if ValidTarget(closest) then
  519.             if myHero:GetDistance(closest) < wRange and ValidTarget(closest) then
  520.                 CastSpell(_W, closest)
  521.             end
  522.         end
  523.     end
  524.     if RyzeConfig.Ignite then      
  525.         if IREADY then
  526.             local ignitedmg = 0    
  527.             for j = 1, heroManager.iCount, 1 do
  528.                 local enemyhero = heroManager:getHero(j)
  529.                 if ValidTarget(enemyhero,600) then
  530.                     ignitedmg = 50 + 20 * myHero.level
  531.                     if enemyhero.health <= ignitedmg then
  532.                         CastSpell(ignite, enemyhero)
  533.                     end
  534.                 end
  535.             end
  536.         end
  537.     end
  538.     if RyzeSettings.autoComboFollow and (RyzeConfig.BurstActive == true or RyzeConfig.LongActive == true) then
  539.         player:MoveTo(mousePos.x, mousePos.z)
  540.     end
  541. end
  542. end
  543.  
  544. function OnProcessSpell(unit, spell)
  545. --[[    if (spell.name:find("ChaosTurret") and myHero.team == TEAM_RED) or (spell.name:find("OrderTurret") and myHero.team == TEAM_BLUE) and RyzeConfig.cageW then
  546.         for i=1, heroManager.iCount do
  547.             local enemy = heroManager:GetHero(i)
  548.             if ValidTarget(enemy) then
  549.                 if GetDistance(spell.endPos, enemy)<80 and GetDistance(enemy)<=wRange and myHero:CanUseSpell(_W) == READY then
  550.                     CastSpell(_W, enemy)
  551.                 end
  552.             end
  553.         end            
  554.     end
  555. -- ]]
  556. if InTurretRange == true then
  557.     if unit.team == TEAM_ENEMY and GetDistance(unit) < wRange and GetDistance(spell.endPos, myHero)<10 then
  558.         for i=1, heroManager.iCount do
  559.             local enemy = heroManager:GetHero(i)
  560.             if ValidTarget(enemy) then
  561.                 if enemy.name == unit.name then
  562.                     if GetDistance(enemy)<=wRange and myHero:CanUseSpell(_W) == READY then
  563.                         CastSpell(_W, enemy)
  564.                     end
  565.                 end
  566.             end
  567.         end
  568.     end
  569. end
  570. end
  571.  
  572. function findClosestTurret()
  573. local closestTurret = nil
  574. local currentTurret = nil
  575. for name, turret in pairs(turrets) do
  576.     if turret.object.valid ~= false then
  577.         currentTurret = turret
  578.     end
  579.     if turret.team == myHero.team then
  580.         if closestTurret == nil then
  581.             closestTurret = currentTurret
  582.         elseif GetDistance(currentTurret) < GetDistance(closestTurret) then
  583.             closestTurret = currentTurret
  584.         end
  585.     end
  586. end
  587. return closestTurret
  588. end
  589.  
  590.  
  591. function OnCreateObj(obj)
  592.     if obj ~= nil and obj.type == "obj_AI_Minion" and obj.name ~= nil then
  593.         if obj.name == "TT_Spiderboss7.1.1" then Vilemaw = obj
  594.         elseif obj.name == "Worm12.1.1" then Nashor = obj
  595.         elseif obj.name == "Dragon6.1.1" then Dragon = obj
  596.         elseif obj.name == "AncientGolem1.1.1" then Golem1 = obj
  597.         elseif obj.name == "AncientGolem7.1.1" then Golem2 = obj
  598.         elseif obj.name == "LizardElder4.1.1" then Lizard1 = obj
  599.         elseif obj.name == "LizardElder10.1.1" then Lizard2 = obj
  600.         elseif obj.name == "GiantWolf2.1.3" then Wolf1 = obj
  601.         elseif obj.name == "GiantWolf8.1.3" then Wolf2 = obj
  602.         elseif obj.name == "Wraith3.1.3" then Wraith1 = obj
  603.         elseif obj.name == "Wraith9.1.3" then Wraith2 = obj
  604.         elseif obj.name == "Golem5.1.2" then Golem1 = obj
  605.         elseif obj.name == "Golem11.1.2" then Golem2 = obj
  606.         end
  607.     end
  608. end
  609.  
  610. function OnDeleteObj(object)
  611.     if object ~= nil and object.type == "obj_AI_Turret" then
  612.         for name, turret in pairs(turrets) do
  613.             if name == object.name then
  614.                 turrets[name] = nil
  615.                 return
  616.             end
  617.         end
  618.     end
  619. end
  620.  
  621. function ASLoadMinions()
  622.     for i = 1, objManager.maxObjects do
  623.         local obj = objManager:getObject(i)
  624.         if obj ~= nil and obj.type == "obj_AI_Minion" and obj.name ~= nil then
  625.             if obj.name == "TT_Spiderboss7.1.1" then Vilemaw = obj
  626.             elseif obj.name == "Worm12.1.1" then Nashor = obj
  627.             elseif obj.name == "Dragon6.1.1" then Dragon = obj
  628.             elseif obj.name == "AncientGolem1.1.1" then Golem1 = obj
  629.             elseif obj.name == "AncientGolem7.1.1" then Golem2 = obj
  630.             elseif obj.name == "LizardElder4.1.1" then Lizard1 = obj
  631.             elseif obj.name == "LizardElder10.1.1" then Lizard2 = obj
  632.             elseif obj.name == "GiantWolf2.1.3" then Wolf1 = obj
  633.             elseif obj.name == "GiantWolf8.1.3" then Wolf2 = obj
  634.             elseif obj.name == "Wraith3.1.3" then Wraith1 = obj
  635.             elseif obj.name == "Wraith9.1.3" then Wraith2 = obj
  636.             elseif obj.name == "Golem5.1.2" then Golem1 = obj
  637.             elseif obj.name == "Golem11.1.2" then Golem2 = obj
  638.             end
  639.         end
  640.     end
  641. end
  642.  
  643.  
  644. function CheckMonster(minion)
  645. if minion ~= nil and ValidTarget(minion) then
  646.     if myHero:GetDistance(minion) < eRange then
  647.         MonsterTarget = minion
  648.         targeting = true
  649.     elseif not ValidTarget(MonsterTarget) then
  650.         targeting = false
  651.     end
  652. end
  653. end
  654.  
  655. function MonsterDMG(dmgspell,spell,monster,range)
  656.     if monster ~= nil and GetMyHero():CanUseSpell(spell) == READY and GetDistance(monster)<=range then
  657.         return getDmg(dmgspell,monster,myHero)
  658.     else
  659.         return 0
  660.     end
  661. end
  662.  
  663. function checkTurretState()
  664.     for name, turret in pairs(turrets) do
  665.         if turret.object.valid == false then
  666.             turrets[name] = nil
  667.         end
  668.     end
  669. end
  670.  
  671.  quotes = { 'Let\'s go, let\'s go!',
  672.  'Unpleasant? I\'ll show you unpleasant!',
  673.  'Take this scroll and stick it... somewhere safe.',
  674.  'I got these tattoos in rune prison!',
  675.  'Right back at you!'}
  676. PrintFloatText(myHero, 10, quotes[math.random(5)])
Advertisement
Add Comment
Please, Sign In to add comment