Kain2030

Auto Carry Plugin - Lucian Edition - v1.0 Alpha Pre-release

Jul 17th, 2013
606
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.83 KB | None | 0 0
  1. --[[
  2.  
  3.         Auto Carry Plugin - Lucian Edition
  4.         Author: Kain
  5.         Version: 1.0 Alpha
  6.         Copyright 2013
  7.  
  8.         Dependency: Sida's Auto Carry: Revamped
  9.  
  10.         How to install:
  11.             Make sure you already have AutoCarry installed.
  12.             Name the script EXACTLY "SidasAutoCarryPlugin - Lucian.lua" without the quotes.
  13.             Place the plugin in BoL/Scripts/Common folder.
  14. --]]
  15.  
  16. if myHero.charName ~= "Lucian" then return end
  17.  
  18. local Target
  19.  
  20. -- Prediction
  21. local QRange = 550
  22. local QMaxRange = 1100
  23. local WRange = 900
  24. local ERange = 425
  25. local RRange = 1400
  26.  
  27. -- Speeds and widths need refining.
  28. local QSpeed = 1.3
  29. local WSpeed = 1.3
  30. local ESpeed = 1.3
  31. local RSpeed = 1.3
  32.  
  33. local QWidth = 250
  34. local WWidth = 250
  35. local EWidth = 0
  36. local RWidth = 250
  37.  
  38. local SkillQ = {spellKey = _Q, range = QRange, speed = QSpeed, delay = 0, width = QWidth, configName = "piercinglight", displayName = "Q (Piercing Light)", enabled = true, skillShot = true, minions = false, reset = false, reqTarget = true }
  39. local SkillW = {spellKey = _W, range = WRange, speed = WSpeed, delay = 0, width = WWidth, configName = "ardentblaze", displayName = "W (Ardent Blaze)", enabled = true, skillShot = true, minions = false, reset = false, reqTarget = false }
  40. local SkillE = {spellKey = _E, range = ERange, speed = ESpeed, delay = 0, width = EWidth, configName = "relentlesspursuit", displayName = "E (Relentless Pursuit)", enabled = true, skillShot = true, minions = false, reset = false, reqTarget = false }
  41. local SkillR = {spellKey = _R, range = RRange, speed = RSpeed, delay = 0, width = RWidth, configName = "theculling", displayName = "R (The Culling)", enabled = true, skillShot = true, minions = false, reset = false, reqTarget = true }
  42.  
  43. function PluginOnLoad()
  44.     Menu()
  45. end
  46.  
  47. function Menu()
  48. --  AutoCarry.PluginMenu:addParam("fullcombo", "Full Combo", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("Z"))
  49.     AutoCarry.PluginMenu:addParam("harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("A"))
  50.     AutoCarry.PluginMenu:addParam("ultimate", "Use Ultimate with Combo", SCRIPT_PARAM_ONOFF, true)
  51.     AutoCarry.PluginMenu:addParam("killsteal", "Killsteal", SCRIPT_PARAM_ONOFF, true)
  52.     AutoCarry.PluginMenu:addParam("draw", "Draw range circles", SCRIPT_PARAM_ONOFF, true)
  53. end
  54.  
  55. function PluginOnTick()
  56.     Target = AutoCarry.GetAttackTarget(true)
  57.  
  58.     SpellCheck()
  59.  
  60.     if (AutoCarry.MainMenu.AutoCarry or AutoCarry.MainMenu.MixedMode) then
  61.         Combo()
  62.     end
  63.    
  64.     if AutoCarry.PluginMenu.fullcombo then
  65.         FullCombo()
  66.     end
  67.  
  68.     if AutoCarry.PluginMenu.harass then
  69.         Harass()
  70.     end
  71.  
  72.     if AutoCarry.PluginMenu.killsteal then
  73.         KillSteal()
  74.     end
  75. end
  76.  
  77. function PluginOnCreateObj(obj)
  78.     -- Nothing to do here.
  79. end
  80.  
  81. function PluginOnDeleteObj(obj)
  82.     -- Nothing to do here.
  83. end
  84.  
  85. function OnAttacked()
  86.     -- AA > Q > AA
  87.     CastQ()
  88. end
  89.  
  90. function CustomAttackEnemy(enemy)
  91.         if enemy.dead or not enemy.valid then return end
  92.         if axesActive() and GetDistance(mousePos) <= DravenConfig.CatchRange then
  93.                 if qStacks < 2 then CastSpell(_Q) end
  94.         end
  95.         myHero:Attack(enemy)
  96.         AutoCarry.shotFired = true
  97. end
  98.  
  99. function SpellCheck()
  100.     DFGSlot, HXGSlot, BWCSlot, BRKSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3128),
  101.     GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3153), GetInventorySlotItem(3057),
  102.     GetInventorySlotItem(3078), GetInventorySlotItem(3100)
  103.  
  104.     QReady = (myHero:CanUseSpell(SkillQ.spellKey) == READY)
  105.     WReady = (myHero:CanUseSpell(SkillW.spellKey) == READY)
  106.     EReady = (myHero:CanUseSpell(SkillE.spellKey) == READY)
  107.     RReady = (myHero:CanUseSpell(SkillR.spellKey) == READY)
  108.  
  109.     DFGReady = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  110.     HXGReady = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  111.     BWCReady = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  112.     BRKReady = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
  113.  
  114.     IReady = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  115. end
  116.  
  117. -- Handle SBTW Skill Shots
  118.  
  119. function Combo()
  120.     CastSlots()
  121.     CastE()
  122.     CastQ()
  123.     CastW()
  124.     if AutoCarry.PluginMenu.ultimate then
  125.         CastR()
  126.     end
  127. end
  128.  
  129. --[[
  130. function FullCombo()
  131.     CastSlots()
  132.     CastE()
  133.     CastQ()
  134.     CastW()
  135.     if AutoCarry.PluginMenu.ultimate then
  136.         CastR()
  137.     end
  138. end
  139. ]]--
  140.  
  141. function CastSlots()
  142.     if Target ~= nil then
  143.         if GetDistance(Target) <= QRange then
  144.             if DFGReady then CastSpell(DFGSlot, Target) end
  145.             if HXGReady then CastSpell(HXGSlot, Target) end
  146.             if BWCReady then CastSpell(BWCSlot, Target) end
  147.             if BRKReady then CastSpell(BRKSlot, Target) end
  148.         end
  149.     end
  150. end
  151.  
  152.  
  153. function Harass()
  154.     CastQ()
  155. end
  156.  
  157. function CastQ()
  158.     -- Q (Piercing Light)
  159.     if Target ~= nil and QReady and ValidTarget(Target, QRange) then
  160.         CastSpell(SpellQ.spellKey, Target)
  161.     end
  162. end
  163.  
  164. function CastW()
  165.     -- W (Ardent Blaze)
  166.     if Target ~= nil and WReady and ValidTarget(Target, WRange) then
  167.         AutoCarry.CastSkillshot(SkillW, Target)
  168.     end
  169. end
  170.  
  171. function CastE()
  172.     -- E (Relentless Pursuit)
  173.     if EReady then
  174.         CastSpell(SkillE.spellKey, mousePos.x, mousePos.z)
  175.     end
  176. end
  177.    
  178. function CastR()
  179.     -- R (The Culling)
  180.     if Target ~= nil and RReady and ValidTarget(Target, RRange) then
  181.         AutoCarry.CastSkillshot(SkillR, Target)
  182.     end
  183. end
  184.  
  185. function KillSteal()
  186.     -- Will try to perform a killsteam using any spell.
  187.     for _, enemy in pairs(AutoCarry.EnemyTable) do
  188.         if ValidTarget(enemy, RRange) then
  189.             if QReady and enemy.health < getDmg("Q", enemy, myHero) then
  190.                 CastSpell(SpellQ.spellKey, enemy)
  191.             elseif WReady and enemy.health < getDmg("W", enemy, myHero) then
  192.                 AutoCarry.CastSkillshot(SkillW, enemy)
  193.             elseif RReady and enemy.health < getDmg("R", enemy, myHero) then
  194.                 AutoCarry.CastSkillshot(SkillR, enemy)
  195.             end
  196.         end
  197.     end
  198. end
  199.  
  200. function PluginOnWndMsg(msg,key)
  201.     Target = AutoCarry.GetAttackTarget()
  202.     if Target ~= nil then
  203.         -- if msg == KEY_DOWN and key == KeyQ then CastQ() end
  204.         if msg == KEY_DOWN and key == KeyW then CastW() end
  205.         if msg == KEY_DOWN and key == KeyE then CastE() end
  206.         if msg == KEY_DOWN and key == KeyR then CastR() end
  207.     end
  208. end
  209.  
  210. -- Drawing
  211.  
  212. function PluginOnDraw()
  213.     if AutoCarry.PluginMenu.draw then
  214.         DrawCircle(myHero.x, myHero.y, myHero.z, AutoCarry.SkillsCrosshair.range, 0x808080) -- Gray
  215.  
  216.         if myHero:CanUseSpell(SkillQ.spellKey) then
  217.             DrawCircle(myHero.x, myHero.y, myHero.z, QRange, 0x0099CC) -- Blue
  218.         end
  219.        
  220.         if myHero:CanUseSpell(SkillW.spellKey) then
  221.             DrawCircle(myHero.x, myHero.y, myHero.z, WRange, 0xFFFF00) -- Yellow
  222.         end
  223.        
  224.         if myHero:CanUseSpell(SkillE.spellKey) then
  225.             DrawCircle(myHero.x, myHero.y, myHero.z, ERange, 0x00FF00) -- Green
  226.         end
  227.  
  228.         if myHero:CanUseSpell(SkillR.spellKey) then
  229.             DrawCircle(myHero.x, myHero.y, myHero.z, RRange, 0xFF0000) -- Red
  230.         end
  231.  
  232.         Target = AutoCarry.GetAttackTarget()
  233.         if Target ~= nil then
  234.             for j=0, 10 do
  235.                 DrawCircle(Target.x, Target.y, Target.z, 40 + j*1.5, 0x00FF00) -- Green
  236.             end
  237.         end
  238.     end
  239. end
Advertisement
Add Comment
Please, Sign In to add comment