AnonymousBOL

aEvelynn v1.0a - DFG Fix

Oct 20th, 2013
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.08 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.             CastItem(3128, Target)
  64.             if CanR then CastSpell(_R, Target.x,            Target.z) end -- Packets will target it better anyway :p
  65.             if CanE then CastSpell(_E, Target) end
  66.             if CanQ then CastSpell(_Q) end
  67.             if not AutoCarry.Keys.AutoCarry then myHero:Attack(Target) end
  68.         end
  69.     end
  70. end
  71.  
  72. function Plugin:OnDraw()
  73.     if myHero ~= nil and not myHero.dead and aEcfg.drawQrange then DrawCircle(myHero.x, myHero.y, myHero.z, 500, 0xFF80FF00) end
  74.     if myHero ~= nil and not myHero.dead and aEcfg.drawErange then DrawCircle(myHero.x, myHero.y, myHero.z, 225, 0xFF80FF00) end
  75.     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
  76.    
  77.     if aEcfg.drawRmec then -- Test MEC IT Draws where ultimate will be casted :) You can uncomment it, and it will work.
  78.         local Enemies = AutoCarry.Helper.EnemyTable
  79.         local ClosestEnemy = nil
  80.         local Position1 = { x=mousePos.x, y=mousePos.y, z=mousePos.z }
  81.         for i, Enemy in pairs(Enemies) do
  82.             if Enemy ~= nil and not Enemy.dead and Enemy.visible then
  83.                 if ClosestEnemy ~= nil then
  84.                     if GetDistance(Enemy, Position1) < GetDistance(ClosestEnemy, Position1) then
  85.                         ClosestEnemy = Enemy
  86.                     end
  87.                 else
  88.                     ClosestEnemy = Enemy
  89.                 end
  90.             end
  91.         end
  92.         local UltTargetted = ClosestEnemy
  93.         if GetDistance(UltTargetted, CastPosition) < 300 then
  94.             UltTarget = UltTargetted
  95.         else
  96.             UltTarget = AutoCarry.Crosshair:GetTarget()
  97.         end
  98.         if UltTarget ~= nil then
  99.             local ValidEnemies = 0
  100.             for i, Enemy in pairs(Enemies) do
  101.                 if Enemy ~= nil and not Enemy.dead and Enemy.visible and GetDistance(Enemy, myHero) < 1050 then ValidEnemies = ValidEnemies + 1 end
  102.             end
  103.             if ValidEnemies > 1 then
  104.                 local spellPos = GetAoESpellPosition(250, UltTarget)
  105.                 DrawCircle(spellPos.x, spellPos.y, spellPos.z, 250, 0xFF80FF00)
  106.             else
  107.                 DrawCircle(UltTarget.x, UltTarget.y, UltTarget.z, 250, 0xFF80FF00)
  108.             end
  109.         end
  110.     end
  111. end
  112.  
  113. function Plugin:OnSendPacket(p)
  114.     local packet = Packet(p)
  115.     if packet:get('name') == 'S_CAST' then
  116.         local SpellID = packet:get('spellId')
  117.         if SpellID == SPELL_4 then
  118.             local Enemies = AutoCarry.Helper.EnemyTable
  119.             local CastPosition = { x = packet:get('toX'), y = packet:get('toY'), z = packet:get('toY') }
  120.             if aEcfg.blockR then
  121.                 local ValidTargets = 0
  122.                 for i, Enemy in pairs(Enemies) do
  123.                     if Enemy ~= nil and not Enemy.dead and Enemy.visible and GetDistance(Enemy, CastPosition) < 250 then ValidTargets = ValidTargets + 1 end
  124.                 end
  125.                 if ValidTargets == 0 then p:Block() end
  126.             end
  127.             if aEcfg.autoUltaiming then
  128.                 if UltByScript == true then
  129.                     UltByScript = false
  130.                 elseif UltByScript == false then
  131.                     p:Block()
  132.                     UltByScript = true
  133.                     local ClosestEnemy = nil
  134.                     local Position1 = { x=CastPosition.x, y=CastPosition.y, z=CastPosition.z }
  135.                     for i, Enemy in pairs(Enemies) do
  136.                         if Enemy ~= nil and not Enemy.dead and Enemy.visible then
  137.                             if ClosestEnemy ~= nil then
  138.                                 if GetDistance(Enemy, Position1) < GetDistance(ClosestEnemy, Position1) then
  139.                                     ClosestEnemy = Enemy
  140.                                 end
  141.                             else
  142.                                 ClosestEnemy = Enemy
  143.                             end
  144.                         end
  145.                     end
  146.                     local UltTargetted = ClosestEnemy
  147.                     if GetDistance(UltTargetted, CastPosition) < 300 then
  148.                         UltTarget = UltTargetted
  149.                     else
  150.                         UltTarget = AutoCarry.Crosshair:GetTarget()
  151.                     end
  152.                     if UltTarget ~= nil then
  153.                         local ValidEnemies = 0
  154.                         for i, Enemy in pairs(Enemies) do
  155.                             if Enemy ~= nil and not Enemy.dead and Enemy.visible and GetDistance(Enemy, myHero) < 1050 then ValidEnemies = ValidEnemies + 1 end
  156.                         end
  157.                         if ValidEnemies > 1 then
  158.                             local spellPos = GetAoESpellPosition(250, UltTarget)
  159.                             CastSpell(_R, spellPos.x, spellPos.z)
  160.                         else
  161.                             CastSpell(_R, UltTarget.x, UltTarget.z)
  162.                         end
  163.                     end
  164.                 end
  165.             end
  166.         end
  167.     end
  168. end
  169.  
  170. local Menu = AutoCarry.Plugins:RegisterPlugin(Plugin(), "aEvelynn Loaded!")
Advertisement
Add Comment
Please, Sign In to add comment