AnonymousBOL

aEvelynn v1.0

Oct 19th, 2013
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.05 KB | None | 0 0
  1. class 'Plugin'
  2. require 'AoE_Skillshot_Position'
  3. if myHero.charName ~= "Evelynn" then return end
  4.  
  5. local Target
  6. local UltByScript = false
  7.  
  8. function Plugin:__init()
  9.     AutoCarry.Crosshair:SetSkillCrosshairRange(800)
  10.     aEcfg = scriptConfig("Sida's Auto Carry Plugin: aEvelynn Config", "aevelynn")
  11.     aEcfg:addParam("Information1", "  aEvelynn v1.0 by Anonymous", SCRIPT_PARAM_INFO, "")
  12.     aEcfg:addParam("Information2", "== Helper-Settings: ==", SCRIPT_PARAM_INFO, "")
  13.     aEcfg:addParam("burstTarget", "Full Combo", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("A"))
  14.     aEcfg:addParam("spamQE","Use QE in AutoCarry mode", SCRIPT_PARAM_ONOFF, true)
  15.     aEcfg:addParam("spamQ","Use Q in LaneClear mode", SCRIPT_PARAM_ONOFF, true)
  16.     aEcfg:addParam("spamE","Use E in LaneClear mode", SCRIPT_PARAM_ONOFF, true)
  17.     aEcfg:addParam("autoMinMana","Minimum % mana (LaneClear)", SCRIPT_PARAM_SLICE, 35, 0, 100, 0)
  18.     --aEcfg:addParam("spamQblueonly","Only with bluebuff", SCRIPT_PARAM_ONOFF, true)
  19.     aEcfg:addParam("Information4", "VIP only functions:", SCRIPT_PARAM_INFO, "")
  20.     aEcfg:addParam("blockR","Block wrong ult", SCRIPT_PARAM_ONOFF, true)
  21.     aEcfg:addParam("autoUltaiming","Automaticly aim with ult", SCRIPT_PARAM_ONOFF, true)
  22.     aEcfg:addParam("Information3", "== Drawer-Settings: ==", SCRIPT_PARAM_INFO, "")
  23.     aEcfg:addParam("drawQrange","Draw Q range", SCRIPT_PARAM_ONOFF, true)
  24.     aEcfg:addParam("drawErange","Draw E range", SCRIPT_PARAM_ONOFF, false) -- useless imo, too much circles.
  25.     aEcfg:addParam("drawRrange","Draw R range", SCRIPT_PARAM_ONOFF, true)
  26.     aEcfg: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.
  27.     for _, Item in pairs(AutoCarry.Items.ItemList) do
  28.         if Item.ID == 3128 then
  29.             Item.Enabled = false
  30.         end
  31.     end
  32. end
  33.  
  34. function Plugin:OnTick()
  35.     Target = AutoCarry.Crosshair:GetTarget()
  36.     if aEcfg.spamQE then
  37.         if Target ~= nil and AutoCarry.Keys.AutoCarry then
  38.             local CanQ = (myHero:CanUseSpell(_Q) == READY and GetDistance(Target, myHero) < 500)
  39.             local CanE = (myHero:CanUseSpell(_E) == READY and GetDistance(Target, myHero) < 225)
  40.             if CanQ then CastSpell(_Q) end
  41.             if CanE then CastSpell(_E, Target) end
  42.         end
  43.     end
  44.     if aEcfg.spamQ then
  45.         if AutoCarry.Keys.LaneClear and myHero.mana/myHero.maxMana*100 >= aEcfg.autoMinMana then
  46.             local CanQ = (myHero:CanUseSpell(_Q) == READY)
  47.             if CanQ then CastSpell(_Q) end
  48.         end
  49.     end
  50.     if aEcfg.spamE then
  51.         if AutoCarry.Keys.LaneClear and myHero.mana/myHero.maxMana*100 >= aEcfg.autoMinMana then
  52.             local JunngleTarget = AutoCarry.Jungle:GetAttackableMonster()
  53.             local CanE = (myHero:CanUseSpell(_E) == READY and JunngleTarget ~= nil and GetDistance(JunngleTarget, myHero) < 225)
  54.             if CanE and JunngleTarget ~= nil then CastSpell(_E, JunngleTarget) end
  55.         end
  56.     end
  57.     if aEcfg.burstTarget then
  58.         if Target ~= nil then
  59.             local CanQ = (myHero:CanUseSpell(_Q) == READY and GetDistance(Target, myHero) < 500)
  60.             local CanE = (myHero:CanUseSpell(_E) == READY and GetDistance(Target, myHero) < 325)
  61.             local CanR = (myHero:CanUseSpell(_R) == READY and GetDistance(Target, myHero) < 800)
  62.             AutoCarry.Items:UseAll(Target)
  63.             if CanR then CastSpell(_R, Target.x, Target.z) end -- Packets will target it better anyway :p
  64.             if CanE then CastSpell(_E, Target) end
  65.             if CanQ then CastSpell(_Q) end
  66.             if not AutoCarry.Keys.AutoCarry then myHero:Attack(Target) end
  67.         end
  68.     end
  69. end
  70.  
  71. function Plugin:OnDraw()
  72.     if myHero ~= nil and not myHero.dead and aEcfg.drawQrange then DrawCircle(myHero.x, myHero.y, myHero.z, 500, 0xFF80FF00) end
  73.     if myHero ~= nil and not myHero.dead and aEcfg.drawErange then DrawCircle(myHero.x, myHero.y, myHero.z, 225, 0xFF80FF00) end
  74.     if myHero ~= nil and not myHero.dead and aEcfg.drawRrange and myHero:CanUseSpell(_R) == READY then DrawCircle(myHero.x, myHero.y, myHero.z, 800, 0xFF80FF00) end
  75.    
  76.     if aEcfg.drawRmec then -- Test MEC IT Draws where ultimate will be casted :) You can uncomment it, and it will work.
  77.         local Enemies = AutoCarry.Helper.EnemyTable
  78.         local ClosestEnemy = nil
  79.         local Position1 = { x=mousePos.x, y=mousePos.y, z=mousePos.z }
  80.         for i, Enemy in pairs(Enemies) do
  81.             if Enemy ~= nil and not Enemy.dead and Enemy.visible then
  82.                 if ClosestEnemy ~= nil then
  83.                     if GetDistance(Enemy, Position1) < GetDistance(ClosestEnemy, Position1) then
  84.                         ClosestEnemy = Enemy
  85.                     end
  86.                 else
  87.                     ClosestEnemy = Enemy
  88.                 end
  89.             end
  90.         end
  91.         local UltTargetted = ClosestEnemy
  92.         if GetDistance(UltTargetted, CastPosition) < 300 then
  93.             UltTarget = UltTargetted
  94.         else
  95.             UltTarget = AutoCarry.Crosshair:GetTarget()
  96.         end
  97.         if UltTarget ~= nil then
  98.             local ValidEnemies = 0
  99.             for i, Enemy in pairs(Enemies) do
  100.                 if Enemy ~= nil and not Enemy.dead and Enemy.visible and GetDistance(Enemy, myHero) < 1050 then ValidEnemies = ValidEnemies + 1 end
  101.             end
  102.             if ValidEnemies > 1 then
  103.                 local spellPos = GetAoESpellPosition(250, UltTarget)
  104.                 DrawCircle(spellPos.x, spellPos.y, spellPos.z, 250, 0xFF80FF00)
  105.             else
  106.                 DrawCircle(UltTarget.x, UltTarget.y, UltTarget.z, 250, 0xFF80FF00)
  107.             end
  108.         end
  109.     end
  110. end
  111.  
  112. function Plugin:OnSendPacket(p)
  113.     local packet = Packet(p)
  114.     if packet:get('name') == 'S_CAST' then
  115.         local SpellID = packet:get('spellId')
  116.         if SpellID == SPELL_4 then
  117.             local Enemies = AutoCarry.Helper.EnemyTable
  118.             local CastPosition = { x = packet:get('toX'), y = packet:get('toY'), z = packet:get('toY') }
  119.             if aEcfg.blockR then
  120.                 local ValidTargets = 0
  121.                 for i, Enemy in pairs(Enemies) do
  122.                     if Enemy ~= nil and not Enemy.dead and Enemy.visible and GetDistance(Enemy, CastPosition) < 250 then ValidTargets = ValidTargets + 1 end
  123.                 end
  124.                 if ValidTargets == 0 then p:Block() end
  125.             end
  126.             if aEcfg.autoUltaiming then
  127.                 if UltByScript == true then
  128.                     UltByScript = false
  129.                 elseif UltByScript == false then
  130.                     p:Block()
  131.                     UltByScript = true
  132.                     local ClosestEnemy = nil
  133.                     local Position1 = { x=CastPosition.x, y=CastPosition.y, z=CastPosition.z }
  134.                     for i, Enemy in pairs(Enemies) do
  135.                         if Enemy ~= nil and not Enemy.dead and Enemy.visible then
  136.                             if ClosestEnemy ~= nil then
  137.                                 if GetDistance(Enemy, Position1) < GetDistance(ClosestEnemy, Position1) then
  138.                                     ClosestEnemy = Enemy
  139.                                 end
  140.                             else
  141.                                 ClosestEnemy = Enemy
  142.                             end
  143.                         end
  144.                     end
  145.                     local UltTargetted = ClosestEnemy
  146.                     if GetDistance(UltTargetted, CastPosition) < 300 then
  147.                         UltTarget = UltTargetted
  148.                     else
  149.                         UltTarget = AutoCarry.Crosshair:GetTarget()
  150.                     end
  151.                     if UltTarget ~= nil then
  152.                         local ValidEnemies = 0
  153.                         for i, Enemy in pairs(Enemies) do
  154.                             if Enemy ~= nil and not Enemy.dead and Enemy.visible and GetDistance(Enemy, myHero) < 1050 then ValidEnemies = ValidEnemies + 1 end
  155.                         end
  156.                         if ValidEnemies > 1 then
  157.                             local spellPos = GetAoESpellPosition(250, UltTarget)
  158.                             CastSpell(_R, spellPos.x, spellPos.z)
  159.                         else
  160.                             CastSpell(_R, UltTarget.x, UltTarget.z)
  161.                         end
  162.                     end
  163.                 end
  164.             end
  165.         end
  166.     end
  167. end
  168.  
  169. local Menu = AutoCarry.Plugins:RegisterPlugin(Plugin(), "aEvelynn Loaded!")
Advertisement
Add Comment
Please, Sign In to add comment