naturus

Untitled

Dec 25th, 2014
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 38.83 KB | None | 0 0
  1. ]]--
  2.  
  3.  
  4. if myHero.charName ~= "Ahri" then return end
  5.  
  6. _G.AUTOUPDATE = true
  7. _G.USESKINHACK = false
  8.  
  9. local version = "0.1"
  10. local UPDATE_HOST = "raw.github.com"
  11. local UPDATE_PATH = "/kokosik1221/bol/master/AhriMaster.lua".."?rand="..math.random(1,10000)
  12. local UPDATE_FILE_PATH = SCRIPT_PATH..GetCurrentEnv().FILE_NAME
  13. local UPDATE_URL = "https://"..UPDATE_HOST..UPDATE_PATH
  14. function AutoupdaterMsg(msg) print("<font color=\"#FF0000\"><b>AhriMaster:</b></font> <font color=\"#FFFFFF\">"..msg..".</font>") end
  15. if _G.AUTOUPDATE then
  16.     local ServerData = GetWebResult(UPDATE_HOST, "/kokosik1221/bol/master/AhriMaster.version")
  17.     if ServerData then
  18.         ServerVersion = type(tonumber(ServerData)) == "number" and tonumber(ServerData) or nil
  19.         if ServerVersion then
  20.             if tonumber(version) < ServerVersion then
  21.                 AutoupdaterMsg("New version available "..ServerVersion)
  22.                 AutoupdaterMsg("Updating, please don't press F9")
  23.                 DelayAction(function() DownloadFile(UPDATE_URL, UPDATE_FILE_PATH, function () AutoupdaterMsg("Successfully updated. ("..version.." => "..ServerVersion.."), press F9 twice to load the updated version.") end) end, 3)
  24.             else
  25.                 AutoupdaterMsg("You have got the latest version ("..ServerVersion..")")
  26.             end
  27.         end
  28.     else
  29.         AutoupdaterMsg("Error downloading version info")
  30.     end
  31. end
  32. local REQUIRED_LIBS = {
  33.     ["vPrediction"] = "https://raw.github.com/Hellsing/BoL/master/common/VPrediction.lua",
  34.     ["Prodiction"] = "https://bitbucket.org/Klokje/public-klokjes-bol-scripts/raw/ec830facccefb3b52212dba5696c08697c3c2854/Test/Prodiction/Prodiction.lua",
  35. }
  36. local DOWNLOADING_LIBS, DOWNLOAD_COUNT = false, 0
  37. function AfterDownload()
  38.     DOWNLOAD_COUNT = DOWNLOAD_COUNT - 1
  39.     if DOWNLOAD_COUNT == 0 then
  40.         DOWNLOADING_LIBS = false
  41.         print("<b><font color=\"#6699FF\">Required libraries downloaded successfully, please reload (double F9).</font>")
  42.     end
  43. end
  44. for DOWNLOAD_LIB_NAME, DOWNLOAD_LIB_URL in pairs(REQUIRED_LIBS) do
  45.     if FileExist(LIB_PATH .. DOWNLOAD_LIB_NAME .. ".lua") then
  46.         if DOWNLOAD_LIB_NAME ~= "Prodiction" then
  47.             require(DOWNLOAD_LIB_NAME)
  48.         end
  49.         if DOWNLOAD_LIB_NAME == "Prodiction" and VIP_USER then
  50.             require(DOWNLOAD_LIB_NAME)
  51.             prodstatus = true
  52.         end
  53.     else
  54.         DOWNLOADING_LIBS = true
  55.         DOWNLOAD_COUNT = DOWNLOAD_COUNT + 1
  56.         DownloadFile(DOWNLOAD_LIB_URL, LIB_PATH .. DOWNLOAD_LIB_NAME..".lua", AfterDownload)
  57.     end
  58. end
  59.  
  60.  
  61. local InterruptList = {
  62.     {charName = "FiddleSticks", spellName = "Crowstorm"},
  63.     {charName = "MissFortune", spellName = "MissFortuneBulletTime"},
  64.     {charName = "Nunu", spellName = "AbsoluteZero"},
  65.     {charName = "Caitlyn", spellName = "CaitlynAceintheHole"},
  66.     {charName = "Katarina", spellName = "KatarinaR"},
  67.     {charName = "Karthus", spellName = "FallenOne"},
  68.     {charName = "Malzahar", spellName = "AlZaharNetherGrasp"},
  69.     {charName = "Galio", spellName = "GalioIdolOfDurand"},
  70.     {charName = "Darius", spellName = "DariusExecute"},
  71.     {charName = "MonkeyKing", spellName = "MonkeyKingSpinToWin"},
  72.     {charName = "Vi", spellName = "ViR"},
  73.     {charName = "Shen", spellName = "ShenStandUnited"},
  74.     {charName = "Urgot", spellName = "UrgotSwap2"},
  75.     {charName = "Pantheon", spellName = "Pantheon_GrandSkyfall_Jump"},
  76.     {charName = "Lucian", spellName = "LucianR"},
  77.     {charName = "Warwick", spellName = "InfiniteDuress"},
  78.     {charName = "Urgot", spellName = "UrgotSwap2"},
  79.     {charName = "Xerath", spellName = "XerathLocusOfPower2"},
  80.     {charName = "Velkoz", spellName = "VelkozR"},
  81.     {charName = "Skarner", spellName = "SkarnerImpale"},
  82. }
  83.  
  84. local GapCloserList = {
  85.     {charName = "Aatrox", spellName = "AatroxQ"},
  86.     {charName = "Akali", spellName = "AkaliShadowDance"},
  87.     {charName = "Alistar", spellName = "Headbutt"},
  88.     {charName = "Fiora", spellName = "FioraQ"},
  89.     {charName = "Diana", spellName = "DianaTeleport"},
  90.     {charName = "Elise", spellName = "EliseSpiderQCast"},
  91.     {charName = "Fizz", spellName = "FizzPiercingStrike"},
  92.     {charName = "Gragas", spellName = "GragasE"},
  93.     {charName = "Hecarim", spellName = "HecarimUlt"},
  94.     {charName = "JarvanIV", spellName = "JarvanIVDragonStrike"},
  95.     {charName = "Irelia", spellName = "IreliaGatotsu"},
  96.     {charName = "Jax", spellName = "JaxLeapStrike"},
  97.     {charName = "Khazix", spellName = "KhazixE"},
  98.     {charName = "Khazix", spellName = "khazixelong"},
  99.     {charName = "LeBlanc", spellName = "LeblancSlide"},
  100.     {charName = "LeBlanc", spellName = "LeblancSlideM"},
  101.     {charName = "LeeSin", spellName = "BlindMonkQTwo"},
  102.     {charName = "Leona", spellName = "LeonaZenithBlade"},
  103.     {charName = "Malphite", spellName = "UFSlash"},
  104.     {charName = "Pantheon", spellName = "Pantheon_LeapBash"},
  105.     {charName = "Poppy", spellName = "PoppyHeroicCharge"},
  106.     {charName = "Renekton", spellName = "RenektonSliceAndDice"},
  107.     {charName = "Riven", spellName = "RivenTriCleave"},
  108.     {charName = "Sejuani", spellName = "SejuaniArcticAssault"},
  109.     {charName = "Tryndamere", spellName = "slashCast"},
  110.     {charName = "Vi", spellName = "ViQ"},
  111.     {charName = "MonkeyKing", spellName = "MonkeyKingNimbus"},
  112.     {charName = "XinZhao", spellName = "XenZhaoSweep"},
  113.     {charName = "Yasuo", spellName = "YasuoDashWrapper"},
  114. }
  115.  
  116. local Items = {
  117.     BWC = { id = 3144, range = 400, reqTarget = true, slot = nil },
  118.     DFG = { id = 3128, range = 750, reqTarget = true, slot = nil },
  119.     HGB = { id = 3146, range = 400, reqTarget = true, slot = nil },
  120.     BFT = { id = 3188, range = 750, reqTarget = true, slot = nil },
  121. }
  122.  
  123. function Vars()
  124.     Q = {name = "Orb of Deception", range = 840, speed = 1100, delay = 0.25, width = 90}
  125.     W = {name = "Fox-Fire", range = 800}
  126.     E = {name = "Charm", range = 975, speed = 1200, delay = 0.25, width = 100}
  127.     R = {name = "Spirit Rush", range = 450}
  128.     QReady, WReady, EReady, RReady, IReady, zhonyaready, recall, aa = false, false, false, false, false, false, true
  129.     abilitylvl, lastskin, LastAttack, BaseWindupTime, BaseAnimationTime = 0, 0, 0, 3, 0.65
  130.     EnemyMinions = minionManager(MINION_ENEMY, Q.range, myHero, MINION_SORT_MAXHEALTH_DEC)
  131.     JungleMinions = minionManager(MINION_JUNGLE, Q.range, myHero, MINION_SORT_MAXHEALTH_DEC)
  132.     IgniteKey, zhonyaslot = nil, nil
  133.     killstring = {}
  134.     TargetTable = {
  135.         AP = {
  136.             "Annie", "Ahri", "Akali", "Anivia", "Annie", "Brand", "Cassiopeia", "Diana", "Evelynn", "FiddleSticks", "Fizz", "Annie", "Heimerdinger", "Karthus",
  137.             "Kassadin", "Katarina", "Kayle", "Kennen", "Leblanc", "Lissandra", "Lux", "Malzahar", "Mordekaiser", "Morgana", "Nidalee", "Orianna",
  138.             "Ryze", "Sion", "Swain", "Syndra", "Teemo", "TwistedFate", "Veigar", "Viktor", "Vladimir", "Xerath", "Ziggs", "Zyra", "Velkoz"
  139.         }, 
  140.         Support = {
  141.             "Alistar", "Blitzcrank", "Janna", "Karma", "Leona", "Lulu", "Nami", "Nunu", "Sona", "Soraka", "Taric", "Thresh", "Zilean", "Braum"
  142.         }, 
  143.         Tank = {
  144.             "Amumu", "Chogath", "DrMundo", "Galio", "Hecarim", "Malphite", "Maokai", "Nasus", "Rammus", "Sejuani", "Nautilus", "Shen", "Singed", "Skarner", "Volibear",
  145.             "Warwick", "Yorick", "Zac"
  146.         },
  147.         AD_Carry = {
  148.             "Ashe", "Caitlyn", "Corki", "Draven", "Ezreal", "Graves", "Jayce", "Jinx", "KogMaw", "Lucian", "MasterYi", "MissFortune", "Pantheon", "Quinn", "Shaco", "Sivir",
  149.             "Talon","Tryndamere", "Tristana", "Twitch", "Urgot", "Varus", "Vayne", "Yasuo", "Zed"
  150.         },
  151.         Bruiser = {
  152.             "Aatrox", "Darius", "Elise", "Fiora", "Gangplank", "Garen", "Irelia", "JarvanIV", "Jax", "Khazix", "LeeSin", "Nocturne", "Olaf", "Poppy",
  153.             "Renekton", "Rengar", "Riven", "Rumble", "Shyvana", "Trundle", "Udyr", "Vi", "MonkeyKing", "XinZhao"
  154.         }
  155.     }
  156. end
  157.  
  158. function OnLoad()
  159.     print("<b><font color=\"#6699FF\">Ahri Master:</font></b> <font color=\"#FFFFFF\">Good luck and give me feedback!</font>")
  160.     Vars()
  161.     Menu()
  162. end
  163.  
  164. function OnTick()
  165.     Check()
  166.     if MenuAhri.Orbwalkingf.Combo and ((myHero.mana/myHero.maxMana)*100) >= MenuAhri.comboConfig.manac then
  167.         caa()
  168.         Combo()
  169.     end
  170.     if MenuAhri.Orbwalkingf.LastHit then
  171.         _OrbWalk(Lasthit())
  172.     end
  173.     if (MenuAhri.Orbwalkingf.Mixed or MenuAhri.Orbwalkingf.MixedT) and ((myHero.mana/myHero.maxMana)*100) >= MenuAhri.harrasConfig.manah then
  174.         Harrass()
  175.     end
  176.     if MenuAhri.Orbwalkingf.LaneClear and ((myHero.mana/myHero.maxMana)*100) >= MenuAhri.farm.manaf then
  177.         Farm()
  178.     end
  179.     if MenuAhri.Orbwalkingf.JungleFarm and ((myHero.mana/myHero.maxMana)*100) >= MenuAhri.jf.manajf then
  180.         JungleFarmm()
  181.     end
  182.     if MenuAhri.prConfig.AZ then
  183.         autozh()
  184.     end
  185.     if MenuAhri.prConfig.ALS then
  186.         autolvl()
  187.     end
  188.     KillSteall()
  189. end
  190.  
  191. function Menu()
  192.     VP = VPrediction()
  193.     MenuAhri = scriptConfig("Ahri Master "..version, "Ahri Master "..version)
  194.     MenuAhri:addSubMenu("Orbwalking", "Orbwalkingf")
  195.     MenuAhri.Orbwalkingf:addParam("Combo", "Full Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  196.     MenuAhri.Orbwalkingf:addParam("LastHit", "Last Hit ", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("X")) 
  197.     MenuAhri.Orbwalkingf:addParam("Mixed", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("C"))
  198.     MenuAhri.Orbwalkingf:addParam("MixedT", "Harass Toggle", SCRIPT_PARAM_ONKEYTOGGLE, false, string.byte("L"))
  199.     MenuAhri.Orbwalkingf:addParam("LaneClear", "Lane Clear ", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("V")) 
  200.     MenuAhri.Orbwalkingf:addParam("JungleFarm", "Jungle Clear", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("V"))
  201.     MenuAhri:addSubMenu("Target selector", "STS")
  202.     TargetSelector = TargetSelector(TARGET_LESS_CAST_PRIORITY, E.range, DAMAGE_MAGIC)
  203.     TargetSelector.name = "Ahri"
  204.     MenuAhri.STS:addTS(TargetSelector)
  205.     MenuAhri:addSubMenu("[Ahri Master]: Combo Settings", "comboConfig")
  206.     MenuAhri.comboConfig:addParam("USEQ", "Use " .. Q.name .. "(Q)", SCRIPT_PARAM_ONOFF, true)
  207.     MenuAhri.comboConfig:addParam("USEQ2", "Use Only If Enemy Is Charmed", SCRIPT_PARAM_ONOFF, false)
  208.     MenuAhri.comboConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  209.     MenuAhri.comboConfig:addParam("USEW", "Use " .. W.name .. "(W)", SCRIPT_PARAM_ONOFF, true)
  210.     MenuAhri.comboConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  211.     MenuAhri.comboConfig:addParam("USEE", "Use " .. E.name .. "(E)", SCRIPT_PARAM_ONOFF, true)
  212.     MenuAhri.comboConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  213.     MenuAhri.comboConfig:addParam("USER", "Use " .. R.name .. "(R)", SCRIPT_PARAM_ONOFF, true)
  214.     MenuAhri.comboConfig:addParam("Kilable", "Only Use If Target Is Killable", SCRIPT_PARAM_ONOFF, true)
  215.     MenuAhri.comboConfig:addParam("RM", "R Cast Mode", SCRIPT_PARAM_LIST, 1, { "To Mouse", "To Enemy"})
  216.     MenuAhri.comboConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  217.     MenuAhri.comboConfig:addParam("uaa", "Use AA in Combo", SCRIPT_PARAM_ONOFF, true)
  218.     MenuAhri.comboConfig:addParam("ST", "Focus Selected Target", SCRIPT_PARAM_ONOFF, false)
  219.     MenuAhri.comboConfig:addParam("manac", "Min. Mana To Cast Combo", SCRIPT_PARAM_SLICE, 10, 0, 100, 0)
  220.     MenuAhri:addSubMenu("[Ahri Master]: Harras Settings", "harrasConfig")
  221.     MenuAhri.harrasConfig:addParam("QH", "Harras Use " .. Q.name .. "(Q)", SCRIPT_PARAM_ONOFF, true)
  222.     MenuAhri.harrasConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  223.     MenuAhri.harrasConfig:addParam("WH", "Harras Use " .. W.name .. "(W)", SCRIPT_PARAM_ONOFF, true)
  224.     MenuAhri.harrasConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  225.     MenuAhri.harrasConfig:addParam("EH", "Harras Use " .. E.name .. "(E)", SCRIPT_PARAM_ONOFF, true)
  226.     MenuAhri.harrasConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  227.     MenuAhri.harrasConfig:addParam("manah", "Min. Mana To Harass", SCRIPT_PARAM_SLICE, 60, 0, 100, 0)
  228.     MenuAhri:addSubMenu("[Ahri Master]: KS Settings", "ksConfig")
  229.     MenuAhri.ksConfig:addParam("IKS", "Use Ignite To KS", SCRIPT_PARAM_ONOFF, true)
  230.     MenuAhri.ksConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  231.     MenuAhri.ksConfig:addParam("QKS", "Use " .. Q.name .. "(Q)", SCRIPT_PARAM_ONOFF, true)
  232.     MenuAhri.ksConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  233.     MenuAhri.ksConfig:addParam("WKS", "Use " .. W.name .. "(W)", SCRIPT_PARAM_ONOFF, true)
  234.     MenuAhri.ksConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  235.     MenuAhri.ksConfig:addParam("EKS", "Use " .. E.name .. "(E)", SCRIPT_PARAM_ONOFF, true)
  236.     MenuAhri.ksConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  237.     MenuAhri.ksConfig:addParam("RKS", "Use " .. R.name .. "(R)", SCRIPT_PARAM_ONOFF, false)
  238.     MenuAhri:addSubMenu("[Ahri Master]: Farm Settings", "farm")
  239.     MenuAhri.farm:addParam("QF", "Use " .. Q.name .. "(Q)", SCRIPT_PARAM_LIST, 3, { "No", "Freezing", "LaneClear"})
  240.     MenuAhri.farm:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  241.     MenuAhri.farm:addParam("WF",  "Use " .. W.name .. "(W)", SCRIPT_PARAM_LIST, 2, { "No", "Freezing", "LaneClear"})
  242.     MenuAhri.farm:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  243.     MenuAhri.farm:addParam("manaf", "Min. Mana To Farm", SCRIPT_PARAM_SLICE, 40, 0, 100, 0)
  244.     MenuAhri:addSubMenu("[Ahri Master]: Jungle Farm Settings", "jf")
  245.     MenuAhri.jf:addParam("QJF", "Use " .. Q.name .. "(Q)", SCRIPT_PARAM_ONOFF, true)
  246.     MenuAhri.jf:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  247.     MenuAhri.jf:addParam("WJF", "Use " .. W.name .. "(W)", SCRIPT_PARAM_ONOFF, true)
  248.     MenuAhri.jf:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  249.     MenuAhri.jf:addParam("manajf", "Min. Mana To Jungle Farm", SCRIPT_PARAM_SLICE, 10, 0, 100, 0)
  250.     MenuAhri:addSubMenu("[Ahri Master]: Extra Settings", "exConfig")
  251.     MenuAhri.exConfig:addSubMenu("Auto-Interrupt Spells", "ES")
  252.     for i, enemy in ipairs(GetEnemyHeroes()) do
  253.         for _, champ in pairs(InterruptList) do
  254.             if enemy.charName == champ.charName then
  255.                 MenuAhri.exConfig.ES:addParam(champ.spellName, "Stop "..champ.charName.." "..champ.spellName, SCRIPT_PARAM_ONOFF, true)
  256.             end
  257.         end
  258.     end
  259.     MenuAhri.exConfig:addParam("UI", "Use Auto-Interrupt (E)", SCRIPT_PARAM_ONOFF, true)
  260.     MenuAhri.exConfig:addSubMenu("GapCloser Spells", "ES2")
  261.     for i, enemy in ipairs(GetEnemyHeroes()) do
  262.         for _, champ in pairs(GapCloserList) do
  263.             if enemy.charName == champ.charName then
  264.                 MenuAhri.exConfig.ES2:addParam(champ.spellName, "GapCloser "..champ.charName.." "..champ.spellName, SCRIPT_PARAM_ONOFF, true)
  265.             end
  266.         end
  267.     end
  268.     MenuAhri.exConfig:addParam("UG", "Use GapCloser (E)", SCRIPT_PARAM_ONOFF, true)
  269.     MenuAhri:addSubMenu("[Ahri Master]: Draw Settings", "drawConfig")
  270.     MenuAhri.drawConfig:addParam("DLC", "Use Lag-Free Circles", SCRIPT_PARAM_ONOFF, true)
  271.     MenuAhri.drawConfig:addParam("DD", "Draw DMG Text", SCRIPT_PARAM_ONOFF, true)
  272.     MenuAhri.drawConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  273.     MenuAhri.drawConfig:addParam("DQR", "Draw Q Range", SCRIPT_PARAM_ONOFF, true)
  274.     MenuAhri.drawConfig:addParam("DQRC", "Draw Q Range Color", SCRIPT_PARAM_COLOR, {255,0,0,255})
  275.     MenuAhri.drawConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  276.     MenuAhri.drawConfig:addParam("DWR", "Draw W Range", SCRIPT_PARAM_ONOFF, true)
  277.     MenuAhri.drawConfig:addParam("DWRC", "Draw W Range Color", SCRIPT_PARAM_COLOR, {255,100,0,0})
  278.     MenuAhri.drawConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  279.     MenuAhri.drawConfig:addParam("DER", "Draw E Range", SCRIPT_PARAM_ONOFF, true)
  280.     MenuAhri.drawConfig:addParam("DERC", "Draw E Range Color", SCRIPT_PARAM_COLOR, {255,255,0,0})
  281.     MenuAhri.drawConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  282.     MenuAhri.drawConfig:addParam("DRR", "Draw R Range", SCRIPT_PARAM_ONOFF, true)
  283.     MenuAhri.drawConfig:addParam("DRRC", "Draw R Range Color", SCRIPT_PARAM_COLOR, {255, 0, 255, 0})
  284.     MenuAhri:addSubMenu("[Ahri Master]: Misc Settings", "prConfig")
  285.     MenuAhri.prConfig:addParam("pc", "Use Packets To Cast Spells(VIP)", SCRIPT_PARAM_ONOFF, false)
  286.     MenuAhri.prConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  287.     MenuAhri.prConfig:addParam("skin", "Use change skin", SCRIPT_PARAM_ONOFF, false)
  288.     MenuAhri.prConfig:addParam("skin1", "Skin change(VIP)", SCRIPT_PARAM_SLICE, 5, 1, 5)
  289.     MenuAhri.prConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  290.     MenuAhri.prConfig:addParam("AZ", "Use Auto Zhonya", SCRIPT_PARAM_ONOFF, true)
  291.     MenuAhri.prConfig:addParam("AZHP", "Min HP To Cast Zhonya", SCRIPT_PARAM_SLICE, 20, 0, 100, 0)
  292.     MenuAhri.prConfig:addParam("AZMR", "Must Have 0 Enemy In Range:", SCRIPT_PARAM_SLICE, 900, 0, 1500, 0)
  293.     MenuAhri.prConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  294.     MenuAhri.prConfig:addParam("ALS", "Auto lvl skills", SCRIPT_PARAM_ONOFF, false)
  295.     MenuAhri.prConfig:addParam("AL", "Auto lvl sequence", SCRIPT_PARAM_LIST, 1, { "R>Q>W>E", "R>Q>E>W", "R>W>Q>E", "R>W>E>Q", "R>E>Q>W", "R>E>W>Q" })
  296.     MenuAhri.prConfig:addParam("qqq", "--------------------------------------------------------", SCRIPT_PARAM_INFO,"")
  297.     MenuAhri.prConfig:addParam("pro", "Prodiction To Use:", SCRIPT_PARAM_LIST, 1, {"VPrediction","Prodiction"})
  298.     MenuAhri.prConfig:addParam("vphit", "VPrediction HitChance", SCRIPT_PARAM_LIST, 3, {"[0]Target Position","[1]Low Hitchance", "[2]High Hitchance", "[3]Target slowed/close", "[4]Target immobile", "[5]Target dashing" })
  299.     MenuAhri.Orbwalkingf:permaShow("Combo")
  300.     MenuAhri.Orbwalkingf:permaShow("Mixed")
  301.     MenuAhri.Orbwalkingf:permaShow("MixedT")
  302.     MenuAhri.Orbwalkingf:permaShow("LaneClear")
  303.     MenuAhri.Orbwalkingf:permaShow("JungleFarm")
  304.     MenuAhri.Orbwalkingf:permaShow("LastHit")
  305.     MenuAhri.exConfig:permaShow("UI")
  306.     MenuAhri.exConfig:permaShow("UG")
  307.     MenuAhri.prConfig:permaShow("AZ")
  308.     if myHero:GetSpellData(SUMMONER_1).name:find("summonerdot") then IgniteKey = SUMMONER_1
  309.         elseif myHero:GetSpellData(SUMMONER_2).name:find("summonerdot") then IgniteKey = SUMMONER_2
  310.     end
  311.     _G.oldDrawCircle = rawget(_G, 'DrawCircle')
  312.     _G.DrawCircle = DrawCircle2
  313.     if heroManager.iCount < 10 then
  314.         print("<font color=\"#FFFFFF\">Too few champions to arrange priority.</font>")
  315.     elseif heroManager.iCount == 6 then
  316.         arrangePrioritysTT()
  317.     else
  318.         arrangePrioritys()
  319.     end
  320. end
  321.  
  322. function EnemyCount(point, range)
  323.     local count = 0
  324.     for _, enemy in pairs(GetEnemyHeroes()) do
  325.         if enemy and not enemy.dead and GetDistance(point, enemy) <= range then
  326.             count = count + 1
  327.         end
  328.     end            
  329.     return count
  330. end
  331.  
  332. function caa()
  333.     if MenuAhri.comboConfig.uaa then
  334.         EnableAA()
  335.     elseif not MenuAhri.comboConfig.uaa then
  336.         DisableAA()
  337.     end
  338. end
  339.  
  340. function GetRange()
  341.     if QReady and EReady then
  342.         return E.range
  343.     elseif not QReady and EReady then
  344.         return E.range
  345.     elseif QReady and not EReady then
  346.         return Q.range
  347.     elseif not QReady and not EReady then
  348.         return R.range
  349.     else
  350.         return E.range
  351.     end
  352. end
  353.  
  354. function GetCustomTarget()
  355.     TargetSelector:update()
  356.     if _G.MMA_Target and _G.MMA_Target.type == myHero.type then
  357.         return _G.MMA_Target
  358.     end
  359.     if _G.AutoCarry and _G.AutoCarry.Crosshair and _G.AutoCarry.Attack_Crosshair and _G.AutoCarry.Attack_Crosshair.target and _G.AutoCarry.Attack_Crosshair.target.type == myHero.type then
  360.         return _G.AutoCarry.Attack_Crosshair.target
  361.     end
  362.     return TargetSelector.target
  363. end
  364.  
  365. function Check()
  366.     TargetSelector.range = GetRange()
  367.     if SelectedTarget ~= nil and ValidTarget(SelectedTarget, Q.range) then
  368.         Cel = SelectedTarget
  369.     else
  370.         Cel = GetCustomTarget()
  371.     end
  372.     zhonyaslot = GetInventorySlotItem(3157)
  373.     zhonyaready = (zhonyaslot ~= nil and myHero:CanUseSpell(zhonyaslot) == READY)
  374.     QReady = (myHero:CanUseSpell(_Q) == READY)
  375.     WReady = (myHero:CanUseSpell(_W) == READY)
  376.     EReady = (myHero:CanUseSpell(_E) == READY)
  377.     RReady = (myHero:CanUseSpell(_R) == READY)
  378.     IReady = (IgniteKey ~= nil and myHero:CanUseSpell(IgniteKey) == READY)
  379.     if MenuAhri.prConfig.skin and VIP_USER and _G.USESKINHACK then
  380.         if MenuAhri.prConfig.skin1 ~= lastSkin then
  381.             GenModelPacket("Ahri", MenuAhri.prConfig.skin1)
  382.             lastSkin = MenuAhri.prConfig.skin1
  383.         end
  384.     end
  385.     if MenuAhri.drawConfig.DLC then _G.DrawCircle = DrawCircle2 else _G.DrawCircle = _G.oldDrawCircle end
  386. end
  387.  
  388. function UseItems(unit)
  389.     if unit ~= nil then
  390.         for _, item in pairs(Items) do
  391.             item.slot = GetInventorySlotItem(item.id)
  392.             if item.slot ~= nil then
  393.                 if item.reqTarget and GetDistance(unit) < item.range then
  394.                     CastSpell(item.slot, unit)
  395.                 elseif not item.reqTarget then
  396.                     if (GetDistance(unit) - getHitBoxRadius(myHero) - getHitBoxRadius(unit)) < 50 then
  397.                         CastSpell(item.slot)
  398.                     end
  399.                 end
  400.             end
  401.         end
  402.     end
  403. end
  404.  
  405. function getHitBoxRadius(target)
  406.     return GetDistance(target.minBBox, target.maxBBox)/2
  407. end
  408.  
  409. function Combo()
  410.     _OrbWalk(Cel)
  411.     if Cel ~= nil then
  412.         UseItems(Cel)
  413.         if MenuAhri.comboConfig.USER then
  414.             if RReady and ValidTarget(Cel, E.range) then
  415.                 CastR(Cel)
  416.             end
  417.         end
  418.         if MenuAhri.comboConfig.USEE then
  419.             if EReady and ValidTarget(Cel, E.range - 30) then
  420.                 CastE(Cel)
  421.             end
  422.         end
  423.         if MenuAhri.comboConfig.USEW then
  424.             if WReady and ValidTarget(Cel, W.range) then
  425.                 CastW()
  426.             end
  427.         end
  428.         if MenuAhri.comboConfig.USEQ and not MenuAhri.comboConfig.USEQ2 then
  429.             if QReady and ValidTarget(Cel, Q.range - 30) then
  430.                 CastQ(Cel)
  431.             end
  432.         end
  433.         if MenuAhri.comboConfig.USEQ and MenuAhri.comboConfig.USEQ2 then
  434.             if QReady and ValidTarget(Cel, Q.range - 30) and TargetHaveBuff("AhriSeduce", Cel) then
  435.                 CastQ(Cel)
  436.             end
  437.         end
  438.     end
  439. end
  440.  
  441. function Harrass()
  442.     if Cel == nil then
  443.         _OrbWalk(Lasthit())
  444.     end
  445.     if Cel ~= nil then
  446.         _OrbWalk(Cel)
  447.         if MenuAhri.harrasConfig.QH then
  448.             if QReady and ValidTarget(Cel, Q.range - 30) then
  449.                 CastQ(Cel)
  450.             end
  451.         end
  452.         if MenuAhri.harrasConfig.WH then
  453.             if WReady and ValidTarget(Cel, W.range) then
  454.                 CastW()
  455.             end
  456.         end
  457.         if MenuAhri.harrasConfig.EH then
  458.             if WReady and ValidTarget(Cel, E.range - 30) then
  459.                 CastE(Cel)
  460.             end
  461.         end
  462.     end
  463. end
  464.  
  465. function Lasthit()
  466.     EnemyMinions:update()
  467.     for _, minion in pairs(EnemyMinions.objects) do
  468.         if minion and ValidTarget(minion, myHero.range + VP:GetHitBox(myHero)) then
  469.             local aa = getDmg("AD",minion, myHero)
  470.             if minion.health <= aa then
  471.                 tar = minion
  472.             end
  473.         end
  474.     end
  475.     return tar
  476. end
  477.  
  478. function Farm()
  479.     EnemyMinions:update()
  480.     QMode =  MenuAhri.farm.QF
  481.     WMode =  MenuAhri.farm.WF
  482.     _OrbWalk()
  483.     for i, minion in pairs(EnemyMinions.objects) do
  484.         _OrbWalk(minion)
  485.         if QMode == 3 then
  486.             if QReady and minion ~= nil and not minion.dead and ValidTarget(minion, Q.range) then
  487.                 local Pos, Hit = BestQFarmPos(Q.range, Q.width, EnemyMinions.objects)
  488.                 if Pos ~= nil then     
  489.                     CastSpell(_Q, Pos.x, Pos.z)
  490.                 end
  491.             end
  492.         elseif QMode == 2 then
  493.             if QReady and minion ~= nil and not minion.dead and ValidTarget(minion, Q.range) then
  494.                 if minion.health <= getDmg("Q", minion, myHero, 1) then
  495.                     CastSpell(_Q, minion.x, minion.z)
  496.                 end
  497.             end
  498.         end
  499.         if WMode == 3 then
  500.             if WReady and minion ~= nil and not minion.dead and ValidTarget(minion, W.range) then
  501.                 CastW()
  502.             end
  503.         elseif WMode == 2 then
  504.             if WReady and minion ~= nil and not minion.dead and ValidTarget(minion, W.range) then
  505.                 if minion.health <= getDmg("W", minion, myHero, 3) then
  506.                     CastW()
  507.                 end
  508.             end
  509.         end
  510.     end
  511. end
  512.  
  513. function BestQFarmPos(range, width, objects)
  514.     local BestPos
  515.     local BestHit = 0
  516.     for i, object in ipairs(objects) do
  517.         local EndPos = Vector(myHero.visionPos) + range * (Vector(object) - Vector(myHero.visionPos)):normalized()
  518.         local hit = CountObjectsOnLineSegment(myHero.visionPos, EndPos, width, objects)
  519.         if hit > BestHit then
  520.             BestHit = hit
  521.             BestPos = Vector(object)
  522.             if BestHit == #objects then
  523.                break
  524.             end
  525.          end
  526.     end
  527.     return BestPos, BestHit
  528. end
  529.  
  530. function CountObjectsOnLineSegment(StartPos, EndPos, width, objects)
  531.     local n = 0
  532.     for i, object in ipairs(objects) do
  533.         local pointSegment, pointLine, isOnSegment = VectorPointProjectionOnLineSegment(StartPos, EndPos, object)
  534.         if isOnSegment and GetDistanceSqr(pointSegment, object) < width * width then
  535.             n = n + 1
  536.         end
  537.     end
  538.     return n
  539. end
  540.  
  541. function JungleFarmm()
  542.     JungleMinions:update()
  543.     _OrbWalk()
  544.     for i, minion in pairs(JungleMinions.objects) do
  545.         _OrbWalk(minion)
  546.         if MenuAhri.jf.QJF then
  547.             if QReady and minion ~= nil and not minion.dead and ValidTarget(minion, Q.range) then
  548.                 local Pos, Hit = BestQFarmPos(Q.range, Q.width, EnemyMinions.objects)
  549.                 if Pos ~= nil then     
  550.                     CastSpell(_Q, Pos.x, Pos.z)
  551.                 end
  552.             end
  553.         end
  554.         if MenuAhri.jf.WJF then
  555.             if WReady and minion ~= nil and not minion.dead and ValidTarget(minion, W.range) then
  556.                 CastW()
  557.             end
  558.         end
  559.     end
  560. end
  561.  
  562. function autozh()
  563.     local count = EnemyCount(myHero, MenuAhri.prConfig.AZMR)
  564.     if zhonyaready and ((myHero.health/myHero.maxHealth)*100) < MenuAhri.prConfig.AZHP and count == 0 then
  565.         CastSpell(zhonyaslot)
  566.     end
  567. end
  568.  
  569. function autolvl()
  570.     if not MenuAhri.prConfig.ALS then return end
  571.     if myHero.level > abilitylvl then
  572.         abilitylvl = abilitylvl + 1
  573.         if MenuAhri.prConfig.AL == 1 then          
  574.             LevelSpell(_R)
  575.             LevelSpell(_Q)
  576.             LevelSpell(_W)
  577.             LevelSpell(_E)
  578.         end
  579.         if MenuAhri.prConfig.AL == 2 then  
  580.             LevelSpell(_R)
  581.             LevelSpell(_Q)
  582.             LevelSpell(_E)
  583.             LevelSpell(_W)
  584.         end
  585.         if MenuAhri.prConfig.AL == 3 then  
  586.             LevelSpell(_R)
  587.             LevelSpell(_W)
  588.             LevelSpell(_Q)
  589.             LevelSpell(_E)
  590.         end
  591.         if MenuAhri.prConfig.AL == 4 then  
  592.             LevelSpell(_R)
  593.             LevelSpell(_W)
  594.             LevelSpell(_E)
  595.             LevelSpell(_Q)
  596.         end
  597.         if MenuAhri.prConfig.AL == 5 then  
  598.             LevelSpell(_R)
  599.             LevelSpell(_E)
  600.             LevelSpell(_Q)
  601.             LevelSpell(_W)
  602.         end
  603.         if MenuAhri.prConfig.AL == 6 then  
  604.             LevelSpell(_R)
  605.             LevelSpell(_E)
  606.             LevelSpell(_W)
  607.             LevelSpell(_Q)
  608.         end
  609.     end
  610. end
  611.  
  612. function OnDraw()
  613.     if MenuAhri.drawConfig.DD then 
  614.         DmgCalc()
  615.         for _,enemy in pairs(GetEnemyHeroes()) do
  616.             if ValidTarget(enemy) and killstring[enemy.networkID] ~= nil then
  617.                 local pos = WorldToScreen(D3DXVECTOR3(enemy.x, enemy.y, enemy.z))
  618.                 DrawText(killstring[enemy.networkID], 20, pos.x - 35, pos.y - 10, 0xFFFFFF00)
  619.             end
  620.         end
  621.     end
  622.     if MenuAhri.drawConfig.DQR and QReady then
  623.         DrawCircle(myHero.x, myHero.y, myHero.z, Q.range, RGB(MenuAhri.drawConfig.DQRC[2], MenuAhri.drawConfig.DQRC[3], MenuAhri.drawConfig.DQRC[4]))
  624.     end
  625.     if MenuAhri.drawConfig.DWR and WReady then
  626.         DrawCircle(myHero.x, myHero.y, myHero.z, W.range, RGB(MenuAhri.drawConfig.DWRC[2], MenuAhri.drawConfig.DWRC[3], MenuAhri.drawConfig.DWRC[4]))
  627.     end
  628.     if MenuAhri.drawConfig.DER and EReady then         
  629.         DrawCircle(myHero.x, myHero.y, myHero.z, E.range, RGB(MenuAhri.drawConfig.DERC[2], MenuAhri.drawConfig.DERC[3], MenuAhri.drawConfig.DERC[4]))
  630.     end
  631.     if MenuAhri.drawConfig.DRR and RReady then         
  632.         DrawCircle(myHero.x, myHero.y, myHero.z, R.range, RGB(MenuAhri.drawConfig.DRRC[2], MenuAhri.drawConfig.DRRC[3], MenuAhri.drawConfig.DRRC[4]))
  633.     end
  634. end
  635.  
  636. function KillSteall()
  637.     for _, Enemy in pairs(GetEnemyHeroes()) do
  638.         local health = Enemy.health
  639.         local qDmg = getDmg("Q", Enemy, myHero, 1)
  640.         local wDmg = getDmg("W", Enemy, myHero, 3)
  641.         local eDmg = getDmg("E", Enemy, myHero, 1)
  642.         local rDmg = getDmg("R", Enemy, myHero, 1)
  643.         local iDmg = getDmg("IGNITE", Enemy, myHero)
  644.         if Enemy ~= nil and Enemy.team ~= player.team and not Enemy.dead and Enemy.visible then
  645.             if health <= qDmg and QReady and ValidTarget(Enemy, Q.range - 30) and MenuAhri.ksConfig.QKS then
  646.                 CastQ(Enemy)
  647.             elseif health <= wDmg and WReady and ValidTarget(Enemy, W.range) and MenuAhri.ksConfig.WKS then
  648.                 CastW()
  649.             elseif health <= eDmg and EReady and ValidTarget(Enemy, E.range - 30) and MenuAhri.ksConfig.EKS then
  650.                 CastE(Enemy)
  651.             elseif health <= rDmg and RReady and ValidTarget(Enemy, R.range) and MenuAhri.ksConfig.RKS then
  652.                 CastR(Enemy)
  653.             elseif health <= (qDmg + wDmg) and QReady and WReady and ValidTarget(Enemy, W.range) and MenuAhri.ksConfig.QKS and MenuAhri.ksConfig.WKS then
  654.                 CastQ(Enemy)
  655.                 CastW()
  656.             elseif health <= (qDmg + eDmg) and QReady and EReady and ValidTarget(Enemy, Q.range - 30) and MenuAhri.ksConfig.QKS and MenuAhri.ksConfig.EKS then
  657.                 CastQ(Enemy)
  658.                 CastE(Enemy)
  659.             elseif health <= (qDmg + rDmg) and QReady and RReady and ValidTarget(Enemy, R.range) and MenuAhri.ksConfig.QKS and MenuAhri.ksConfig.RKS then
  660.                 CastQ(Enemy)
  661.                 CastR(Enemy)
  662.             elseif health <= (wDmg + eDmg) and WReady and EReady and ValidTarget(Enemy, W.range) and MenuAhri.ksConfig.WKS and MenuAhri.ksConfig.EKS then
  663.                 CastW()
  664.                 CastE(Enemy)
  665.             elseif health <= (wDmg + rDmg) and WReady and RReady and ValidTarget(Enemy, W.range) and MenuAhri.ksConfig.WKS and MenuAhri.ksConfig.RKS then
  666.                 CastW()
  667.                 CastR(Enemy)
  668.             elseif health <= (qDmg + wDmg + eDmg + rDmg) and QReady and WReady and EReady and RReady and ValidTarget(Enemy, Q.range - 30) and MenuAhri.ksConfig.QKS and MenuAhri.ksConfig.WKS and MenuAhri.ksConfig.EKS and MenuAhri.ksConfig.RKS then
  669.                 CastQ(Enemy)
  670.                 CastW()
  671.                 CastE(Enemy)
  672.                 CastR(Enemy)
  673.             end
  674.             if IReady and health <= iDmg and MenuAhri.ksConfig.IKS and ValidTarget(Enemy, 600) then
  675.                 CastSpell(IgniteKey, Enemy)
  676.             end
  677.         end
  678.     end
  679. end
  680.  
  681. function DmgCalc()
  682.     for _, enemy in pairs(GetEnemyHeroes()) do
  683.         if not enemy.dead and enemy.visible and GetDistance(enemy) < 3000 then
  684.             local qDmg = getDmg("Q", enemy, myHero, 1)
  685.             local wDmg = getDmg("W", enemy, myHero, 3)
  686.             local eDmg = getDmg("E", enemy, myHero, 1)
  687.             local rDmg = getDmg("R", enemy, myHero, 1)
  688.             if enemy.health > (qDmg + wDmg + rDmg) then
  689.                 killstring[enemy.networkID] = "Harass Him!!!"
  690.             elseif enemy.health < qDmg then
  691.                 killstring[enemy.networkID] = "Q Kill!"
  692.             elseif enemy.health < wDmg then
  693.                 killstring[enemy.networkID] = "W Kill!"
  694.             elseif enemy.health < eDmg then
  695.                 killstring[enemy.networkID] = "E Kill!"
  696.             elseif enemy.health < rDmg then
  697.                 killstring[enemy.networkID] = "R Kill!"
  698.             elseif enemy.health < (qDmg + wDmg) then
  699.                 killstring[enemy.networkID] = "Q+W Kill!"
  700.             elseif enemy.health < (qDmg + eDmg) then
  701.                 killstring[enemy.networkID] = "Q+E Kill!"
  702.             elseif enemy.health < (qDmg + rDmg) then
  703.                 killstring[enemy.networkID] = "Q+R Kill!"  
  704.             elseif enemy.health < (wDmg + eDmg) then
  705.                 killstring[enemy.networkID] = "W+E Kill!"  
  706.             elseif enemy.health < (wDmg + rDmg) then
  707.                 killstring[enemy.networkID] = "W+R Kill!"  
  708.             elseif enemy.health < (qDmg + wDmg + eDmg + rDmg) then
  709.                 killstring[enemy.networkID] = "Q+W+E+R Kill!"  
  710.             end
  711.         end
  712.     end
  713. end
  714.  
  715. function CastQ(unit)
  716.     if MenuAhri.prConfig.pro == 1 then
  717.         local castPosition,  HitChance,  Position = VP:GetLineCastPosition(unit, Q.delay, Q.width, Q.range - 30, Q.speed, myHero, false)
  718.         if HitChance >= MenuAhri.prConfig.vphit - 1 then
  719.             if VIP_USER and MenuAhri.prConfig.pc then
  720.                 Packet("S_CAST", {spellId = _Q, fromX = castPosition.x, fromY = castPosition.z, toX = castPosition.x, toY = castPosition.z}):send()
  721.             else
  722.                 CastSpell(_Q, castPosition.x, castPosition.z)
  723.             end
  724.         end
  725.     end
  726.     if MenuAhri.prConfig.pro == 2 and VIP_USER and prodstatus then
  727.         local Position, info = Prodiction.GetLineAOEPrediction(unit, Q.range - 30, Q.speed, Q.delay, Q.width)
  728.         if Position ~= nil then
  729.             if VIP_USER and MenuAhri.prConfig.pc then
  730.                 Packet("S_CAST", {spellId = _Q, fromX = Position.x, fromY = Position.z, toX = Position.x, toY = Position.z}):send()
  731.             else
  732.                 CastSpell(_Q, Position.x, Position.z)
  733.             end
  734.         end
  735.     end
  736. end
  737.  
  738. function CastW()
  739.     if VIP_USER and MenuAhri.prConfig.pc then
  740.         Packet("S_CAST", {spellId = _W}):send()
  741.     else
  742.         CastSpell(_W)
  743.     end
  744. end
  745.  
  746. function CastE(unit)
  747.     if MenuAhri.prConfig.pro == 1 then
  748.         local castPosition,  HitChance,  Position = VP:GetLineCastPosition(unit, E.delay, E.width, E.range - 30, E.speed, myHero, true)
  749.         if HitChance >= MenuAhri.prConfig.vphit - 1 then
  750.             if VIP_USER and MenuAhri.prConfig.pc then
  751.                 Packet("S_CAST", {spellId = _E, fromX = castPosition.x, fromY = castPosition.z, toX = castPosition.x, toY = castPosition.z}):send()
  752.             else
  753.                 CastSpell(_E, castPosition.x, castPosition.z)
  754.             end
  755.         end
  756.     end
  757.     if MenuAhri.prConfig.pro == 2 and VIP_USER and prodstatus then
  758.         local Position, info = Prodiction.GetLineAOEPrediction(unit, E.range - 30, E.speed, E.delay, E.width)
  759.         if Position ~= nil and not info.mCollision() then
  760.             if VIP_USER and MenuAhri.prConfig.pc then
  761.                 Packet("S_CAST", {spellId = _E, fromX = Position.x, fromY = Position.z, toX = Position.x, toY = Position.z}):send()
  762.             else
  763.                 CastSpell(_E, Position.x, Position.z)
  764.             end
  765.         end
  766.     end
  767. end
  768.  
  769. function CastR(unit)
  770.     if MenuAhri.comboConfig.RM == 1 then
  771.         pos = Vector(myHero) + 400 * (Vector(mousePos) - Vector(myHero)):normalized()
  772.     elseif MenuAhri.comboConfig.RM == 2 then
  773.         pos = unit
  774.     end
  775.     if VIP_USER and MenuAhri.prConfig.pc then
  776.         Packet("S_CAST", {spellId = _R, fromX = pos.x, fromY = pos.z, toX = pos.x, toY = pos.z}):send()
  777.     else
  778.         CastSpell(_R, pos.x, pos.z)
  779.     end
  780. end
  781.  
  782. function OnGainBuff(unit, buff)
  783.     if unit.isMe and (buff.name == "recallimproved") then
  784.         recall = true
  785.     end
  786. end
  787.  
  788. function OnLoseBuff(unit, buff)
  789.     if unit.isMe and (buff.name == "recallimproved") then
  790.         recall = false
  791.     end
  792. end
  793.  
  794. function GenModelPacket(champ, skinId)
  795.     p = CLoLPacket(0x97)
  796.     p:EncodeF(myHero.networkID)
  797.     p.pos = 1
  798.     t1 = p:Decode1()
  799.     t2 = p:Decode1()
  800.     t3 = p:Decode1()
  801.     t4 = p:Decode1()
  802.     p:Encode1(t1)
  803.     p:Encode1(t2)
  804.     p:Encode1(t3)
  805.     p:Encode1(bit32.band(t4,0xB))
  806.     p:Encode1(1)--hardcode 1 bitfield
  807.     p:Encode4(skinId)
  808.     for i = 1, #champ do
  809.         p:Encode1(string.byte(champ:sub(i,i)))
  810.     end
  811.     for i = #champ + 1, 64 do
  812.         p:Encode1(0)
  813.     end
  814.     p:Hide()
  815.     RecvPacket(p)
  816. end
  817.  
  818. function OnWndMsg(Msg, Key)
  819.     if Msg == WM_LBUTTONDOWN then
  820.         local dist = 0
  821.         local Selecttarget = nil
  822.         for i, enemy in ipairs(GetEnemyHeroes()) do
  823.             if ValidTarget(enemy) then
  824.                 if GetDistance(enemy, mousePos) <= dist or Selecttarget == nil then
  825.                     dist = GetDistance(enemy, mousePos)
  826.                     Selecttarget = enemy
  827.                 end
  828.             end
  829.         end
  830.         if Selecttarget and dist < 300 then
  831.             if SelectedTarget and Selecttarget.charName == SelectedTarget.charName then
  832.                 SelectedTarget = nil
  833.                 if MenuAhri.comboConfig.ST then
  834.                     print("Target unselected: "..Selecttarget.charName)
  835.                 end
  836.             else
  837.                 SelectedTarget = Selecttarget
  838.                 if MenuAhri.comboConfig.ST then
  839.                     print("New target selected: "..Selecttarget.charName)
  840.                 end
  841.             end
  842.         end
  843.     end
  844. end
  845.  
  846. function SetPriority(table, hero, priority)
  847.     for i=1, #table, 1 do
  848.         if hero.charName:find(table[i]) ~= nil then
  849.             TS_SetHeroPriority(priority, hero.charName)
  850.         end
  851.     end
  852. end
  853.  
  854. function arrangePrioritysTT()
  855.     for i, enemy in ipairs(GetEnemyHeroes()) do
  856.         SetPriority(TargetTable.AD_Carry, enemy, 1)
  857.         SetPriority(TargetTable.AP,       enemy, 1)
  858.         SetPriority(TargetTable.Support,  enemy, 2)
  859.         SetPriority(TargetTable.Bruiser,  enemy, 2)
  860.         SetPriority(TargetTable.Tank,     enemy, 3)
  861.     end
  862. end
  863.  
  864. function arrangePrioritys()
  865.     for i, enemy in ipairs(GetEnemyHeroes()) do
  866.         SetPriority(TargetTable.AD_Carry, enemy, 1)
  867.         SetPriority(TargetTable.AP, enemy, 2)
  868.         SetPriority(TargetTable.Support, enemy, 3)
  869.         SetPriority(TargetTable.Bruiser, enemy, 4)
  870.         SetPriority(TargetTable.Tank, enemy, 5)
  871.     end
  872. end
  873.  
  874. function DrawCircleNextLvl(x, y, z, radius, width, color, chordlength)
  875.   radius = radius or 300
  876.   quality = math.max(8,round(180/math.deg((math.asin((chordlength/(2*radius)))))))
  877.   quality = 2 * math.pi / quality
  878.   radius = radius*.92
  879.  
  880.   local points = {}
  881.   for theta = 0, 2 * math.pi + quality, quality do
  882.     local c = WorldToScreen(D3DXVECTOR3(x + radius * math.cos(theta), y, z - radius * math.sin(theta)))
  883.     points[#points + 1] = D3DXVECTOR2(c.x, c.y)
  884.   end
  885.  
  886.   DrawLines2(points, width or 1, color or 4294967295)
  887. end
  888.  
  889. function round(num)
  890.   if num >= 0 then return math.floor(num+.5) else return math.ceil(num-.5) end
  891. end
  892.  
  893. function DrawCircle2(x, y, z, radius, color)
  894.   local vPos1 = Vector(x, y, z)
  895.   local vPos2 = Vector(cameraPos.x, cameraPos.y, cameraPos.z)
  896.   local tPos = vPos1 - (vPos1 - vPos2):normalized() * radius
  897.   local sPos = WorldToScreen(D3DXVECTOR3(tPos.x, tPos.y, tPos.z))
  898.  
  899.   if OnScreen({ x = sPos.x, y = sPos.y }, { x = sPos.x, y = sPos.y }) then
  900.     DrawCircleNextLvl(x, y, z, radius, 1, color, 75)
  901.   end
  902. end
  903.  
  904. function OnProcessSpell(unit, spell)
  905.     if unit.isMe then
  906.         if (spell.name:lower():find("attack")) then
  907.             BaseAnimationTime = 1 / (spell.animationTime * myHero.attackSpeed)
  908.             BaseWindupTime = 1 / (spell.windUpTime * myHero.attackSpeed)
  909.             LastAttack = os.clock() - (GetLatency()/4000)
  910.         end
  911.     end
  912.     if MenuAhri.exConfig.UI and EReady then
  913.         for _, x in pairs(InterruptList) do
  914.             if unit and unit.team ~= myHero.team and unit.type == myHero.type and spell then
  915.                 if spell.name == x.spellName and MenuAhri.exConfig.ES[x.spellName] and ValidTarget(unit, E.range - 30) then
  916.                     CastE(unit)
  917.                 end
  918.             end
  919.         end
  920.     end
  921.     if MenuAhri.exConfig.UG and EReady then
  922.         for _, x in pairs(GapCloserList) do
  923.             if unit and unit.team ~= myHero.team and unit.type == myHero.type and spell then
  924.                 if spell.name == x.spellName and MenuAhri.exConfig.ES2[x.spellName] and ValidTarget(unit, E.range - 30) then
  925.                     if spell.target and spell.target.isMe then
  926.                         CastE(unit)
  927.                     elseif not spell.target then
  928.                         local endPos1 = Vector(unit.visionPos) + 300 * (Vector(spell.endPos) - Vector(unit.visionPos)):normalized()
  929.                         local endPos2 = Vector(unit.visionPos) + 100 * (Vector(spell.endPos) - Vector(unit.visionPos)):normalized()
  930.                         if (GetDistanceSqr(myHero.visionPos, unit.visionPos) > GetDistanceSqr(myHero.visionPos, endPos1) or GetDistanceSqr(myHero.visionPos, unit.visionPos) > GetDistanceSqr(myHero.visionPos, endPos2))  then
  931.                             CastE(unit)
  932.                         end
  933.                     end
  934.                 end
  935.             end
  936.         end
  937.     end
  938. end
  939.  
  940. function _OrbWalk(target)
  941.     if aa and CanAA() and ValidTarget(target, myHero.range + VP:GetHitBox(myHero)) then
  942.         LastAttack = os.clock() + (GetLatency()/4000)
  943.         myHero:Attack(target)
  944.     elseif CanMove() then
  945.         MouseMove = Vector(myHero) + (Vector(mousePos) - Vector(myHero)):normalized() * 500
  946.         myHero:MoveTo(MouseMove.x, MouseMove.z)
  947.     end
  948. end
  949.  
  950. function DisableAA()
  951.     aa = false
  952. end
  953.  
  954. function EnableAA()
  955.     aa = true
  956. end
  957.  
  958. function CanAA()
  959.     if LastAttack <= os.clock() then
  960.         return (os.clock() + (GetLatency()/4000) > LastAttack + AnimationTime())
  961.     else
  962.         return false
  963.     end
  964. end
  965.  
  966. function CanMove()
  967.     if LastAttack <= os.clock() then
  968.         return (os.clock() + (GetLatency()/4000) > LastAttack + WindUpTime())
  969.     end
  970. end
  971.  
  972. function WindUpTime(exact)
  973.     return (1 / (myHero.attackSpeed * BaseWindupTime)) + (exact and 0 or 50 / 1000)
  974. end
  975.  
  976. function AnimationTime()
  977.     return 1 / (myHero.attackSpeed * BaseAnimationTime)
  978. end
Advertisement
Add Comment
Please, Sign In to add comment