AnonymousBOL

aEvelynn v1.1 ( REVAMPED )

Oct 30th, 2013
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.83 KB | None | 0 0
  1. --
  2. --              aEvelynn by Anonymous v1.1
  3. --              Version for SAC: Revamped
  4. --
  5.  
  6. require 'AoE_Skillshot_Position'
  7. if myHero.charName ~= "Evelynn" then return end
  8.  
  9. local Target
  10. local UltByScript = false
  11. local Enemies = AutoCarry.EnemyTable
  12.  
  13. function PluginOnLoad()
  14.     AutoCarry.SkillsCrosshair.range = 800
  15. end
  16.  
  17. function PluginOnTick()
  18.     Target = AutoCarry.GetAttackTarget()
  19.     if AutoCarry.PluginMenu.spamQE then
  20.         if Target ~= nil and AutoCarry.MainMenu.AutoCarry then
  21.             local CanQ = (myHero:CanUseSpell(_Q) == READY and GetDistance(Target, myHero) < 500)
  22.             local CanE = (myHero:CanUseSpell(_E) == READY and GetDistance(Target, myHero) < 225)
  23.             if CanQ then CastSpell(_Q) end
  24.             if CanE then CastSpell(_E, Target) end
  25.         end
  26.     end
  27.     if AutoCarry.PluginMenu.spamQ then
  28.         if AutoCarry.MainMenu.LaneClear and myHero.mana/myHero.maxMana*100 >= AutoCarry.PluginMenu.autoMinMana then
  29.             local CanQ = (myHero:CanUseSpell(_Q) == READY)
  30.             if CanQ then CastSpell(_Q) end
  31.         end
  32.     end
  33.     if AutoCarry.PluginMenu.spamE then
  34.         if AutoCarry.MainMenu.LaneClear and myHero.mana/myHero.maxMana*100 >= AutoCarry.PluginMenu.autoMinMana then
  35.             local JunngleTarget = AutoCarry.GetMinionTarget()
  36.             if JunngleTarget ~= nil then
  37.                 local CanE = (myHero:CanUseSpell(_E) == READY and GetDistance(JunngleTarget, myHero) < 225)
  38.                 if CanE then CastSpell(_E, JunngleTarget) end
  39.             end
  40.         end
  41.     end
  42.     if AutoCarry.PluginMenu.burstTarget then
  43.         if Target ~= nil then
  44.             local CanQ = (myHero:CanUseSpell(_Q) == READY and GetDistance(Target, myHero) < 500)
  45.             local CanE = (myHero:CanUseSpell(_E) == READY and GetDistance(Target, myHero) < 325)
  46.             local CanR = (myHero:CanUseSpell(_R) == READY and GetDistance(Target, myHero) < 800)
  47.             --AutoCarry.Items:UseAll(Target)
  48.             CastItem(3128, Target)
  49.             if CanR then
  50.                 if VIP_USER then
  51.                     if AutoCarry.PluginMenu.autoUltaiming then
  52.                         CastSpell(_R, Target.x, Target.z)
  53.                     else
  54.                         local spellPos = GetAoESpellPosition(250, Target)
  55.                         CastSpell(_R, spellPos.x, spellPos.z)
  56.                     end
  57.                 else
  58.                     local spellPos = GetAoESpellPosition(250, Target)
  59.                     CastSpell(_R, spellPos.x, spellPos.z)
  60.                     --PrintChat("NonVIPCast")
  61.                 end
  62.             end -- Packets will target it better anyway :p
  63.             if CanE then CastSpell(_E, Target) end
  64.             if CanQ then CastSpell(_Q) end
  65.             if not AutoCarry.MainMenu.AutoCarry then myHero:Attack(Target) end
  66.         end
  67.     end
  68. end
  69.  
  70. function PluginOnDraw()
  71.     if myHero ~= nil and not myHero.dead and AutoCarry.PluginMenu.drawQrange then if AutoCarry.PluginMenu.drawPoly then DrawCircle2(myHero.x, myHero.y, myHero.z, 500, 0xFF80FF00) else DrawCircle(myHero.x, myHero.y, myHero.z, 500, 0xFF80FF00) end end
  72.     if myHero ~= nil and not myHero.dead and AutoCarry.PluginMenu.drawErange then if AutoCarry.PluginMenu.drawPoly then DrawCircle2(myHero.x, myHero.y, myHero.z, 225, 0xFF80FF00) else DrawCircle(myHero.x, myHero.y, myHero.z, 225, 0xFF80FF00) end end
  73.     if myHero ~= nil and not myHero.dead and AutoCarry.PluginMenu.drawRrange and myHero:CanUseSpell(_R) == READY then if AutoCarry.PluginMenu.drawPoly then DrawCircle2(myHero.x, myHero.y, myHero.z, 800, 0xFF80FF00) else DrawCircle(myHero.x, myHero.y, myHero.z, 800, 0xFF80FF00) end end
  74.     if AutoCarry.PluginMenu.drawRmec then -- Test MEC IT Draws where ultimate will be casted :) You can uncomment it, and it will work.
  75.         local ClosestEnemy = nil
  76.         local Position1 = { x=mousePos.x, y=mousePos.y, z=mousePos.z }
  77.         for i, Enemy in pairs(Enemies) do
  78.             if Enemy ~= nil and not Enemy.dead and Enemy.visible then
  79.                 if ClosestEnemy ~= nil then
  80.                     if GetDistance(Enemy, Position1) < GetDistance(ClosestEnemy, Position1) then
  81.                         ClosestEnemy = Enemy
  82.                     end
  83.                 else
  84.                     ClosestEnemy = Enemy
  85.                 end
  86.             end
  87.         end
  88.         local UltTargetted = ClosestEnemy
  89.         if UltTargetted ~= nil and GetDistance(UltTargetted, CastPosition) < 300 then
  90.             UltTarget = UltTargetted
  91.         else
  92.             UltTarget = AutoCarry.GetAttackTarget()
  93.         end
  94.         if UltTarget ~= nil then
  95.             local ValidEnemies = 0
  96.             for i, Enemy in pairs(Enemies) do
  97.                 if Enemy ~= nil and not Enemy.dead and Enemy.visible and GetDistance(Enemy, myHero) < 1050 then ValidEnemies = ValidEnemies + 1 end
  98.             end
  99.             if ValidEnemies > 1 then
  100.                 local spellPos = GetAoESpellPosition(250, UltTarget)
  101.                 if AutoCarry.PluginMenu.drawPoly then DrawCircle2(spellPos.x, spellPos.y, spellPos.z, 250, 0xFF80FF00) else DrawCircle(spellPos.x, spellPos.y, spellPos.z, 250, 0xFF80FF00) end
  102.             else
  103.                 if AutoCarry.PluginMenu.drawPoly then DrawCircle2(UltTarget.x, UltTarget.y, UltTarget.z, 250, 0xFF80FF00) else DrawCircle(UltTarget.x, UltTarget.y, UltTarget.z, 250, 0xFF80FF00) end
  104.             end
  105.         end
  106.     end
  107.     if myHero ~= nil and not myHero.dead and AutoCarry.PluginMenu.drawText then
  108.         for i, Enemy in pairs(Enemies) do
  109.             if ValidTarget(Enemy) then
  110.                 local TotalDMG = 0
  111.                 local CanDFG = GetInventoryItemIsCastable(3128)
  112.                 local CanQ = (myHero:CanUseSpell(_Q) == READY and GetDistance(Enemy, myHero) < 500)
  113.                 local CanE = (myHero:CanUseSpell(_E) == READY and GetDistance(Enemy, myHero) < 325)
  114.                 local CanR = (myHero:CanUseSpell(_R) == READY and GetDistance(Enemy, myHero) < 800)
  115.                 if CanR then TotalDMG = TotalDMG + getDmg("R", Enemy, myHero) end
  116.                 if CanE then TotalDMG = TotalDMG + getDmg("E", Enemy, myHero) end
  117.                 if CanQ then TotalDMG = TotalDMG + getDmg("Q", Enemy, myHero) end
  118.                 if CanDFG then
  119.                     TotalDMG = TotalDMG * 0.2
  120.                     TotalDMG = TotalDMG + getDmg("DFG", Enemy, myHero)
  121.                 end
  122.                 TotalDMG = TotalDMG + getDmg("AD", Enemy, myHero)
  123.                 if TotalDMG >= Enemy.health then
  124.                     PrintFloatText(Enemy, 0, "Killable")
  125.                 else
  126.                     local HPafter = round(Enemy.health - TotalDMG, 1)
  127.                     PrintFloatText(Enemy, 0, "HP: "..HPafter)
  128.                 end
  129.             end
  130.         end
  131.     end
  132. end
  133.  
  134. function round(num, idp)
  135.   return tonumber(string.format("%." .. (idp or 0) .. "f", num))
  136. end
  137.  
  138. function PluginOnSendPacket(p)
  139.     local packet = Packet(p)
  140.     if packet:get('name') == 'S_CAST' then
  141.         local SpellID = packet:get('spellId')
  142.         if SpellID == SPELL_4 then
  143.             PrintChat("ULTING")
  144.             local CastPosition = { x = packet:get('toX'), y = packet:get('toY'), z = packet:get('toY') }
  145.             if AutoCarry.PluginMenu.blockR then
  146.                 local ValidTargets = 0
  147.                 for i, Enemy in pairs(Enemies) do
  148.                     if Enemy ~= nil and not Enemy.dead and Enemy.visible and GetDistance(Enemy, CastPosition) < 250 then ValidTargets = ValidTargets + 1 end
  149.                 end
  150.                 if ValidTargets == 0 then p:Block() PrintChat("BLOCKING") end
  151.             end
  152.             if AutoCarry.PluginMenu.autoUltaiming then
  153.                 if UltByScript == true then
  154.                     UltByScript = false
  155.                 elseif UltByScript == false then
  156.                     p:Block()
  157.                     UltByScript = true
  158.                     local ClosestEnemy = nil
  159.                     local Position1 = { x=CastPosition.x, y=CastPosition.y, z=CastPosition.z }
  160.                     for i, Enemy in pairs(Enemies) do
  161.                         if Enemy ~= nil and not Enemy.dead and Enemy.visible then
  162.                             if ClosestEnemy ~= nil then
  163.                                 if GetDistance(Enemy, Position1) < GetDistance(ClosestEnemy, Position1) then
  164.                                     ClosestEnemy = Enemy
  165.                                 end
  166.                             else
  167.                                 ClosestEnemy = Enemy
  168.                             end
  169.                         end
  170.                     end
  171.                     local UltTargetted = ClosestEnemy
  172.                     if UltTargetted ~= nil and GetDistance(UltTargetted, CastPosition) < 300 then
  173.                         UltTarget = UltTargetted
  174.                     else
  175.                         UltTarget = AutoCarry.GetAttackTarget()
  176.                     end
  177.                     if UltTarget ~= nil then
  178.                         local ValidEnemies = 0
  179.                         for i, Enemy in pairs(Enemies) do
  180.                             if Enemy ~= nil and not Enemy.dead and Enemy.visible and GetDistance(Enemy, myHero) < 1050 then ValidEnemies = ValidEnemies + 1 end
  181.                         end
  182.                         if ValidEnemies > 1 then
  183.                             local spellPos = GetAoESpellPosition(250, UltTarget)
  184.                             CastSpell(_R, spellPos.x, spellPos.z)
  185.                         else
  186.                             CastSpell(_R, UltTarget.x, UltTarget.z)
  187.                         end
  188.                     end
  189.                 end
  190.             end
  191.         end
  192.     end
  193. end
  194.  
  195. AutoCarry.PluginMenu:addParam("Information1", "  aEvelynn v1.1 by Anonymous", SCRIPT_PARAM_INFO, "")
  196. AutoCarry.PluginMenu:addParam("Information2", "== Helper-Settings: ==", SCRIPT_PARAM_INFO, "")
  197. AutoCarry.PluginMenu:addParam("burstTarget", "Full Combo", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("A"))
  198. AutoCarry.PluginMenu:addParam("spamQE","Use QE in AutoCarry mode", SCRIPT_PARAM_ONOFF, true)
  199. AutoCarry.PluginMenu:addParam("spamQ","Use Q in LaneClear mode", SCRIPT_PARAM_ONOFF, true)
  200. AutoCarry.PluginMenu:addParam("spamE","Use E in LaneClear mode", SCRIPT_PARAM_ONOFF, true)
  201. AutoCarry.PluginMenu:addParam("autoMinMana","Minimum % mana (LaneClear)", SCRIPT_PARAM_SLICE, 35, 0, 100, 0)
  202. AutoCarry.PluginMenu:addParam("Information4", "VIP only functions:", SCRIPT_PARAM_INFO, "")
  203. AutoCarry.PluginMenu:addParam("blockR","Block wrong ult", SCRIPT_PARAM_ONOFF, true)
  204. AutoCarry.PluginMenu:addParam("autoUltaiming","Automaticly aim with ult", SCRIPT_PARAM_ONOFF, true)
  205. AutoCarry.PluginMenu:addParam("Information3", "== Drawer-Settings: ==", SCRIPT_PARAM_INFO, "")
  206. AutoCarry.PluginMenu:addParam("drawQrange","Draw Q range", SCRIPT_PARAM_ONOFF, true)
  207. AutoCarry.PluginMenu:addParam("drawErange","Draw E range", SCRIPT_PARAM_ONOFF, false) -- useless imo, too much circles.
  208. AutoCarry.PluginMenu:addParam("drawRrange","Draw R range", SCRIPT_PARAM_ONOFF, true)
  209. AutoCarry.PluginMenu:addParam("drawRmec","Draw R prediction", SCRIPT_PARAM_ONOFF, false) -- This is only to let you see how it casts ultimate, imo should be disable during game.
  210. AutoCarry.PluginMenu:addParam("drawText","Draw text on enemies", SCRIPT_PARAM_ONOFF, true) -- Killable, Murder him, etc.
  211. AutoCarry.PluginMenu:addParam("drawPoly","Use less demanding DrawCircle", SCRIPT_PARAM_ONOFF, false) -- Killable, Murder him, etc.
  212. AutoCarry.PluginMenu:addParam("Information5", "Check this if you have weak PC", SCRIPT_PARAM_INFO, "")
  213.  
  214. -- SImple Draw (replace standart draw circle with less fps intensive one and hide non visible onscreen circles)
  215. -- by barasia, vadash and viseversa
  216.  
  217. function DrawCircleNextLvl(x, y, z, radius, width, color, chordlength)
  218.     radius = radius or 300
  219.         quality = math.max(8,round(180/math.deg((math.asin((chordlength/(2*radius)))))))
  220.         quality = 2 * math.pi / quality
  221.         radius = radius*.92
  222.     local points = {}
  223.     for theta = 0, 2 * math.pi + quality, quality do
  224.         local c = WorldToScreen(D3DXVECTOR3(x + radius * math.cos(theta), y, z - radius * math.sin(theta)))
  225.         points[#points + 1] = D3DXVECTOR2(c.x, c.y)
  226.     end
  227.     DrawLines2(points, width or 1, color or 4294967295)
  228. end
  229.  
  230. function round(num)
  231.     if num >= 0 then return math.floor(num+.5) else return math.ceil(num-.5) end
  232. end
  233.  
  234. function DrawCircle2(x, y, z, radius, color)
  235.     local vPos1 = Vector(x, y, z)
  236.     local vPos2 = Vector(cameraPos.x, cameraPos.y, cameraPos.z)
  237.     local tPos = vPos1 - (vPos1 - vPos2):normalized() * radius
  238.     local sPos = WorldToScreen(D3DXVECTOR3(tPos.x, tPos.y, tPos.z))
  239.     if OnScreen({ x = sPos.x, y = sPos.y }, { x = sPos.x, y = sPos.y }) then
  240.         DrawCircleNextLvl(x, y, z, radius, 1, color, 75)   
  241.     end
  242. end
  243. --_G.DrawCircle = DrawCircle2
Advertisement
Add Comment
Please, Sign In to add comment