Guest User

Ryze 3.8

a guest
Apr 7th, 2013
18,408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 35.71 KB | None | 0 0
  1. -- #################################################################################################
  2. -- ##                                                                                             ##
  3. -- ##                     Glory Ryze Script                                                       ##
  4. -- ##                                Version 3.8 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. -- ## 3.71- Use Ultimate in Jungle Combo is a Key Toggle again (L by default)                     ##
  47. -- ## 3.8 - Auto Level Up (Q or W,if 1. W then Q or 1. Q then W,E,Q,Q,R,Q,W,Q,W,R,W,W,E,E,R,E,E)  ##
  48. -- #################################################################################################
  49.  
  50. -- #################################################################################################
  51. -- ## TODO:                                                                                       ##
  52. -- #################################################################################################
  53.  
  54. -- #################################################################################################
  55. -- ## Please Send me your Feedback so I can improve this Script further :)                        ##
  56. -- #################################################################################################
  57.  
  58.  
  59. if GetMyHero().charName ~= "Ryze" then return end
  60.  
  61. qRange = 650
  62. wRange = 625
  63. eRange = 675 -- Real range is 675
  64. rRange = 200 -- Range of your ulti AOE
  65. AARange = 550
  66. JungleRange = 1000
  67. turretRange = 950
  68. local waittxt = {}
  69. local calculationenemy = 1
  70. local tick = nil
  71. killable = {}
  72. turrets = {}
  73. qcasted = true
  74. waitDelay = 400
  75. nextTick = 0
  76. CageTurret = nil
  77. Switch = false
  78. targeting = false
  79. local ignite = nil
  80. local DFGSlot, HXGSlot, BWCSlot = nil, nil, nil
  81. local DFGREADY, HXGREADY, BWCREADY, IREADY = false, false, false, false
  82. local floattext = {"Cooldown!","Murder him!"}
  83. local levelSequence = {nil,0,3,1,1,4,1,2,1,2,4,2,2,3,3,4,3,3}
  84.  
  85. function OnLoad()
  86.     lastcast = _R
  87.     RyzeConfig = scriptConfig("Ryze Combo", "Ryze_Config")
  88.     RyzeConfigConfig = scriptConfig("Ryze Combo Visual Config", "Ryze_Config_Config")
  89.     RyzeSettings = scriptConfig("Ryze Combo Settings", "Ryze_Settings")
  90.     RyzeConfig:addParam("BurstActive", "Burst Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  91.     RyzeConfig:addParam("LongActive", "Long Combo", SCRIPT_PARAM_ONKEYDOWN, false, 88)
  92.     RyzeConfig:addParam("Ignite", "Ignite if Killable", SCRIPT_PARAM_ONKEYTOGGLE, true, 79)
  93.     RyzeConfig:addParam("JungleActive", "Jungle Creeps Combo", SCRIPT_PARAM_ONKEYDOWN, false, 66)
  94.     RyzeConfig:addParam("useUlti", "Use ultimate in combos", SCRIPT_PARAM_ONOFF, true)
  95.     RyzeConfig:addParam("useUltiJungle", "Use ultimate in Jungle combos", SCRIPT_PARAM_ONKEYDOWN, true, 76)
  96.     RyzeConfig:addParam("useMura", "Auto use Muramana if Champs around", SCRIPT_PARAM_ONOFF, true)
  97.     RyzeSettings:addParam("minMuraMana", "Min Mana Muramana", SCRIPT_PARAM_SLICE, 25, 0, 100, 2)
  98.     RyzeConfig:addParam("cageW", "Cage Enemy unter Tower Harass", SCRIPT_PARAM_ONKEYTOGGLE, true, 85)
  99.     RyzeConfig:addParam("autoQFarm", "Auto Q Farm", SCRIPT_PARAM_ONKEYTOGGLE, false, 84)
  100.     RyzeConfig:addParam("PowerFarm", "Power Farm", SCRIPT_PARAM_ONKEYTOGGLE, false, 73)
  101.     RyzeConfig:addParam("autoAAFarm", "Auto AA Farm", SCRIPT_PARAM_ONKEYDOWN, false, 220)
  102.     RyzeSettings:addParam("autoAAFollow", "Auto AA Follow Cursor Toggle", SCRIPT_PARAM_ONOFF, true)
  103.     RyzeSettings:addParam("autoMouseFollow", "Go to Cursor at Spell Cast", SCRIPT_PARAM_ONOFF, false)
  104.     RyzeSettings:addParam("autoComboFollow", "Auto Follow Cursor if Combo Key pressed", SCRIPT_PARAM_ONOFF, true)
  105.     RyzeConfig:addParam("autoQToggle", "Auto Q Harass (Toggle)", SCRIPT_PARAM_ONKEYTOGGLE, false, 90)
  106.     RyzeConfig:addParam("autoQHarass", "Auto Q Harass (Hotkey)", SCRIPT_PARAM_ONKEYDOWN, false, 65)
  107.     RyzeSettings:addParam("qMinMana", "Auto Q Farm min mana %",  SCRIPT_PARAM_SLICE, 50, 0, 100, 2)
  108.     RyzeSettings:addParam("qMinManaHarass", "Auto Q Harass min mana %", SCRIPT_PARAM_SLICE, 50, 0, 100, 2)
  109.     RyzeSettings:addParam("PowerMinMana", "Power Farm min mana %", SCRIPT_PARAM_SLICE, 50, 0, 100, 2)
  110.     RyzeConfig:addParam("CageHunter", "Cage nearest Enemy Champion", SCRIPT_PARAM_ONKEYDOWN, false, 67)
  111.     RyzeSettings:addParam("whunt", "First cage with W range", SCRIPT_PARAM_SLICE, 550, 0, 625, 0)
  112.     RyzeSettings:addParam("wflee", "First cage in Long Combo if fleeing", SCRIPT_PARAM_SLICE, 550, 0, 625, 0)
  113.     RyzeSettings:addParam("winsta", "Cage without waiting on Q if fleeing", SCRIPT_PARAM_ONKEYTOGGLE, true, 77)
  114.     RyzeSettings:addParam("ComboSwitch", "Switch Combo",    SCRIPT_PARAM_ONKEYTOGGLE, true, 78)
  115.     RyzeSettings:addParam("minCDRnew", "CDR % to switch Combo", SCRIPT_PARAM_SLICE, 35, 0, 40, 0)
  116.     RyzeConfigConfig:addParam("BurstActiveshow", "Show: Burst Combo", SCRIPT_PARAM_ONOFF, true)
  117.     RyzeConfigConfig:addParam("LongActiveshow", "Show: Long Combo", SCRIPT_PARAM_ONOFF, true)
  118.     RyzeConfigConfig:addParam("useUltishow", "Show: Use ultimate in combos", SCRIPT_PARAM_ONOFF, true)
  119.     RyzeConfigConfig:addParam("cageWshow", "Show: Cage Enemy unter Tower Harass", SCRIPT_PARAM_ONOFF, true)
  120.     RyzeConfigConfig:addParam("CageHuntershow", "Show: Cage nearest Enemy Champion", SCRIPT_PARAM_ONOFF, true)
  121.     RyzeConfigConfig:addParam("winstashow", "Show: Cage without waiting on Q if fleeing", SCRIPT_PARAM_ONOFF, true)
  122.     RyzeConfigConfig:addParam("autoQFarmshow", "Show: Auto Q Farm", SCRIPT_PARAM_ONOFF, true)
  123.     RyzeConfigConfig:addParam("PowerFarmshow", "Show: Power Farm", SCRIPT_PARAM_ONOFF, true)
  124.     RyzeConfigConfig:addParam("autoAAFarmshow", "Show: autoAAFarm", SCRIPT_PARAM_ONOFF, true)
  125.     RyzeConfigConfig:addParam("autoQToggleshow", "Show: Auto Q Harass (Toggle)", SCRIPT_PARAM_ONOFF, true)
  126.     RyzeConfigConfig:addParam("autoQHarassshow", "Show: Auto Q Harass (Hotkey)", SCRIPT_PARAM_ONOFF, true)
  127.     RyzeConfigConfig:addParam("ComboSwitchshow", "Show: Switch Combo", SCRIPT_PARAM_ONOFF, true)
  128.     RyzeConfigConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  129.     if RyzeConfigConfig.BurstActiveshow then RyzeConfig:permaShow("BurstActive") end
  130.     if RyzeConfigConfig.LongActiveshow then RyzeConfig:permaShow("LongActive") end
  131.     if RyzeConfigConfig.useUltishow then RyzeConfig:permaShow("useUlti") end
  132.     if RyzeConfigConfig.cageWshow then RyzeConfig:permaShow("cageW") end
  133.     if RyzeConfigConfig.CageHuntershow then RyzeConfig:permaShow("CageHunter") end
  134.     if RyzeConfigConfig.winstashow then RyzeSettings:permaShow("winsta") end
  135.     if RyzeConfigConfig.autoQFarmshow then RyzeConfig:permaShow("autoQFarm") end
  136.     if RyzeConfigConfig.PowerFarmshow then RyzeConfig:permaShow("PowerFarm") end
  137.     if RyzeConfigConfig.autoAAFarmshow then RyzeConfig:permaShow("autoAAFarm") end
  138.     if RyzeConfigConfig.autoQToggleshow then RyzeConfig:permaShow("autoQToggle") end
  139.     if RyzeConfigConfig.autoQHarassshow then RyzeConfig:permaShow("autoQHarass") end
  140.     if RyzeConfigConfig.ComboSwitchshow then RyzeSettings:permaShow("ComboSwitch") end
  141.     PrintChat ("Glory Ryze 3.8 final by Wursti loaded! Original scripts by bnsfg and TRUS.")
  142.     PrintChat ("Report Bugs and give Feedback Please :) THX!!")
  143.     ts = TargetSelector(TARGET_LOW_HP,qRange,DAMAGE_MAGIC,false)
  144.     ts.name = "Ryze"
  145.     ASLoadMinions()
  146.     RyzeConfig:addTS(ts)
  147.     for i=1, heroManager.iCount do waittxt[i] = i*3 end
  148.     enemyMinions = minionManager(MINION_ENEMY, qRange, player, MINION_SORT_HEALTH_ASC)
  149.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then
  150.         ignite = SUMMONER_1
  151.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then
  152.         ignite = SUMMONER_2
  153.     end
  154.     for i = 1, objManager.maxObjects do
  155.         local object = objManager:getObject(i)
  156.         if object ~= nil and object.type == "obj_AI_Turret" then
  157.             local turretName = object.name
  158.             turrets[turretName] =
  159.             {
  160.                 object = object,
  161.                 team = object.team,
  162.                 range = turretRange,
  163.                 x = object.x,
  164.                 y = object.y,
  165.                 z = object.z,
  166.                 active = false,
  167.             }
  168.         end
  169.     end
  170.     autoLevelSetSequence(levelSequence)
  171.     autoLevelSetFunction(onChoiceFunction)
  172. end
  173.  
  174.  
  175. function doSpell(ts, spell, range)
  176.     if ts.target ~= nil and GetMyHero():CanUseSpell(spell) == READY and GetDistance(ts.target)<=range then
  177.         CastSpell(spell, ts.target)
  178.     end
  179. end
  180.  
  181. function findClosestEnemy()
  182. local closestEnemy = nil
  183. local currentEnemy = nil
  184. for i=1, heroManager.iCount do
  185.     currentEnemy = heroManager:GetHero(i)
  186.     if currentEnemy.team ~= myHero.team and not currentEnemy.dead and currentEnemy.visible then
  187.         if closestEnemy == nil then
  188.             closestEnemy = currentEnemy
  189.         elseif GetDistance(currentEnemy) < GetDistance(closestEnemy) then
  190.             closestEnemy = currentEnemy
  191.         end
  192.     end
  193. end
  194. return closestEnemy
  195. end
  196.  
  197. function OnDraw()
  198.     if myHero.dead then return end  
  199.     if RyzeConfig.LongActive then DrawCircle(myHero.x, myHero.y, myHero.z, RyzeSettings.wflee, 0xFFFF0000) end
  200.     if RyzeConfigConfig.drawcircles and not myHero.dead then
  201.         if QREADY then DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0x19A712)
  202.         else DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0x992D3D) end
  203.         if WREADY then DrawCircle(myHero.x, myHero.y, myHero.z, wRange, 0x19A712)
  204.         else DrawCircle(myHero.x, myHero.y, myHero.z, wRange, 0x992D3D) end
  205.         if EREADY then DrawCircle(myHero.x, myHero.y, myHero.z, eRange, 0x19A712)
  206.         else DrawCircle(myHero.x, myHero.y, myHero.z, eRange, 0x992D3D) end
  207.     end
  208.     for i=1, heroManager.iCount do
  209.         local enemydraw = heroManager:GetHero(i)
  210.         if ValidTarget(enemydraw) then
  211.             if RyzeConfigConfig.drawcircles then
  212.                 if killable[i] == 1 then
  213.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80, 0x0000FF)
  214.                 elseif killable[i] == 2 then
  215.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80, 0xFF0000)
  216.                 end
  217.                 if waittxt[i] == 1 and killable[i] ~= 0 then
  218.                     PrintFloatText(enemydraw,0,floattext[killable[i]])
  219.                 end
  220.                 if waittxt[i] == 1 then
  221.                     waittxt[i] = 30
  222.                 else waittxt[i] = waittxt[i]-1
  223.                 end
  224.             end
  225.         end
  226.     end
  227.     if RyzeConfigConfig.drawcircles and ValidTarget(ts.target) then
  228.         DrawCircle(ts.target.x, ts.target.y, ts.target.z, 100, 0xFF80FF00)
  229.     end
  230.     if MonsterTarget ~= nil and ValidTarget(MonsterTarget) then
  231.         if RyzeConfigConfig.drawcircles then DrawCircle(MonsterTarget.x, MonsterTarget.y, MonsterTarget.z, 100, 0xFF80FF00) end
  232.         if MonsterKillable == true and RyzeConfigConfig.drawcircles then
  233.             DrawCircle(MonsterTarget.x, MonsterTarget.y, MonsterTarget.z, 150, 0xFF0000)
  234.             DrawCircle(MonsterTarget.x, MonsterTarget.y, MonsterTarget.z, 160, 0xFF0000)
  235.             DrawCircle(MonsterTarget.x, MonsterTarget.y, MonsterTarget.z, 170, 0xFF0000)
  236.         end
  237.     end
  238. end
  239.  
  240.  
  241. function RyzeDmg()
  242.     local enemy = heroManager:GetHero(calculationenemy)
  243.     if ValidTarget(enemy) then
  244.         local qdamage = getDmg("Q",enemy,myHero) --Normal
  245.         local wdamage = getDmg("W",enemy,myHero)
  246.         local edamage = getDmg("E",enemy,myHero)
  247.         local hitdamage = getDmg("AD",enemy,myHero)
  248.         local dfgdamage = (DFGSlot and getDmg("DFG",enemy,myHero) or 0)
  249.         local hxgdamage = (HXGSlot and getDmg("HXG",enemy,myHero) or 0)
  250.         local bwcdamage = (BWCSlot and getDmg("BWC",enemy,myHero) or 0)
  251.         local brkdamage = (BRKREADY and getDmg("RUINEDKING",enemy,myHero,2) or 0)
  252.         local ignitedamage = (ignite and getDmg("IGNITE",enemy,myHero) or 0)
  253.         local onhitdmg = (SheenSlot and getDmg("SHEEN",enemy,myHero) or 0)+(TrinitySlot and getDmg("TRINITY",enemy,myHero) or 0)+(LBSlot and getDmg("LICHBANE",enemy,myHero) or 0)+(IcebornSlot and getDmg("ICEBORN",enemy,myHero) or 0)
  254.         local onspelldamage = (LTSlot and getDmg("LIANDRYS",enemy,myHero) or 0)+(BTSlot and getDmg("BLACKFIRE",enemy,myHero) or 0)
  255.         local combo1 = qdamage + qdamage + wdamage + edamage + onhitdmg + onspelldamage
  256.         local combo2 = 0
  257.         if myHero:CanUseSpell(_Q) == READY then
  258.             combo2 = qdamage + combo2
  259.         end
  260.         if myHero:CanUseSpell(_E) == READY then
  261.             combo2 = edamage + combo2
  262.         end
  263.         if myHero:CanUseSpell(_W) then
  264.             combo2 = wdamage + combo2
  265.         end
  266.         if myHero:CanUseSpell(_Q) and myHero:CanUseSpell(_E) and myHero:CanUseSpell(_W) == READY then
  267.             combo2 = qdamage + combo2
  268.         end
  269.         if myHero:CanUseSpell(_Q) or myHero:CanUseSpell(_E) or myHero:CanUseSpell(_W) == READY then
  270.             combo2 = combo2 + onhitdmg + onspelldamage
  271.         end
  272.         if DFGREADY then
  273.             combo1 = combo1 + dfgdamage
  274.             combo2 = combo2 + dfgdamage
  275.         end
  276.         if HXGREADY then              
  277.             combo1 = combo1 + hxgdamage*(DFGREADY and 1.2 or 1)
  278.             combo2 = combo2 + hxgdamage*(DFGREADY and 1.2 or 1)
  279.         end
  280.         if BWCREADY then
  281.             combo1 = combo1 + bwcdamage*(DFGREADY and 1.2 or 1)
  282.             combo2 = combo2 + bwcdamage*(DFGREADY and 1.2 or 1)
  283.         end
  284.         if BRKREADY then
  285.             combo1 = combo1 + brkdamage
  286.             combo2 = combo2 + brkdamage
  287.         end
  288.         if IREADY then
  289.             combo1 = combo1 + ignitedamage
  290.             combo2 = combo2 + ignitedamage
  291.         end
  292.         if combo2 >= enemy.health then killable[calculationenemy] = 2
  293.         elseif combo1 >= enemy.health then killable[calculationenemy] = 1
  294.         else killable[calculationenemy] = 0
  295.         end
  296.     end
  297.     if calculationenemy == 1 then
  298.         calculationenemy = heroManager.iCount
  299.     else
  300.         calculationenemy = calculationenemy-1
  301.     end
  302. end
  303.  
  304. function OnTick()
  305. checkTurretState()
  306. ts:update()
  307. enemyMinions:update()
  308. if tick == nil or GetTickCount()-tick >= 100 then
  309.     tick = GetTickCount()
  310.     RyzeDmg()
  311.     RyzeItem()
  312. end
  313. if math.abs(myHero.cdr*100) >= RyzeSettings.minCDRnew and RyzeSettings.ComboSwitch then
  314.     Switch = true
  315. else
  316.     Switch = false
  317. end
  318. CageTurret = findClosestTurret()
  319. if myHero:GetDistance(CageTurret.object) <= 1250 and CageTurret.team == player.team then
  320.     InTurretRange = true
  321. else
  322.     InTurretRange = false
  323. end
  324. if not myHero.dead then
  325.     if RyzeConfig.useMura then
  326.         MuramanaToggle(1000, ((player.mana / player.maxMana) > (RyzeSettings.minMuraMana / 100)))
  327.     end
  328.     if RyzeConfig.BurstActive and ValidTarget(ts.target) and Switch == false then
  329.         if DFGREADY then
  330.             CastSpell(DFGSlot, ts.target)
  331.         end
  332.         if HXGREADY then
  333.             CastSpell(HXGSlot, ts.target)
  334.         end
  335.         if BWCREADY then
  336.             CastSpell(BWCSlot, ts.target)
  337.         end
  338.         if myHero:CanUseSpell(_W) == READY and myHero:GetDistance(ts.target) > RyzeSettings.whunt then
  339.             doSpell(ts, _W, wRange)
  340.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  341.         elseif myHero:CanUseSpell(_Q) == READY and myHero:GetDistance(ts.target) <= RyzeSettings.whunt then
  342.             doSpell(ts, _Q, qRange)
  343.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  344.             if RyzeConfig.useUlti and myHero:CanUseSpell(_R) == READY then
  345.                 CastSpell(_R)
  346.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  347.             end
  348.         elseif myHero:CanUseSpell(_Q) == READY then
  349.             doSpell(ts, _Q, qRange)
  350.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  351.         elseif RyzeConfig.useUlti and myHero:CanUseSpell(_R) == READY then
  352.             CastSpell(_R)
  353.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  354.         elseif myHero:CanUseSpell(_E) == READY then
  355.             doSpell(ts, _E, wRange)
  356.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  357.         elseif myHero:CanUseSpell(_W) == READY then
  358.             doSpell(ts, _W, eRange)
  359.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  360.         end
  361.     elseif (RyzeConfig.LongActive or (Switch and RyzeConfig.BurstActive)) and ValidTarget(ts.target) then
  362.         if DFGREADY then
  363.             CastSpell(DFGSlot, ts.target)
  364.         end
  365.         if HXGREADY then
  366.             CastSpell(HXGSlot, ts.target)
  367.         end
  368.         if BWCREADY then
  369.             CastSpell(BWCSlot, ts.target)
  370.         end
  371.         if myHero:CanUseSpell(_Q) == READY and myHero:GetDistance(ts.target) <= RyzeSettings.whunt then
  372.             doSpell(ts, _Q, qRange)
  373.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  374.             qcasted = true
  375.             if RyzeConfig.useUlti and myHero:CanUseSpell(_R) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN then
  376.                 CastSpell(_R)
  377.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  378.                 qcasted = false
  379.             end
  380.         elseif myHero:CanUseSpell(_W) == READY and myHero:GetDistance(ts.target) > RyzeSettings.whunt then
  381.             doSpell(ts, _W, wRange)
  382.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  383.             qcasted = false
  384.             if myHero:CanUseSpell(_Q) == READY then
  385.                 doSpell(ts, _Q, qRange)
  386.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  387.                 qcasted = true
  388.             end
  389.         elseif myHero:CanUseSpell(_Q) == READY then
  390.             doSpell(ts, _Q, qRange)
  391.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  392.             qcasted = true
  393.         elseif RyzeConfig.useUlti and myHero:CanUseSpell(_R) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN then
  394.             CastSpell(_R)
  395.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  396.             qcasted = false
  397.         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
  398.             doSpell(ts, _W, wRange)
  399.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  400.             qcasted = false
  401.         elseif myHero:CanUseSpell(_E) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN then
  402.             doSpell(ts, _E, wRange)
  403.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  404.             qcasted = false
  405.         elseif myHero:CanUseSpell(_W) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN then
  406.             doSpell(ts, _W, wRange)
  407.             if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  408.             qcasted = false
  409.         end
  410.     elseif RyzeConfig.JungleActive then
  411.         closest = findClosestEnemy()
  412.         if ValidTarget(closest) then
  413.             if myHero:GetDistance(closest) > JungleRange then
  414.                 SaveJungle = true
  415.             end
  416.         elseif closest == nil then
  417.             SaveJungle = true
  418.         else
  419.             SaveJungle = false
  420.         end
  421.         if ValidTarget(MonsterTarget) then
  422.             if myHero:GetDistance(MonsterTarget) > eRange then
  423.                 MiniMonster = false
  424.                 CheckMonster(Vilemaw)
  425.                 CheckMonster(Nashor)
  426.                 CheckMonster(Dragon)
  427.                 CheckMonster(Golem1)
  428.                 CheckMonster(Golem2)
  429.                 CheckMonster(Lizard1)
  430.                 CheckMonster(Lizard2)
  431.             end
  432.         else
  433.             MiniMonster = false
  434.             CheckMonster(Vilemaw)
  435.             CheckMonster(Nashor)
  436.             CheckMonster(Dragon)
  437.             CheckMonster(Golem1)
  438.             CheckMonster(Golem2)
  439.             CheckMonster(Lizard1)
  440.             CheckMonster(Lizard2)
  441.         end
  442.         if SaveJungle == true and MiniMonster == false and targeting == true then
  443.             if myHero:CanUseSpell(_Q) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=qRange then
  444.                 CastSpell(_Q, MonsterTarget)
  445.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  446.                 qcasted = true
  447.             elseif RyzeConfig.useUltiJungle and myHero:CanUseSpell(_R) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=qRange then
  448.                 CastSpell(_R)
  449.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  450.                 qcasted = false
  451.             elseif myHero:CanUseSpell(_E) == READY and qcasted == true 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.                 qcasted = false
  455.             elseif myHero:CanUseSpell(_W) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=wRange then
  456.                 CastSpell(_W, MonsterTarget)
  457.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  458.                 qcasted = false
  459.             end
  460.         if ValidTarget(MonsterTarget) then
  461.             if ((MonsterDMG("Q",_Q,MonsterTarget,qRange) + MonsterDMG("W",_W,MonsterTarget,wRange)) >= MonsterTarget.health) then
  462.                 MonsterKillable = true
  463.                 if myHero:CanUseSpell(_Q) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=qRange then
  464.                     CastSpell(_Q, MonsterTarget)
  465.                 end
  466.                 if myHero:CanUseSpell(_W) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=wRange then
  467.                     CastSpell(_W, MonsterTarget)
  468.                 end
  469.                 if myHero:CanUseSpell(_E) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=eRange then
  470.                     CastSpell(_E, MonsterTarget)
  471.                 end
  472.             else
  473.                 MonsterKillable = false
  474.             end
  475.         end
  476.         end
  477.         if SaveJungle == true and (not ValidTarget(MonsterTarget) or (MiniMonster == true and targeting == true)) then
  478.             MiniMonster = true
  479.             CheckMonster(Wolf1)
  480.             CheckMonster(Wolf2)
  481.             CheckMonster(Golem1)
  482.             CheckMonster(Golem2)
  483.             CheckMonster(Wraith1)
  484.             CheckMonster(Wraith2)
  485.             if myHero:CanUseSpell(_R) == READY and RyzeConfig.useUltiJungle and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=eRange then
  486.                 CastSpell(_R)
  487.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  488.             elseif myHero:CanUseSpell(_E) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=eRange then
  489.                 CastSpell(_E, MonsterTarget)
  490.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  491.             elseif myHero:CanUseSpell(_Q) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=qRange then
  492.                 CastSpell(_Q, MonsterTarget)
  493.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  494.             elseif myHero:CanUseSpell(_W) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=wRange then
  495.                 CastSpell(_W, MonsterTarget)
  496.                 if RyzeSettings.autoMouseFollow then player:MoveTo(mousePos.x, mousePos.z) end
  497.             end
  498.         end
  499.     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
  500.         for index, minion in pairs(enemyMinions.objects) do
  501.             local myQ = getDmg("Q",minion,myHero)
  502.             local myW = getDmg("W",minion,myHero)
  503.             if (minion.maxHealth >= 700+27*math.floor(GetGameTimer()/180000)) then
  504.                 local ProMinion = minion
  505.                 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
  506.                     CastSpell(_Q, ProMinion)
  507.                 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
  508.                     CastSpell(_W, ProMinion)
  509.                 end
  510.             end
  511.             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
  512.                 CastSpell(_Q, minion)
  513.             end
  514.         end
  515.     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
  516.         for index, minion in pairs(enemyMinions.objects) do
  517.             local myQ = getDmg("Q",minion,myHero)
  518.             local myW = getDmg("W",minion,myHero)
  519.             local myE = getDmg("E",minion,myHero)
  520.             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
  521.                 CastSpell(_Q, minion)
  522.                 qtarget = minion
  523.             end
  524.             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
  525.                 CastSpell(_W, minion)
  526.                 wtarget = minion
  527.             end
  528.             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
  529.                 CastSpell(_E, minion)
  530.                 etarget = minion
  531.             end
  532.         end
  533.     end
  534.     if RyzeConfig.autoAAFarm and GetTickCount() > nextTick then
  535.         if RyzeSettings.autoAAFollow then
  536.             player:MoveTo(mousePos.x, mousePos.z)
  537.         end
  538.         for index, minion in pairs(enemyMinions.objects) do
  539.             local myAA = getDmg("AD",minion,myHero)
  540.             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
  541.                 player:Attack(minion)
  542.             end
  543.          nextTick = GetTickCount() + waitDelay
  544.         end
  545.     end
  546.     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
  547.         if myHero:CanUseSpell(_Q) == READY then
  548.             doSpell(ts, _Q, qRange)
  549.         end
  550.     end
  551.     if RyzeConfig.CageHunter and myHero:CanUseSpell(_W) == READY then
  552.         closest = findClosestEnemy()
  553.         if ValidTarget(closest) then
  554.             if myHero:GetDistance(closest) < wRange and ValidTarget(closest) then
  555.                 CastSpell(_W, closest)
  556.             end
  557.         end
  558.     end
  559.     if RyzeConfig.Ignite then      
  560.         if IREADY then
  561.             local ignitedmg = 0    
  562.             for j = 1, heroManager.iCount, 1 do
  563.                 local enemyhero = heroManager:getHero(j)
  564.                 if ValidTarget(enemyhero,600) then
  565.                     ignitedmg = 50 + 20 * myHero.level
  566.                     if enemyhero.health <= ignitedmg then
  567.                         CastSpell(ignite, enemyhero)
  568.                     end
  569.                 end
  570.             end
  571.         end
  572.     end
  573.     if RyzeSettings.autoComboFollow and (RyzeConfig.BurstActive == true or RyzeConfig.LongActive == true) then
  574.         player:MoveTo(mousePos.x, mousePos.z)
  575.     end
  576. end
  577. end
  578.  
  579. function OnProcessSpell(unit, spell)
  580. --[[    if (spell.name:find("ChaosTurret") and myHero.team == TEAM_RED) or (spell.name:find("OrderTurret") and myHero.team == TEAM_BLUE) and RyzeConfig.cageW then
  581.         for i=1, heroManager.iCount do
  582.             local enemy = heroManager:GetHero(i)
  583.             if ValidTarget(enemy) then
  584.                 if GetDistance(spell.endPos, enemy)<80 and GetDistance(enemy)<=wRange and myHero:CanUseSpell(_W) == READY then
  585.                     CastSpell(_W, enemy)
  586.                 end
  587.             end
  588.         end            
  589.     end
  590. -- ]]
  591. if InTurretRange == true then
  592.     if unit.team == TEAM_ENEMY and GetDistance(unit) < wRange and GetDistance(spell.endPos, myHero)<10 then
  593.         for i=1, heroManager.iCount do
  594.             local enemy = heroManager:GetHero(i)
  595.             if ValidTarget(enemy) then
  596.                 if enemy.name == unit.name then
  597.                     if GetDistance(enemy)<=wRange and myHero:CanUseSpell(_W) == READY then
  598.                         if enemy:GetDistance(CageTurret.object) < 800 then
  599.                             CastSpell(_W, enemy)
  600.                         end
  601.                     end
  602.                 end
  603.             end
  604.         end
  605.     end
  606. end
  607. end
  608.  
  609. function findClosestTurret()
  610. local closestTurret = nil
  611. local currentTurret = nil
  612. for name, turret in pairs(turrets) do
  613.     if turret.object.valid ~= false then
  614.         currentTurret = turret
  615.     end
  616.     if turret.team == myHero.team then
  617.         if closestTurret == nil then
  618.             closestTurret = currentTurret
  619.         elseif GetDistance(currentTurret) < GetDistance(closestTurret) then
  620.             closestTurret = currentTurret
  621.         end
  622.     end
  623. end
  624. return closestTurret
  625. end
  626.  
  627.  
  628. function OnCreateObj(obj)
  629.     if obj ~= nil and obj.type == "obj_AI_Minion" and obj.name ~= nil then
  630.         if obj.name == "TT_Spiderboss7.1.1" then Vilemaw = obj
  631.         elseif obj.name == "Worm12.1.1" then Nashor = obj
  632.         elseif obj.name == "Dragon6.1.1" then Dragon = obj
  633.         elseif obj.name == "AncientGolem1.1.1" then Golem1 = obj
  634.         elseif obj.name == "AncientGolem7.1.1" then Golem2 = obj
  635.         elseif obj.name == "LizardElder4.1.1" then Lizard1 = obj
  636.         elseif obj.name == "LizardElder10.1.1" then Lizard2 = obj
  637.         elseif obj.name == "GiantWolf2.1.3" then Wolf1 = obj
  638.         elseif obj.name == "GiantWolf8.1.3" then Wolf2 = obj
  639.         elseif obj.name == "Wraith3.1.3" then Wraith1 = obj
  640.         elseif obj.name == "Wraith9.1.3" then Wraith2 = obj
  641.         elseif obj.name == "Golem5.1.2" then Golem1 = obj
  642.         elseif obj.name == "Golem11.1.2" then Golem2 = obj
  643.         end
  644.     end
  645. end
  646.  
  647. function OnDeleteObj(object)
  648.     if object ~= nil and object.type == "obj_AI_Turret" then
  649.         for name, turret in pairs(turrets) do
  650.             if name == object.name then
  651.                 turrets[name] = nil
  652.                 return
  653.             end
  654.         end
  655.     end
  656. end
  657.  
  658. function ASLoadMinions()
  659.     for i = 1, objManager.maxObjects do
  660.         local obj = objManager:getObject(i)
  661.         if obj ~= nil and obj.type == "obj_AI_Minion" and obj.name ~= nil then
  662.             if obj.name == "TT_Spiderboss7.1.1" then Vilemaw = obj
  663.             elseif obj.name == "Worm12.1.1" then Nashor = obj
  664.             elseif obj.name == "Dragon6.1.1" then Dragon = obj
  665.             elseif obj.name == "AncientGolem1.1.1" then Golem1 = obj
  666.             elseif obj.name == "AncientGolem7.1.1" then Golem2 = obj
  667.             elseif obj.name == "LizardElder4.1.1" then Lizard1 = obj
  668.             elseif obj.name == "LizardElder10.1.1" then Lizard2 = obj
  669.             elseif obj.name == "GiantWolf2.1.3" then Wolf1 = obj
  670.             elseif obj.name == "GiantWolf8.1.3" then Wolf2 = obj
  671.             elseif obj.name == "Wraith3.1.3" then Wraith1 = obj
  672.             elseif obj.name == "Wraith9.1.3" then Wraith2 = obj
  673.             elseif obj.name == "Golem5.1.2" then Golem1 = obj
  674.             elseif obj.name == "Golem11.1.2" then Golem2 = obj
  675.             end
  676.         end
  677.     end
  678. end
  679.  
  680.  
  681. function CheckMonster(minion)
  682. if minion ~= nil and ValidTarget(minion) then
  683.     if myHero:GetDistance(minion) < eRange then
  684.         MonsterTarget = minion
  685.         targeting = true
  686.     elseif not ValidTarget(MonsterTarget) then
  687.         targeting = false
  688.     end
  689. end
  690. end
  691.  
  692. function MonsterDMG(dmgspell,spell,monster,range)
  693.     if monster ~= nil and GetMyHero():CanUseSpell(spell) == READY and GetDistance(monster)<=range then
  694.         return getDmg(dmgspell,monster,myHero)
  695.     else
  696.         return 0
  697.     end
  698. end
  699.  
  700. function RyzeItem()
  701. DFGSlot, HXGSlot, BWCSlot = GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144)
  702. SheenSlot, TrinitySlot, LBSlot = GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100)
  703. IGSlot, LTSlot, BTSlot = GetInventorySlotItem(3025), GetInventorySlotItem(3151), GetInventorySlotItem(3188)
  704. STISlot, ROSlot, BRKSlot = GetInventorySlotItem(3092),GetInventorySlotItem(3143),GetInventorySlotItem(3153)
  705. QREADY = (myHero:CanUseSpell(_Q) == READY)
  706. WREADY = (myHero:CanUseSpell(_W) == READY)
  707. EREADY = (myHero:CanUseSpell(_E) == READY)
  708. RREADY = (myHero:CanUseSpell(_R) == READY)
  709. DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  710. HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  711. BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  712. STIREADY = (STISlot ~= nil and myHero:CanUseSpell(STISlot) == READY)
  713. ROREADY = (ROSlot ~= nil and myHero:CanUseSpell(ROSlot) == READY)
  714. BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
  715. IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  716. end
  717.  
  718. function checkTurretState()
  719.     for name, turret in pairs(turrets) do
  720.         if turret.object.valid == false then
  721.             turrets[name] = nil
  722.         end
  723.     end
  724. end
  725.  
  726. function onChoiceFunction()
  727.     if player:GetSpellData(SPELL_1).level < player:GetSpellData(SPELL_2).level then
  728.         return 1
  729.     else
  730.         return 2
  731.     end
  732. end
  733.  
  734.  quotes = { 'Let\'s go, let\'s go!',
  735.  'Unpleasant? I\'ll show you unpleasant!',
  736.  'Take this scroll and stick it... somewhere safe.',
  737.  'I got these tattoos in rune prison!',
  738.  'Right back at you!'}
  739. PrintFloatText(myHero, 10, quotes[math.random(5)])
Advertisement
Add Comment
Please, Sign In to add comment