Guest User

WOW Awesome 4.0

a guest
Apr 4th, 2013
3,708
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 42.34 KB | None | 0 0
  1. -- #################################################################################################
  2. -- ##                                                                                             ##
  3. -- ##                     Glory Ryze Script                                                       ##
  4. -- ##                                Version 4.0 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. -- ## 4.0 - AA Function by Auto Carry - Extreme Orb-walking by Sida                               ##
  49. -- ##       with Updates by Manciuszz with help of eXtragoZ                                       ##
  50. -- ##       PROBLEM ATM: Needs Reload at Start (F9)                                               ##
  51. -- #################################################################################################
  52.  
  53. -- #################################################################################################
  54. -- ##                                     THX & Credits                                           ##
  55. -- #################################################################################################
  56. -- ## Spudgy - Awesome Tool :)                                                                    ##
  57. -- ## SurfaceS & gReY & Husky - Awesome AllClass and other Syntax Things ;)                       ##
  58. -- ## Sida & Manciuszz & eXtragoZ & Burn- Auto Carry and other Scripts                            ##
  59. -- ## bnsfg & TRUS - The Basic Spribt developed by them :)                                        ##
  60. -- ## Whole Dev Team and Script Developer - Inspring me and their Scripts helping me to           ##
  61. -- ##                                       understand BOL and lua better ;)                      ##
  62. -- ## The nice Community of BOL - Helping me when i have Problems ;)                              ##
  63. -- ## Every User of this Script - Give Feedback and given Feedback improved this Script a lot ;)  ##
  64. -- ## Everybody Forgotten - I'm sorry if i forgot SB. Drop me a PM and next update you'll be here ##
  65. -- #################################################################################################
  66.  
  67. -- #################################################################################################
  68. -- ## TODO:                                                                                       ##
  69. -- #################################################################################################
  70.  
  71. -- #################################################################################################
  72. -- ## Please Send me your Feedback so I can improve this Script further :)                        ##
  73. -- #################################################################################################
  74.  
  75.  
  76. if GetMyHero().charName ~= "Ryze" then return end
  77.  
  78. qRange = 650
  79. wRange = 625
  80. eRange = 675 -- Real range is 675
  81. rRange = 200 -- Range of your ulti AOE
  82. AARange = 550
  83. JungleRange = 1000
  84. turretRange = 950
  85. local waittxt = {}
  86. local calculationenemy = 1
  87. local tick = nil
  88. killable = {}
  89. turrets = {}
  90. qcasted = true
  91. waitDelay = 400
  92. nextTick = 0
  93. CageTurret = nil
  94. Switch = false
  95. targeting = false
  96. local ignite = nil
  97. local DFGSlot, HXGSlot, BWCSlot = nil, nil, nil
  98. local DFGREADY, HXGREADY, BWCREADY, IREADY = false, false, false, false
  99. local floattext = {"Cooldown!","Murder him!"}
  100. local levelSequence = {nil,0,3,1,1,4,1,2,1,2,4,2,2,3,3,4,3,3}
  101. local myHero = GetMyHero()
  102. local adjustRange = true
  103. local attackDelayOffset = 600
  104. local startAttackSpeed
  105. local projSpeed
  106. local lastAttack = GetTickCount()
  107. local shotFired = false
  108. local range = 999
  109. local greenRange = 999
  110. local isMoving = false
  111.  
  112.  
  113.  
  114.  
  115.  
  116. function OnLoad()
  117.     lastcast = _R
  118.     RyzeConfig = scriptConfig("Ryze Combo", "Ryze_Config")
  119.     RyzeConfigConfig = scriptConfig("Ryze Combo Visual Config", "Ryze_Config_Config")
  120.     RyzeSettings = scriptConfig("Ryze Combo Settings", "Ryze_Settings")
  121.     RyzeConfig:addParam("BurstActive", "Burst Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  122.     RyzeConfig:addParam("LongActive", "Long Combo", SCRIPT_PARAM_ONKEYDOWN, false, 88)
  123.     RyzeConfig:addParam("Ignite", "Ignite if Killable", SCRIPT_PARAM_ONKEYTOGGLE, true, 79)
  124.     RyzeConfig:addParam("JungleActive", "Jungle Creeps Combo", SCRIPT_PARAM_ONKEYDOWN, false, 66)
  125.     RyzeConfig:addParam("useUlti", "Use ultimate in combos", SCRIPT_PARAM_ONOFF, true)
  126.     RyzeConfig:addParam("useUltiJungle", "Use ultimate in Jungle combos", SCRIPT_PARAM_ONKEYDOWN, true, 76)
  127.     RyzeConfig:addParam("useMura", "Auto use Muramana if Champs around", SCRIPT_PARAM_ONOFF, true)
  128.     RyzeSettings:addParam("minMuraMana", "Min Mana Muramana", SCRIPT_PARAM_SLICE, 25, 0, 100, 2)
  129.     RyzeConfig:addParam("cageW", "Cage Enemy unter Tower Harass", SCRIPT_PARAM_ONKEYTOGGLE, true, 85)
  130.     RyzeConfig:addParam("autoQFarm", "Auto Q Farm", SCRIPT_PARAM_ONKEYTOGGLE, false, 84)
  131.     RyzeConfig:addParam("PowerFarm", "Power Farm", SCRIPT_PARAM_ONKEYTOGGLE, false, 73)
  132.     RyzeConfig:addParam("autoAAFarm", "Auto AA Farm", SCRIPT_PARAM_ONKEYDOWN, false, 220)
  133.     RyzeSettings:addParam("autoAAFollow", "Auto AA Follow Cursor Toggle", SCRIPT_PARAM_ONOFF, true)
  134.     RyzeSettings:addParam("autoMouseFollow", "Go to Cursor at Spell Cast", SCRIPT_PARAM_ONOFF, false)
  135.     RyzeSettings:addParam("autoComboFollow", "Auto Follow Cursor if Combo Key pressed", SCRIPT_PARAM_ONOFF, true)
  136.     RyzeConfig:addParam("autoQToggle", "Auto Q Harass (Toggle)", SCRIPT_PARAM_ONKEYTOGGLE, false, 90)
  137.     RyzeConfig:addParam("autoQHarass", "Auto Q Harass (Hotkey)", SCRIPT_PARAM_ONKEYDOWN, false, 65)
  138.     RyzeSettings:addParam("qMinMana", "Auto Q Farm min mana %",  SCRIPT_PARAM_SLICE, 50, 0, 100, 2)
  139.     RyzeSettings:addParam("qMinManaHarass", "Auto Q Harass min mana %", SCRIPT_PARAM_SLICE, 50, 0, 100, 2)
  140.     RyzeSettings:addParam("PowerMinMana", "Power Farm min mana %", SCRIPT_PARAM_SLICE, 50, 0, 100, 2)
  141.     RyzeConfig:addParam("CageHunter", "Cage nearest Enemy Champion", SCRIPT_PARAM_ONKEYDOWN, false, 67)
  142.     RyzeSettings:addParam("whunt", "First cage with W range", SCRIPT_PARAM_SLICE, 550, 0, 625, 0)
  143.     RyzeSettings:addParam("wflee", "First cage in Long Combo if fleeing", SCRIPT_PARAM_SLICE, 550, 0, 625, 0)
  144.     RyzeSettings:addParam("winsta", "Cage without waiting on Q if fleeing", SCRIPT_PARAM_ONKEYTOGGLE, true, 77)
  145.     RyzeSettings:addParam("ComboSwitch", "Switch Combo",    SCRIPT_PARAM_ONKEYTOGGLE, true, 78)
  146.     RyzeSettings:addParam("minCDRnew", "CDR % to switch Combo", SCRIPT_PARAM_SLICE, 35, 0, 40, 0)
  147.     RyzeConfigConfig:addParam("BurstActiveshow", "Show: Burst Combo", SCRIPT_PARAM_ONOFF, true)
  148.     RyzeConfigConfig:addParam("LongActiveshow", "Show: Long Combo", SCRIPT_PARAM_ONOFF, true)
  149.     RyzeConfigConfig:addParam("useUltishow", "Show: Use ultimate in combos", SCRIPT_PARAM_ONOFF, true)
  150.     RyzeConfigConfig:addParam("cageWshow", "Show: Cage Enemy unter Tower Harass", SCRIPT_PARAM_ONOFF, true)
  151.     RyzeConfigConfig:addParam("CageHuntershow", "Show: Cage nearest Enemy Champion", SCRIPT_PARAM_ONOFF, true)
  152.     RyzeConfigConfig:addParam("winstashow", "Show: Cage without waiting on Q if fleeing", SCRIPT_PARAM_ONOFF, true)
  153.     RyzeConfigConfig:addParam("autoQFarmshow", "Show: Auto Q Farm", SCRIPT_PARAM_ONOFF, true)
  154.     RyzeConfigConfig:addParam("PowerFarmshow", "Show: Power Farm", SCRIPT_PARAM_ONOFF, true)
  155.     RyzeConfigConfig:addParam("autoAAFarmshow", "Show: autoAAFarm", SCRIPT_PARAM_ONOFF, true)
  156.     RyzeConfigConfig:addParam("autoQToggleshow", "Show: Auto Q Harass (Toggle)", SCRIPT_PARAM_ONOFF, true)
  157.     RyzeConfigConfig:addParam("autoQHarassshow", "Show: Auto Q Harass (Hotkey)", SCRIPT_PARAM_ONOFF, true)
  158.     RyzeConfigConfig:addParam("ComboSwitchshow", "Show: Switch Combo", SCRIPT_PARAM_ONOFF, true)
  159.     RyzeConfigConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  160.     if RyzeConfigConfig.BurstActiveshow then RyzeConfig:permaShow("BurstActive") end
  161.     if RyzeConfigConfig.LongActiveshow then RyzeConfig:permaShow("LongActive") end
  162.     if RyzeConfigConfig.useUltishow then RyzeConfig:permaShow("useUlti") end
  163.     if RyzeConfigConfig.cageWshow then RyzeConfig:permaShow("cageW") end
  164.     if RyzeConfigConfig.CageHuntershow then RyzeConfig:permaShow("CageHunter") end
  165.     if RyzeConfigConfig.winstashow then RyzeSettings:permaShow("winsta") end
  166.     if RyzeConfigConfig.autoQFarmshow then RyzeConfig:permaShow("autoQFarm") end
  167.     if RyzeConfigConfig.PowerFarmshow then RyzeConfig:permaShow("PowerFarm") end
  168.     if RyzeConfigConfig.autoAAFarmshow then RyzeConfig:permaShow("autoAAFarm") end
  169.     if RyzeConfigConfig.autoQToggleshow then RyzeConfig:permaShow("autoQToggle") end
  170.     if RyzeConfigConfig.autoQHarassshow then RyzeConfig:permaShow("autoQHarass") end
  171.     if RyzeConfigConfig.ComboSwitchshow then RyzeSettings:permaShow("ComboSwitch") end
  172.     PrintChat ("Glory Ryze 4.0 final by Wursti loaded! Credits in Script :)!")
  173.     PrintChat ("Report Bugs and give Feedback Please :) THX!!")
  174.     ts = TargetSelector(TARGET_LOW_HP,qRange,DAMAGE_MAGIC,false)
  175.     ts.name = "Ryze"
  176.     ASLoadMinions()
  177.     RyzeConfig:addTS(ts)
  178.     for i=1, heroManager.iCount do waittxt[i] = i*3 end
  179.     enemyMinions = minionManager(MINION_ENEMY, qRange, player, MINION_SORT_HEALTH_ASC)
  180.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then
  181.         ignite = SUMMONER_1
  182.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then
  183.         ignite = SUMMONER_2
  184.     end
  185.     for i = 1, objManager.maxObjects do
  186.         local object = objManager:getObject(i)
  187.         if object ~= nil and object.type == "obj_AI_Turret" then
  188.             local turretName = object.name
  189.             turrets[turretName] =
  190.             {
  191.                 object = object,
  192.                 team = object.team,
  193.                 range = turretRange,
  194.                 x = object.x,
  195.                 y = object.y,
  196.                 z = object.z,
  197.                 active = false,
  198.             }
  199.         end
  200.     end
  201.     autoLevelSetSequence(levelSequence)
  202.     autoLevelSetFunction(onChoiceFunction)
  203.    
  204.     range = getMyTrueRange()
  205.     greenRange = getMyTrueRange()
  206.    
  207.     if getChampTable()[myHero.charName] ~= nil then
  208.         if getChampTable()[myHero.charName].projSpeed ~= nil then
  209.             projSpeed = getChampTable()[myHero.charName].projSpeed
  210.         end
  211.     end
  212.     if getChampTable()[myHero.charName] ~= nil then
  213.         if getChampTable()[myHero.charName].startAttackSpeed ~= nil then
  214.             startAttackSpeed = getChampTable()[myHero.charName].startAttackSpeed
  215.         end
  216.     end
  217. end
  218.  
  219. function attackEnemy(enemy) -- Commands our hero to attack the target
  220.     if enemy.dead or not enemy.valid then return end
  221.     myHero:Attack(enemy)
  222.     shotFired = true
  223. end
  224.  
  225. function getLastAttackTime() -- Returns when we last attacked
  226.     return lastAttack
  227. end
  228.  
  229. function getAttackSpeed() -- Returns our hero's attack speed
  230.     return myHero.attackSpeed/(1/startAttackSpeed)
  231. end
  232.  
  233. function getHitBoxRadius(target)
  234.     return GetDistance(target.minBBox, target.maxBBox)/2
  235. end
  236.  
  237. function getNextAttackTime() -- Returns when we should next attack in miliseconds
  238.     return getLastAttackTime() + (attackDelayOffset / getAttackSpeed()) -- ~0.5 - 0.6s aaDelay offset or "swing delay" whatever you call it. TODO Even if it works fine, needs changing.
  239. end
  240.  
  241. function timeToShoot() -- Returns if it's time for us to attack
  242.     if GetTickCount() > getNextAttackTime() then
  243.         return true
  244.     end
  245.     return false
  246. end
  247.  
  248. function getMyTrueRange()
  249.     return getRange() + GetDistance(myHero.minBBox)
  250. end
  251.  
  252. function getDistanceOffset(enemy) -- We use this for KCConfig.adjustRange feature..
  253.     local distance = GetDistance(enemy) - getHitBoxRadius(enemy) + 60
  254.     if distance > getMyTrueRange() then return 0 end
  255.     return distance / 9.85
  256. end
  257.  
  258. function getRange() -- Return our hero's range
  259.     return myHero.range
  260. end
  261.  
  262. function isEnemyInAttackRange(enemy) -- Check if we can attack enemy
  263.     if enemy ~= nil then
  264.         local enemyTrueDistance = GetDistance(enemy) --[[- getHitBoxRadius(enemy)]]
  265.         if enemyTrueDistance < range then
  266.             return true
  267.         end
  268.     end
  269.     return false
  270. end
  271.  
  272.  
  273. function doSpell(ts, spell, range)
  274.     if ts.target ~= nil and GetMyHero():CanUseSpell(spell) == READY and GetDistance(ts.target)<=range then
  275.         CastSpell(spell, ts.target)
  276.     end
  277. end
  278.  
  279. function findClosestEnemy() -- Find the closest enemy
  280.     local closestEnemy
  281.     local enemyTable = GetEnemyHeros() --function from latest AllClass library. Stores all enemy champions into a table.
  282.     for i, currentEnemy in ipairs(enemyTable) do -- we loop the table, getting info from it
  283.         if currentEnemy.valid and not currentEnemy.dead and currentEnemy.visible then -- check if it's valid
  284.             if closestEnemy == nil then -- if closestEnemy wasn't aquired
  285.                 closestEnemy = currentEnemy -- assign the currentEnemy as a closest one
  286.             elseif GetDistance(currentEnemy) < GetDistance(closestEnemy) then -- else compare distances, determine the closest one
  287.                 closestEnemy = currentEnemy -- assign the currentEnemy as a closest one
  288.             end
  289.         end
  290.     end
  291.     return closestEnemy --make function return this object.
  292. end
  293.  
  294.  
  295. function updateRange()
  296.     if adjustRange then --Just an eye candy feature.
  297.         local closestEnemy = findClosestEnemy()
  298.         if closestEnemy ~= nil then
  299.             if isEnemyInAttackRange(closestEnemy) then
  300.                 if getDistanceOffset(closestEnemy) > 0 then
  301.                     greenRange = (GetDistance(closestEnemy) + getDistanceOffset(closestEnemy)) - getHitBoxRadius(closestEnemy)
  302.                 else
  303.                     greenRange = getMyTrueRange()
  304.                 end
  305.             else
  306.                 greenRange = getMyTrueRange()
  307.             end
  308.         else
  309.             greenRange = getMyTrueRange()
  310.         end
  311.     else
  312.         range = getMyTrueRange()
  313.         greenRange = getMyTrueRange()
  314.     end
  315.  
  316.     ts:update()
  317.  
  318. end
  319.  
  320. function heroCanMove() -- Check if we are ready to step forward.
  321.     if shotFired == false or timeToShoot() then
  322.         return true
  323.     end
  324.     return false
  325. end
  326.  
  327. function moveToCursor() -- Removes derping when mouse is in one position instead of myHero:MoveTo mousePos
  328.     isMoving = true
  329.     local moveSqr = math.sqrt((mousePos.x - myHero.x)^2+(mousePos.z - myHero.z)^2)
  330.     local moveX = myHero.x + 200*((mousePos.x - myHero.x)/moveSqr)
  331.     local moveZ = myHero.z + 200*((mousePos.z - myHero.z)/moveSqr)
  332.     myHero:MoveTo(moveX, moveZ)
  333. end
  334.  
  335. function attackedSuccessfully() -- Our attack particle was fired
  336.     shotFired = false -- if we attacked successfully that means we get a swing delay which we have to wait out in order to attack again.
  337.     lastAttack = GetTickCount()
  338. end
  339.  
  340. function doNextAction(enemy)
  341.     if enemy ~= nil then
  342.         if timeToShoot() then
  343.             attackEnemy(enemy)
  344.         else
  345.             if heroCanMove() then moveToCursor() end
  346.         end
  347.     end
  348. end
  349.  
  350.  
  351.  
  352.  
  353. function OnDraw()
  354.     if myHero.dead then return end  
  355.     if RyzeConfig.LongActive then DrawCircle(myHero.x, myHero.y, myHero.z, RyzeSettings.wflee, 0xFFFF0000) end
  356.     if RyzeConfigConfig.drawcircles and not myHero.dead then
  357.         if QREADY then DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0x19A712)
  358.         else DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0x992D3D) end
  359.         if WREADY then DrawCircle(myHero.x, myHero.y, myHero.z, wRange, 0x19A712)
  360.         else DrawCircle(myHero.x, myHero.y, myHero.z, wRange, 0x992D3D) end
  361.         if EREADY then DrawCircle(myHero.x, myHero.y, myHero.z, eRange, 0x19A712)
  362.         else DrawCircle(myHero.x, myHero.y, myHero.z, eRange, 0x992D3D) end
  363.     end
  364.     for i=1, heroManager.iCount do
  365.         local enemydraw = heroManager:GetHero(i)
  366.         if ValidTarget(enemydraw) then
  367.             if RyzeConfigConfig.drawcircles then
  368.                 if killable[i] == 1 then
  369.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80, 0x0000FF)
  370.                 elseif killable[i] == 2 then
  371.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80, 0xFF0000)
  372.                 end
  373.                 if waittxt[i] == 1 and killable[i] ~= 0 then
  374.                     PrintFloatText(enemydraw,0,floattext[killable[i]])
  375.                 end
  376.                 if waittxt[i] == 1 then
  377.                     waittxt[i] = 30
  378.                 else waittxt[i] = waittxt[i]-1
  379.                 end
  380.             end
  381.         end
  382.     end
  383.     if RyzeConfigConfig.drawcircles and ValidTarget(ts.target) then
  384.         DrawCircle(ts.target.x, ts.target.y, ts.target.z, 100, 0xFF80FF00)
  385.     end
  386.     if MonsterTarget ~= nil and ValidTarget(MonsterTarget) then
  387.         if RyzeConfigConfig.drawcircles then DrawCircle(MonsterTarget.x, MonsterTarget.y, MonsterTarget.z, 100, 0xFF80FF00) end
  388.         if MonsterKillable == true and RyzeConfigConfig.drawcircles then
  389.             DrawCircle(MonsterTarget.x, MonsterTarget.y, MonsterTarget.z, 150, 0xFF0000)
  390.             DrawCircle(MonsterTarget.x, MonsterTarget.y, MonsterTarget.z, 160, 0xFF0000)
  391.             DrawCircle(MonsterTarget.x, MonsterTarget.y, MonsterTarget.z, 170, 0xFF0000)
  392.         end
  393.     end
  394. end
  395.  
  396.  
  397. function RyzeDmg()
  398.     local enemy = heroManager:GetHero(calculationenemy)
  399.     if ValidTarget(enemy) then
  400.         local qdamage = getDmg("Q",enemy,myHero) --Normal
  401.         local wdamage = getDmg("W",enemy,myHero)
  402.         local edamage = getDmg("E",enemy,myHero)
  403.         local hitdamage = getDmg("AD",enemy,myHero)
  404.         local dfgdamage = (DFGSlot and getDmg("DFG",enemy,myHero) or 0)
  405.         local hxgdamage = (HXGSlot and getDmg("HXG",enemy,myHero) or 0)
  406.         local bwcdamage = (BWCSlot and getDmg("BWC",enemy,myHero) or 0)
  407.         local brkdamage = (BRKREADY and getDmg("RUINEDKING",enemy,myHero,2) or 0)
  408.         local ignitedamage = (ignite and getDmg("IGNITE",enemy,myHero) or 0)
  409.         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)
  410.         local onspelldamage = (LTSlot and getDmg("LIANDRYS",enemy,myHero) or 0)+(BTSlot and getDmg("BLACKFIRE",enemy,myHero) or 0)
  411.         local combo1 = qdamage + qdamage + wdamage + edamage + onhitdmg + onspelldamage
  412.         local combo2 = 0
  413.         if myHero:CanUseSpell(_Q) == READY then
  414.             combo2 = qdamage + combo2
  415.         end
  416.         if myHero:CanUseSpell(_E) == READY then
  417.             combo2 = edamage + combo2
  418.         end
  419.         if myHero:CanUseSpell(_W) then
  420.             combo2 = wdamage + combo2
  421.         end
  422.         if myHero:CanUseSpell(_Q) and myHero:CanUseSpell(_E) and myHero:CanUseSpell(_W) == READY then
  423.             combo2 = qdamage + combo2
  424.         end
  425.         if myHero:CanUseSpell(_Q) or myHero:CanUseSpell(_E) or myHero:CanUseSpell(_W) == READY then
  426.             combo2 = combo2 + onhitdmg + onspelldamage
  427.         end
  428.         if DFGREADY then
  429.             combo1 = combo1 + dfgdamage
  430.             combo2 = combo2 + dfgdamage
  431.         end
  432.         if HXGREADY then              
  433.             combo1 = combo1 + hxgdamage*(DFGREADY and 1.2 or 1)
  434.             combo2 = combo2 + hxgdamage*(DFGREADY and 1.2 or 1)
  435.         end
  436.         if BWCREADY then
  437.             combo1 = combo1 + bwcdamage*(DFGREADY and 1.2 or 1)
  438.             combo2 = combo2 + bwcdamage*(DFGREADY and 1.2 or 1)
  439.         end
  440.         if BRKREADY then
  441.             combo1 = combo1 + brkdamage
  442.             combo2 = combo2 + brkdamage
  443.         end
  444.         if IREADY then
  445.             combo1 = combo1 + ignitedamage
  446.             combo2 = combo2 + ignitedamage
  447.         end
  448.         if combo2 >= enemy.health then killable[calculationenemy] = 2
  449.         elseif combo1 >= enemy.health then killable[calculationenemy] = 1
  450.         else killable[calculationenemy] = 0
  451.         end
  452.     end
  453.     if calculationenemy == 1 then
  454.         calculationenemy = heroManager.iCount
  455.     else
  456.         calculationenemy = calculationenemy-1
  457.     end
  458. end
  459.  
  460. function OnTick()
  461.     if myHero.dead then return end
  462.     updateRange()
  463.     checkTurretState()
  464.     ts:update()
  465.     enemyMinions:update()
  466.     if tick == nil or GetTickCount()-tick >= 100 then
  467.         tick = GetTickCount()
  468.         RyzeDmg()
  469.         RyzeItem()
  470.     end
  471.     if math.abs(myHero.cdr*100) >= RyzeSettings.minCDRnew and RyzeSettings.ComboSwitch then
  472.         Switch = true
  473.     else
  474.         Switch = false
  475.     end
  476.     CageTurret = findClosestTurret()
  477.     if myHero:GetDistance(CageTurret.object) <= 1250 and CageTurret.team == player.team then
  478.         InTurretRange = true
  479.     else
  480.         InTurretRange = false
  481.     end
  482.     if RyzeConfig.useMura then
  483.         MuramanaToggle(1000, ((player.mana / player.maxMana) > (RyzeSettings.minMuraMana / 100)))
  484.     end
  485.     if isEnemyInAttackRange(ts.target) and timeToShoot() and ValidTarget(ts.target) and (RyzeConfig.BurstActive == true or RyzeConfig.LongActive == true) then
  486.         doNextAction(ts.target)
  487.     elseif RyzeSettings.autoComboFollow and (RyzeConfig.BurstActive == true or RyzeConfig.LongActive == true) and heroCanMove() then
  488.         moveToCursor()
  489.     end
  490.     if RyzeConfig.BurstActive and ValidTarget(ts.target) and Switch == false then
  491.         if DFGREADY then
  492.             CastSpell(DFGSlot, ts.target)
  493.         end
  494.         if HXGREADY then
  495.             CastSpell(HXGSlot, ts.target)
  496.         end
  497.         if BWCREADY then
  498.             CastSpell(BWCSlot, ts.target)
  499.         end
  500.         if myHero:CanUseSpell(_W) == READY and myHero:GetDistance(ts.target) > RyzeSettings.whunt then
  501.             doSpell(ts, _W, wRange)
  502.             if RyzeSettings.autoMouseFollow then moveToCursor() end
  503.         elseif myHero:CanUseSpell(_Q) == READY and myHero:GetDistance(ts.target) <= RyzeSettings.whunt then
  504.             doSpell(ts, _Q, qRange)
  505.             if RyzeSettings.autoMouseFollow then moveToCursor() end
  506.             if RyzeConfig.useUlti and myHero:CanUseSpell(_R) == READY then
  507.                 CastSpell(_R)
  508.                 if RyzeSettings.autoMouseFollow then moveToCursor() end
  509.             end
  510.         elseif myHero:CanUseSpell(_Q) == READY then
  511.             doSpell(ts, _Q, qRange)
  512.             if RyzeSettings.autoMouseFollow then moveToCursor() end
  513.         elseif RyzeConfig.useUlti and myHero:CanUseSpell(_R) == READY then
  514.             CastSpell(_R)
  515.             if RyzeSettings.autoMouseFollow then moveToCursor() end
  516.         elseif myHero:CanUseSpell(_E) == READY then
  517.             doSpell(ts, _E, wRange)
  518.             if RyzeSettings.autoMouseFollow then moveToCursor() end
  519.         elseif myHero:CanUseSpell(_W) == READY then
  520.             doSpell(ts, _W, eRange)
  521.             if RyzeSettings.autoMouseFollow then moveToCursor() end
  522.         end
  523.     elseif (RyzeConfig.LongActive or (Switch and RyzeConfig.BurstActive)) and ValidTarget(ts.target) then
  524.         if DFGREADY then
  525.             CastSpell(DFGSlot, ts.target)
  526.         end
  527.         if HXGREADY then
  528.             CastSpell(HXGSlot, ts.target)
  529.         end
  530.         if BWCREADY then
  531.             CastSpell(BWCSlot, ts.target)
  532.         end
  533.         if myHero:CanUseSpell(_Q) == READY and myHero:GetDistance(ts.target) <= RyzeSettings.whunt then
  534.             doSpell(ts, _Q, qRange)
  535.             if RyzeSettings.autoMouseFollow then moveToCursor() end
  536.             qcasted = true
  537.             if RyzeConfig.useUlti and myHero:CanUseSpell(_R) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN then
  538.                 CastSpell(_R)
  539.                 if RyzeSettings.autoMouseFollow then moveToCursor() end
  540.                 qcasted = false
  541.             end
  542.         elseif myHero:CanUseSpell(_W) == READY and myHero:GetDistance(ts.target) > RyzeSettings.whunt then
  543.             doSpell(ts, _W, wRange)
  544.             if RyzeSettings.autoMouseFollow then moveToCursor() end
  545.             qcasted = false
  546.             if myHero:CanUseSpell(_Q) == READY then
  547.                 doSpell(ts, _Q, qRange)
  548.                 if RyzeSettings.autoMouseFollow then moveToCursor() end
  549.                 qcasted = true
  550.             end
  551.         elseif myHero:CanUseSpell(_Q) == READY then
  552.             doSpell(ts, _Q, qRange)
  553.             if RyzeSettings.autoMouseFollow then moveToCursor() end
  554.             qcasted = true
  555.         elseif RyzeConfig.useUlti and myHero:CanUseSpell(_R) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN then
  556.             CastSpell(_R)
  557.             if RyzeSettings.autoMouseFollow then moveToCursor() end
  558.             qcasted = false
  559.         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
  560.             doSpell(ts, _W, wRange)
  561.             if RyzeSettings.autoMouseFollow then moveToCursor() end
  562.             qcasted = false
  563.         elseif myHero:CanUseSpell(_E) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN then
  564.             doSpell(ts, _E, wRange)
  565.             if RyzeSettings.autoMouseFollow then moveToCursor() end
  566.             qcasted = false
  567.         elseif myHero:CanUseSpell(_W) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN then
  568.             doSpell(ts, _W, wRange)
  569.             if RyzeSettings.autoMouseFollow then moveToCursor() end
  570.             qcasted = false
  571.         end
  572.     elseif RyzeConfig.JungleActive then
  573.         closest = findClosestEnemy()
  574.         if ValidTarget(closest) then
  575.             if myHero:GetDistance(closest) > JungleRange then
  576.                 SaveJungle = true
  577.             end
  578.         elseif closest == nil then
  579.             SaveJungle = true
  580.         else
  581.             SaveJungle = false
  582.         end
  583.         if ValidTarget(MonsterTarget) then
  584.             if myHero:GetDistance(MonsterTarget) > eRange then
  585.                 MiniMonster = false
  586.                 CheckMonster(Vilemaw)
  587.                 CheckMonster(Nashor)
  588.                 CheckMonster(Dragon)
  589.                 CheckMonster(Golem1)
  590.                 CheckMonster(Golem2)
  591.                 CheckMonster(Lizard1)
  592.                 CheckMonster(Lizard2)
  593.             end
  594.         else
  595.             MiniMonster = false
  596.             CheckMonster(Vilemaw)
  597.             CheckMonster(Nashor)
  598.             CheckMonster(Dragon)
  599.             CheckMonster(Golem1)
  600.             CheckMonster(Golem2)
  601.             CheckMonster(Lizard1)
  602.             CheckMonster(Lizard2)
  603.         end
  604.         if SaveJungle == true and MiniMonster == false and targeting == true then
  605.             if myHero:CanUseSpell(_Q) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=qRange then
  606.                 CastSpell(_Q, MonsterTarget)
  607.                 if RyzeSettings.autoMouseFollow then moveToCursor() end
  608.                 qcasted = true
  609.             elseif RyzeConfig.useUltiJungle and myHero:CanUseSpell(_R) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=qRange then
  610.                 CastSpell(_R)
  611.                 if RyzeSettings.autoMouseFollow then moveToCursor() end
  612.                 qcasted = false
  613.             elseif myHero:CanUseSpell(_E) == READY and qcasted == true and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=eRange then
  614.                 CastSpell(_E, MonsterTarget)
  615.                 if RyzeSettings.autoMouseFollow then moveToCursor() end
  616.                 qcasted = false
  617.             elseif myHero:CanUseSpell(_W) == READY and qcasted == true and myHero:CanUseSpell(_Q) == COOLDOWN and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=wRange then
  618.                 CastSpell(_W, MonsterTarget)
  619.                 if RyzeSettings.autoMouseFollow then moveToCursor() end
  620.                 qcasted = false
  621.             end
  622.         if ValidTarget(MonsterTarget) then
  623.             if ((MonsterDMG("Q",_Q,MonsterTarget,qRange) + MonsterDMG("W",_W,MonsterTarget,wRange)) >= MonsterTarget.health) then
  624.                 MonsterKillable = true
  625.                 if myHero:CanUseSpell(_Q) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=qRange then
  626.                     CastSpell(_Q, MonsterTarget)
  627.                 end
  628.                 if myHero:CanUseSpell(_W) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=wRange then
  629.                     CastSpell(_W, MonsterTarget)
  630.                 end
  631.                 if myHero:CanUseSpell(_E) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=eRange then
  632.                     CastSpell(_E, MonsterTarget)
  633.                 end
  634.             else
  635.                 MonsterKillable = false
  636.             end
  637.         end
  638.         end
  639.         if SaveJungle == true and (not ValidTarget(MonsterTarget) or (MiniMonster == true and targeting == true)) then
  640.             MiniMonster = true
  641.             CheckMonster(Wolf1)
  642.             CheckMonster(Wolf2)
  643.             CheckMonster(Golem1)
  644.             CheckMonster(Golem2)
  645.             CheckMonster(Wraith1)
  646.             CheckMonster(Wraith2)
  647.             if myHero:CanUseSpell(_R) == READY and RyzeConfig.useUltiJungle and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=eRange then
  648.                 CastSpell(_R)
  649.                 if RyzeSettings.autoMouseFollow then moveToCursor() end
  650.             elseif myHero:CanUseSpell(_E) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=eRange then
  651.                 CastSpell(_E, MonsterTarget)
  652.                 if RyzeSettings.autoMouseFollow then moveToCursor() end
  653.             elseif myHero:CanUseSpell(_Q) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=qRange then
  654.                 CastSpell(_Q, MonsterTarget)
  655.                 if RyzeSettings.autoMouseFollow then moveToCursor() end
  656.             elseif myHero:CanUseSpell(_W) == READY and ValidTarget(MonsterTarget) and GetDistance(MonsterTarget)<=wRange then
  657.                 CastSpell(_W, MonsterTarget)
  658.                 if RyzeSettings.autoMouseFollow then moveToCursor() end
  659.             end
  660.         end
  661.     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
  662.         for index, minion in pairs(enemyMinions.objects) do
  663.             local myQ = getDmg("Q",minion,myHero)
  664.             local myW = getDmg("W",minion,myHero)
  665.             if (minion.maxHealth >= 700+27*math.floor(GetGameTimer()/180000)) then
  666.                 local ProMinion = minion
  667.                 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
  668.                     CastSpell(_Q, ProMinion)
  669.                 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
  670.                     CastSpell(_W, ProMinion)
  671.                 end
  672.             end
  673.             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
  674.                 CastSpell(_Q, minion)
  675.             end
  676.         end
  677.     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
  678.         for index, minion in pairs(enemyMinions.objects) do
  679.             local myQ = getDmg("Q",minion,myHero)
  680.             local myW = getDmg("W",minion,myHero)
  681.             local myE = getDmg("E",minion,myHero)
  682.             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
  683.                 CastSpell(_Q, minion)
  684.                 qtarget = minion
  685.             end
  686.             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
  687.                 CastSpell(_W, minion)
  688.                 wtarget = minion
  689.             end
  690.             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
  691.                 CastSpell(_E, minion)
  692.                 etarget = minion
  693.             end
  694.         end
  695.     end
  696.     if RyzeConfig.autoAAFarm and GetTickCount() > nextTick then
  697.         if RyzeSettings.autoAAFollow then
  698.             moveToCursor()
  699.         end
  700.         for index, minion in pairs(enemyMinions.objects) do
  701.             local myAA = getDmg("AD",minion,myHero)
  702.             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
  703.                 player:Attack(minion)
  704.             end
  705.          nextTick = GetTickCount() + waitDelay
  706.         end
  707.     end
  708.     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
  709.         if myHero:CanUseSpell(_Q) == READY then
  710.             doSpell(ts, _Q, qRange)
  711.         end
  712.     end
  713.     if RyzeConfig.CageHunter and myHero:CanUseSpell(_W) == READY then
  714.         closest = findClosestEnemy()
  715.         if ValidTarget(closest) then
  716.             if myHero:GetDistance(closest) < wRange and ValidTarget(closest) then
  717.                 CastSpell(_W, closest)
  718.             end
  719.         end
  720.     end
  721.     if RyzeConfig.Ignite then      
  722.         if IREADY then
  723.             local ignitedmg = 0    
  724.             for j = 1, heroManager.iCount, 1 do
  725.                 local enemyhero = heroManager:getHero(j)
  726.                 if ValidTarget(enemyhero,600) then
  727.                     ignitedmg = 50 + 20 * myHero.level
  728.                     if enemyhero.health <= ignitedmg then
  729.                         CastSpell(ignite, enemyhero)
  730.                     end
  731.                 end
  732.             end
  733.         end
  734.     end
  735. end
  736.  
  737. function OnProcessSpell(unit, spell)
  738. --[[    if (spell.name:find("ChaosTurret") and myHero.team == TEAM_RED) or (spell.name:find("OrderTurret") and myHero.team == TEAM_BLUE) and RyzeConfig.cageW then
  739.         for i=1, heroManager.iCount do
  740.             local enemy = heroManager:GetHero(i)
  741.             if ValidTarget(enemy) then
  742.                 if GetDistance(spell.endPos, enemy)<80 and GetDistance(enemy)<=wRange and myHero:CanUseSpell(_W) == READY then
  743.                     CastSpell(_W, enemy)
  744.                 end
  745.             end
  746.         end            
  747.     end
  748. -- ]]
  749.  
  750.     if myHero.dead then return end
  751.     if object ~= nil and spell ~= nil then
  752.         if object.isMe then
  753.             if spell.name:find("Attack") then lastAttack = GetTickCount() end
  754.             if isAttackResetSpell(spell) then
  755.                 lastAttack = lastAttack - (attackDelayOffset / getAttackSpeed())
  756.             end
  757.         end
  758.     end
  759.  
  760.     if InTurretRange == true then
  761.         if unit.team == TEAM_ENEMY and GetDistance(unit) < wRange and GetDistance(spell.endPos, myHero)<10 then
  762.             for i=1, heroManager.iCount do
  763.                 local enemy = heroManager:GetHero(i)
  764.                 if ValidTarget(enemy) then
  765.                     if enemy.name == unit.name then
  766.                         if GetDistance(enemy)<=wRange and myHero:CanUseSpell(_W) == READY then
  767.                             if enemy:GetDistance(CageTurret.object) < 800 then
  768.                                 CastSpell(_W, enemy)
  769.                             end
  770.                         end
  771.                     end
  772.                 end
  773.             end
  774.         end
  775.     end
  776. end
  777.  
  778. function findClosestTurret()
  779. local closestTurret = nil
  780. local currentTurret = nil
  781. for name, turret in pairs(turrets) do
  782.     if turret.object.valid ~= false then
  783.         currentTurret = turret
  784.     end
  785.     if turret.team == myHero.team then
  786.         if closestTurret == nil then
  787.             closestTurret = currentTurret
  788.         elseif GetDistance(currentTurret) < GetDistance(closestTurret) then
  789.             closestTurret = currentTurret
  790.         end
  791.     end
  792. end
  793. return closestTurret
  794. end
  795.  
  796.  
  797. function OnCreateObj(obj)
  798.     if myHero.dead then return end
  799.     -- We want to know when we performed our attack at all times, not when we just use a hotkey.
  800.     for _, v in pairs(getChampTable()[myHero.charName].aaParticles) do
  801.         if obj.name:lower():find(v:lower()) then
  802.             attackedSuccessfully()
  803.             if particleDebug then PrintChat("Particle found!") end
  804.         end
  805.     end
  806.  
  807.     if obj ~= nil and obj.type == "obj_AI_Minion" and obj.name ~= nil then
  808.         if obj.name == "TT_Spiderboss7.1.1" then Vilemaw = obj
  809.         elseif obj.name == "Worm12.1.1" then Nashor = obj
  810.         elseif obj.name == "Dragon6.1.1" then Dragon = obj
  811.         elseif obj.name == "AncientGolem1.1.1" then Golem1 = obj
  812.         elseif obj.name == "AncientGolem7.1.1" then Golem2 = obj
  813.         elseif obj.name == "LizardElder4.1.1" then Lizard1 = obj
  814.         elseif obj.name == "LizardElder10.1.1" then Lizard2 = obj
  815.         elseif obj.name == "GiantWolf2.1.3" then Wolf1 = obj
  816.         elseif obj.name == "GiantWolf8.1.3" then Wolf2 = obj
  817.         elseif obj.name == "Wraith3.1.3" then Wraith1 = obj
  818.         elseif obj.name == "Wraith9.1.3" then Wraith2 = obj
  819.         elseif obj.name == "Golem5.1.2" then Golem1 = obj
  820.         elseif obj.name == "Golem11.1.2" then Golem2 = obj
  821.         end
  822.     end
  823. end
  824.  
  825. function OnDeleteObj(object)
  826.     if object ~= nil and object.type == "obj_AI_Turret" then
  827.         for name, turret in pairs(turrets) do
  828.             if name == object.name then
  829.                 turrets[name] = nil
  830.                 return
  831.             end
  832.         end
  833.     end
  834. end
  835.  
  836. function ASLoadMinions()
  837.     for i = 1, objManager.maxObjects do
  838.         local obj = objManager:getObject(i)
  839.         if obj ~= nil and obj.type == "obj_AI_Minion" and obj.name ~= nil then
  840.             if obj.name == "TT_Spiderboss7.1.1" then Vilemaw = obj
  841.             elseif obj.name == "Worm12.1.1" then Nashor = obj
  842.             elseif obj.name == "Dragon6.1.1" then Dragon = obj
  843.             elseif obj.name == "AncientGolem1.1.1" then Golem1 = obj
  844.             elseif obj.name == "AncientGolem7.1.1" then Golem2 = obj
  845.             elseif obj.name == "LizardElder4.1.1" then Lizard1 = obj
  846.             elseif obj.name == "LizardElder10.1.1" then Lizard2 = obj
  847.             elseif obj.name == "GiantWolf2.1.3" then Wolf1 = obj
  848.             elseif obj.name == "GiantWolf8.1.3" then Wolf2 = obj
  849.             elseif obj.name == "Wraith3.1.3" then Wraith1 = obj
  850.             elseif obj.name == "Wraith9.1.3" then Wraith2 = obj
  851.             elseif obj.name == "Golem5.1.2" then Golem1 = obj
  852.             elseif obj.name == "Golem11.1.2" then Golem2 = obj
  853.             end
  854.         end
  855.     end
  856. end
  857.  
  858.  
  859. function CheckMonster(minion)
  860. if minion ~= nil and ValidTarget(minion) then
  861.     if myHero:GetDistance(minion) < eRange then
  862.         MonsterTarget = minion
  863.         targeting = true
  864.     elseif not ValidTarget(MonsterTarget) then
  865.         targeting = false
  866.     end
  867. end
  868. end
  869.  
  870. function MonsterDMG(dmgspell,spell,monster,range)
  871.     if monster ~= nil and GetMyHero():CanUseSpell(spell) == READY and GetDistance(monster)<=range then
  872.         return getDmg(dmgspell,monster,myHero)
  873.     else
  874.         return 0
  875.     end
  876. end
  877.  
  878. function RyzeItem()
  879. DFGSlot, HXGSlot, BWCSlot = GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144)
  880. SheenSlot, TrinitySlot, LBSlot = GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100)
  881. IGSlot, LTSlot, BTSlot = GetInventorySlotItem(3025), GetInventorySlotItem(3151), GetInventorySlotItem(3188)
  882. STISlot, ROSlot, BRKSlot = GetInventorySlotItem(3092),GetInventorySlotItem(3143),GetInventorySlotItem(3153)
  883. QREADY = (myHero:CanUseSpell(_Q) == READY)
  884. WREADY = (myHero:CanUseSpell(_W) == READY)
  885. EREADY = (myHero:CanUseSpell(_E) == READY)
  886. RREADY = (myHero:CanUseSpell(_R) == READY)
  887. DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  888. HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  889. BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  890. STIREADY = (STISlot ~= nil and myHero:CanUseSpell(STISlot) == READY)
  891. ROREADY = (ROSlot ~= nil and myHero:CanUseSpell(ROSlot) == READY)
  892. BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
  893. IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  894. end
  895.  
  896. function checkTurretState()
  897.     for name, turret in pairs(turrets) do
  898.         if turret.object.valid == false then
  899.             turrets[name] = nil
  900.         end
  901.     end
  902. end
  903.  
  904. function onChoiceFunction()
  905.     if player:GetSpellData(SPELL_1).level < player:GetSpellData(SPELL_2).level then
  906.         return 1
  907.     else
  908.         return 2
  909.     end
  910. end
  911.  
  912. function isAttackResetSpell(spell)
  913.     if spell.name == "Overload"
  914.         or spell.name == "SpellFlux"
  915.         or spell.name == "RunePrison"
  916.     then
  917.         return true
  918.     end
  919.     return false
  920. end
  921.  
  922. function getChampTable() --Needs to have right/approx values. Most of the champions must have at least 2 or more aaParticles, because having bad aaParticles will lead to bad next attack timing.
  923.     return {Ryze = { projSpeed = 2.4, aaParticles = {"ManaLeach_mis"}, aaSpellName = {"RyzeBasicAttack"}, startAttackSpeed = "0.625" }}
  924. end
  925.  
  926.  
  927.  quotes = { 'Let\'s go, let\'s go!',
  928.  'Unpleasant? I\'ll show you unpleasant!',
  929.  'Take this scroll and stick it... somewhere safe.',
  930.  'I got these tattoos in rune prison!',
  931.  'Right back at you!'}
  932. PrintFloatText(myHero, 10, quotes[math.random(5)])
Advertisement
Add Comment
Please, Sign In to add comment