Kain2030

Auto Carry Plugin - Lucian Edition - v1.02 Beta Pre-Release

Jul 31st, 2013
528
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.86 KB | None | 0 0
  1. --[[
  2.  
  3.         Auto Carry Plugin - Lucian Edition
  4.         Author: Kain
  5.         Version: 1.02 Beta
  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 = 1000
  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 PursuitMinMouseDiff = 500
  39.  
  40. 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 }
  41. 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 }
  42. 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 }
  43. 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 }
  44.  
  45. local DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = nil, nil, nil, nil, nil, nil
  46. local QReady, WReady, EReady, RReady, DFGReady, HXGReady, BWCReady, IReady = false, false, false, false, false, false, false, false
  47.  
  48. function PluginOnLoad()
  49.     Menu()
  50.  
  51.     AutoCarry.SkillsCrosshair.range = QMaxRange
  52. end
  53.  
  54. function Menu()
  55. --  AutoCarry.PluginMenu:addParam("fullcombo", "Full Combo", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("Z"))
  56.     AutoCarry.PluginMenu:addParam("Harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("A"))
  57.     AutoCarry.PluginMenu:addParam("UseE", "Pursuit in Combo", SCRIPT_PARAM_ONOFF, true)
  58.     AutoCarry.PluginMenu:addParam("Ultimate", "Use Ultimate with Combo", SCRIPT_PARAM_ONOFF, true)
  59.     AutoCarry.PluginMenu:addParam("Killsteal", "Killsteal", SCRIPT_PARAM_ONOFF, true)
  60.     AutoCarry.PluginMenu:addParam("KillstealUlt", "Killsteal with Ult", SCRIPT_PARAM_ONOFF, false)
  61.     AutoCarry.PluginMenu:addParam("Draw", "Draw range circles", SCRIPT_PARAM_ONOFF, true)
  62. end
  63.  
  64. function PluginOnTick()
  65.     Target = AutoCarry.GetAttackTarget(true)
  66.  
  67.     SpellCheck()
  68.  
  69.     if (AutoCarry.MainMenu.AutoCarry or AutoCarry.MainMenu.MixedMode) then
  70.         Combo()
  71.     end
  72.  
  73. --[[   
  74.     if AutoCarry.PluginMenu.fullcombo then
  75.         FullCombo()
  76.     end
  77. --]]
  78.  
  79.     if AutoCarry.PluginMenu.Harass then
  80.         Harass()
  81.     end
  82.  
  83.     if AutoCarry.PluginMenu.Killsteal then
  84.         KillSteal()
  85.     end
  86. end
  87.  
  88. function PluginOnCreateObj(obj)
  89.     -- Nothing to do here.
  90. end
  91.  
  92. function PluginOnDeleteObj(obj)
  93.     -- Nothing to do here.
  94. end
  95.  
  96. function OnAttacked()
  97.     -- AA > Q > AA
  98.     CastQ()
  99. end
  100.  
  101. --[[
  102. function CustomAttackEnemy(enemy)
  103.         if enemy.dead or not enemy.valid then return end
  104.         -- myHero:Attack(enemy)
  105.         -- AutoCarry.shotFired = true
  106. end
  107. --]]
  108.  
  109. function SpellCheck()
  110.     DFGSlot, HXGSlot, BWCSlot, BRKSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3128),
  111.     GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3153), GetInventorySlotItem(3057),
  112.     GetInventorySlotItem(3078), GetInventorySlotItem(3100)
  113.  
  114.     QReady = (myHero:CanUseSpell(SkillQ.spellKey) == READY)
  115.     WReady = (myHero:CanUseSpell(SkillW.spellKey) == READY)
  116.     EReady = (myHero:CanUseSpell(SkillE.spellKey) == READY)
  117.     RReady = (myHero:CanUseSpell(SkillR.spellKey) == READY)
  118.  
  119.     DFGReady = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  120.     HXGReady = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  121.     BWCReady = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  122.     BRKReady = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
  123.  
  124.     IReady = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  125. end
  126.  
  127. -- Handle SBTW Skill Shots
  128.  
  129. function Combo()
  130.     CastSlots()
  131.     if AutoCarry.PluginMenu.UseE then CastE() end
  132.     CastQ()
  133.     CastW()
  134.     if AutoCarry.PluginMenu.Ultimate then
  135.         CastR()
  136.     end
  137. end
  138.  
  139. function FullCombo()
  140.     CastSlots()
  141.     CastE()
  142.     CastQ()
  143.     CastW()
  144.     if AutoCarry.PluginMenu.Ultimate then
  145.         CastR()
  146.     end
  147. end
  148.  
  149. function CastSlots()
  150.     if Target ~= nil then
  151.         if GetDistance(Target) <= QRange then
  152.             if DFGReady then CastSpell(DFGSlot, Target) end
  153.             if HXGReady then CastSpell(HXGSlot, Target) end
  154.             if BWCReady then CastSpell(BWCSlot, Target) end
  155.             if BRKReady then CastSpell(BRKSlot, Target) end
  156.         end
  157.     end
  158. end
  159.  
  160.  
  161. function Harass()
  162.     CastQ()
  163. end
  164.  
  165. function CastQ()
  166.     -- Q (Piercing Light)
  167.     if Target ~= nil and QReady and ValidTarget(Target, QRange) then
  168.         CastSpell(SkillQ.spellKey, Target)
  169.     end
  170. end
  171.  
  172. function CastW()
  173.     -- W (Ardent Blaze)
  174.     if Target ~= nil and WReady and ValidTarget(Target, WRange) then
  175.         AutoCarry.CastSkillshot(SkillW, Target)
  176.     end
  177. end
  178.  
  179. function CastE()
  180.     -- E (Relentless Pursuit)
  181.     if debugMode then
  182.         PrintChat("Mouse Distance: "..GetDistance(mousePos))
  183.     end
  184.  
  185.     if EReady then
  186.         -- if ( math.abs(mousePos.x - myHero.x) > PursuitMinMouseDiff or math.abs(mousePos.z - myHero.z) > PursuitMinMouseDiff) then
  187.         if (GetDistance(mousePos) > PursuitMinMouseDiff) then
  188.             CastSpell(SkillE.spellKey, mousePos.x, mousePos.z)
  189.         end
  190.     end
  191. end
  192.    
  193. function CastR()
  194.     -- R (The Culling)
  195.     if Target ~= nil and RReady and ValidTarget(Target, RRange) then
  196.         AutoCarry.CastSkillshot(SkillR, Target)
  197.     end
  198.     -- myHero:MoveTo(mousePos.x, mousePos.z)
  199. end
  200.  
  201. function KillSteal()
  202.     -- Will try to perform a killsteam using any spell.
  203.     if not AutoCarry.PluginMenu.Killsteal then return end
  204.  
  205.     for _, enemy in pairs(AutoCarry.EnemyTable) do
  206.         if not enemy.dead then
  207.             -- if ValidTarget(enemy, QRange) and QReady and enemy.health < getDmg("Q", enemy, myHero) then
  208.             if ValidTarget(enemy, QRange) and QReady and (enemy.health + 20) < getDmg("Q", enemy, myHero) then
  209.                 CastSpell(SkillQ.spellKey, enemy)
  210.             elseif ValidTarget(enemy, WRange) and WReady and (enemy.health + 20) < getDmg("W", enemy, myHero) then
  211.                 AutoCarry.CastSkillshot(SkillW, enemy)
  212.             elseif AutoCarry.PluginMenu.KillstealUlt and ValidTarget(enemy, RRange) and RReady and (enemy.health + 20) < getDmg("R", enemy, myHero) then
  213.                 AutoCarry.CastSkillshot(SkillR, enemy)
  214.             end
  215.         end
  216.     end
  217. end
  218.  
  219. function PluginOnWndMsg(msg,key)
  220.     Target = AutoCarry.GetAttackTarget()
  221.     if Target ~= nil then
  222.         -- if msg == KEY_DOWN and key == KeyQ then CastQ() end
  223.         if msg == KEY_DOWN and key == KeyW then CastW() end
  224.         if msg == KEY_DOWN and key == KeyE then CastE() end
  225.         if msg == KEY_DOWN and key == KeyR then CastR() end
  226.     end
  227. end
  228.  
  229. -- Drawing
  230.  
  231. function PluginOnDraw()
  232.     if AutoCarry.PluginMenu.Draw then
  233.         DrawCircle(myHero.x, myHero.y, myHero.z, AutoCarry.SkillsCrosshair.range, 0x808080) -- Gray
  234.  
  235.         if myHero:CanUseSpell(SkillQ.spellKey) then
  236.             DrawCircle(myHero.x, myHero.y, myHero.z, QRange, 0x0099CC) -- Blue
  237.         end
  238.        
  239.         if myHero:CanUseSpell(SkillW.spellKey) then
  240.             DrawCircle(myHero.x, myHero.y, myHero.z, WRange, 0xFFFF00) -- Yellow
  241.         end
  242.        
  243.         if myHero:CanUseSpell(SkillE.spellKey) then
  244.             DrawCircle(myHero.x, myHero.y, myHero.z, ERange, 0x00FF00) -- Green
  245.         end
  246.  
  247.         if myHero:CanUseSpell(SkillR.spellKey) then
  248.             DrawCircle(myHero.x, myHero.y, myHero.z, RRange, 0xFF0000) -- Red
  249.         end
  250.  
  251.         Target = AutoCarry.GetAttackTarget()
  252.         if Target ~= nil then
  253.             for j=0, 10 do
  254.                 DrawCircle(Target.x, Target.y, Target.z, 40 + j*1.5, 0x00FF00) -- Green
  255.             end
  256.         end
  257.     end
  258. end
Advertisement
Add Comment
Please, Sign In to add comment