Kain2030

Auto Carry Plugin - Ziggs Edition - v1.1c

Aug 10th, 2013
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 25.88 KB | None | 0 0
  1. --[[
  2.  
  3.         Auto Carry Plugin - Ziggs Edition
  4.         Author: Kain
  5.         Version: 1.1c
  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 - Ziggs.lua" without the quotes.
  13.             Place the plugin in BoL/Scripts/Common folder.
  14.  
  15.         Version History:
  16.             Version: 1.1: http://pastebin.com/exXzdFD8
  17.                 Improved Satchel Jump to fire more accurately and also in the direction of the mouse position.
  18.                 Added low mana handling with the Mana Manager.
  19.                 Added Smart Q farming. Uses Q when it can kill multiple minions and mana is higher than the Mana Manager low limit.
  20.                 Improved prediction range logic for Q and R.
  21.                 Fixed Q to not hit minions as much.
  22.                 Added enemy low health logic.
  23.             Version: 1.08: http://pastebin.com/ebB89AnC
  24.             Version: 1.07: http://pastebin.com/Mj7i5k9X
  25.                 Added text on screen when Killsteal occurs to make it more noticeable.
  26.                 Added slider variable to set Killsteal hitchance/sensitivity.
  27.             Version: 1.06: http://pastebin.com/5j9W654G (7/23/2013)
  28.                 Fixed Karthus / Kog'maw, etc. bug where script would try to kill their 'ghost' after they were dead, but still present nearby.
  29.                 Added toggle for auto harass.
  30.                 Change range color indicators.
  31.             Version: 1.05: http://pastebin.com/CcgW9n27
  32.                 Added Satchel Jump.
  33.                 Improved "Ultimate Mega Killsteal" calculation. Now operates on a hitchance curve. The further away the target is, the higher the hitchance required to throw the Bomb. Should reduce the number of cross-map misses. Will experiment with the settings after more feedback.
  34.                 Removed Satchel from normal combo.
  35.                 Added a secondary Full Combo option.
  36.             Version: 1.04: http://pastebin.com/z4nTWmkr
  37.                 Fixed Bouncing Bomb for full range prediction. Requires SAC 4.9 or later.
  38.             Version: 1.03 Beta: http://pastebin.com/kZED9bqV
  39.             Version: 1.02 Beta: http://pastebin.com/5CzSRtdL
  40.             Version: 1.01 Beta: http://pastebin.com/hx2RYDaQ
  41.             Version: 1.0 Beta: http://pastebin.com/bGa23bFR
  42. --]]
  43.  
  44. if myHero.charName ~= "Ziggs" then return end
  45.  
  46. local Target
  47.  
  48. -- Prediction
  49. local QRange = 850
  50. local QMaxRange = 1400
  51. local WRange = 1000
  52. local ERange = 900
  53. local RRange = 5300
  54.  
  55. local QSpeed = 1.722 -- Old: 1.2
  56. local WSpeed = 1.727 -- Old: 1.5
  57. local ESpeed = 2.694 -- Old: 1.45
  58. local RSpeed = 1.856 -- Old: 1.5
  59.  
  60. local QDelay = 218
  61. local WDelay = 249
  62. local EDelay = 125
  63. local RDelay = 1014
  64.  
  65. local QWidth = 150
  66. local WWidth = 225
  67. local EWidth = 250
  68. local RWidth = 550
  69.  
  70.  
  71.  
  72. local SkillQ = {spellKey = _Q, range = QMaxRange, speed = QSpeed, delay = QDelay, width = QWidth, configName = "bouncingbomb", displayName = "Q (Bouncing Bomb)", enabled = true, skillShot = true, minions = true, reset = false, reqTarget = true }
  73. local SkillW = {spellKey = _W, range = WRange, speed = WSpeed, delay = WDelay, width = WWidth, configName = "satchelcharge", displayName = "W (Satchel Charge)", enabled = true, skillShot = true, minions = false, reset = false, reqTarget = false }
  74. local SkillE = {spellKey = _E, range = ERange, speed = ESpeed, delay = EDelay, width = EWidth, configName = "hexplosiveminefield", displayName = "E (Hexplosive Minefield)", enabled = true, skillShot = true, minions = false, reset = false, reqTarget = false }
  75. local SkillR = {spellKey = _R, range = RRange, speed = RSpeed, delay = RDelay, width = RWidth, configName = "megainfernobomb", displayName = "R (Mega Inferno Bomb)", enabled = true, skillShot = true, minions = false, reset = false, reqTarget = true }
  76.  
  77. local KeyQ = string.byte("Q")
  78. local KeyW = string.byte("W")
  79. local KeyE = string.byte("E")
  80. local KeyR = string.byte("R")
  81.  
  82. local tick = nil
  83. local doUlt = false
  84.  
  85. -- Draw
  86. local waittxt = {}
  87. local calculationenemy = 1
  88. local floattext = {"Skills not available", "Able to fight", "Killable", "Murder him!"}
  89. local killable = {}
  90.  
  91. local ignite = nil
  92. local DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = nil, nil, nil, nil, nil, nil
  93. local QReady, WReady, EReady, RReady, DFGReady, HXGReady, BWCReady, IReady = false, false, false, false, false, false, false, false
  94.  
  95. local satchelChargeExists = false
  96. local pendingSatchelChargeActivation = nil
  97. local debugMode = false
  98.  
  99. -- Main
  100.  
  101. function Menu()
  102.     AutoCarry.PluginMenu:addParam("ZiggsCombo", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  103.     AutoCarry.PluginMenu:addParam("FullCombo", "Full Combo", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("Z"))
  104.     AutoCarry.PluginMenu:addParam("Harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("A"))
  105.     AutoCarry.PluginMenu:addParam("SatchelJump", "Satchel Jump", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("T"))
  106.     AutoCarry.PluginMenu:addParam("AutoHarass", "Auto Harass (Mana Intensive)", SCRIPT_PARAM_ONOFF, false)
  107.     AutoCarry.PluginMenu:addParam("ManaManager", "Mana Manager %", SCRIPT_PARAM_SLICE, 40, 0, 100, 2)
  108.     AutoCarry.PluginMenu:addParam("Ultimate", "Use Ultimate with Combo", SCRIPT_PARAM_ONOFF, true)
  109.     AutoCarry.PluginMenu:addParam("Killsteal", "Ultimate Mega Killsteal", SCRIPT_PARAM_ONOFF, true)
  110.     AutoCarry.PluginMenu:addParam("SmartFarmWithQ", "Smart Farm With Q", SCRIPT_PARAM_ONOFF, true)
  111.     AutoCarry.PluginMenu:addParam("KillstealMinHitchance", "Killsteal Min. Req. Hitchance", SCRIPT_PARAM_SLICE, 60, 0, 90, 0)
  112.     AutoCarry.PluginMenu:addParam("DrawKillablEenemy", "Draw Killable Enemy", SCRIPT_PARAM_ONOFF, true)
  113.     AutoCarry.PluginMenu:addParam("DrawText", "Draw Text", SCRIPT_PARAM_ONOFF, true)
  114.     AutoCarry.PluginMenu:addParam("DrawPrediction", "Draw Prediction", SCRIPT_PARAM_ONOFF, true)
  115.     AutoCarry.PluginMenu:addParam("Draw", "Draw range circles", SCRIPT_PARAM_ONOFF, true)
  116.     AutoCarry.PluginMenu:addParam("DrawUlt", "Draw Ult range circle", SCRIPT_PARAM_ONOFF, true)
  117. end
  118.  
  119. function PluginOnLoad()
  120.     Menu()
  121.  
  122.     AutoCarry.SkillsCrosshair.range = QMaxRange
  123.  
  124.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  125.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end
  126.     for i=1, heroManager.iCount do waittxt[i] = i*3 end
  127. end
  128.  
  129. function PluginOnTick()
  130.     tick = GetTickCount()
  131.     Target = AutoCarry.GetAttackTarget(true)
  132.  
  133.     SpellCheck()
  134.  
  135.     if IsTickReady(200) then
  136.         CalculateDamage()
  137.     end
  138.  
  139.     if AutoCarry.PluginMenu.SatchelJump then
  140.         SatchelJump()
  141.     end
  142.  
  143.     if (AutoCarry.MainMenu.AutoCarry or AutoCarry.MainMenu.MixedMode) then
  144.         Combo()
  145.     end
  146.    
  147.     if AutoCarry.PluginMenu.FullCombo then
  148.         FullCombo()
  149.     end
  150.  
  151.     if AutoCarry.PluginMenu.Harass then
  152.         Harass()
  153.     end
  154.  
  155.     if AutoCarry.PluginMenu.Killsteal and IsTickReady(50) then
  156.         KillSteal()
  157.     end
  158.    
  159.     if (AutoCarry.MainMenu.LaneClear or AutoCarry.MainMenu.MixedMode) and IsTickReady(50) and AutoCarry.PluginMenu.SmartFarmWithQ and not IsManaLow() then
  160.         SmartFarmWithQ()
  161.     end
  162. end
  163.  
  164. function IsTickReady(tickFrequency)
  165.     -- Improves FPS
  166.     if tick ~= nil and math.fmod(tick, tickFrequency) then
  167.         return true
  168.     else
  169.         return false
  170.     end
  171. end
  172.  
  173. function PluginOnCreateObj(obj)
  174.     if obj.name == "ZiggsW_mis_ground.troy" then
  175.         satchelChargeExists = true
  176.         CastWActivate()
  177.     end
  178. end
  179.  
  180. function PluginOnDeleteObj(obj)
  181.     if obj.name == "ZiggsW_mis_ground.troy" then
  182.         satchelChargeExists = false
  183.         pendingSatchelChargeActivation = nil
  184.     end
  185. end
  186.  
  187. function OnAttacked()
  188.     -- Auto AA > Q > AA
  189.     if AutoCarry.PluginMenu.AutoHarass and not IsManaLow() then
  190.         CastQ()
  191.     end
  192. end
  193.  
  194. function SpellCheck()
  195.     DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3128),
  196.     GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057),
  197.     GetInventorySlotItem(3078), GetInventorySlotItem(3100)
  198.  
  199.     QReady = (myHero:CanUseSpell(SkillQ.spellKey) == READY)
  200.     WReady = (myHero:CanUseSpell(SkillW.spellKey) == READY)
  201.     EReady = (myHero:CanUseSpell(SkillE.spellKey) == READY)
  202.     RReady = (myHero:CanUseSpell(SkillR.spellKey) == READY)
  203.  
  204.     DFGReady = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  205.     HXGReady = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  206.     BWCReady = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  207.     IReady = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  208. end
  209.  
  210. -- Handle SBTW Skill Shots
  211.  
  212. function Combo()
  213.     CastSlots()
  214.  
  215.     if not IsManaLow() or IsTargetHealthLow() then
  216.         CastE()
  217.     end
  218.  
  219.     CastQ()
  220.     Ultimate()
  221. end
  222.  
  223. function Ultimate()
  224.     if Target ~= nil and AutoCarry.PluginMenu.Ultimate and (doUlt or ((Target.health + 30) < getDmg("R", Target, myHero) and IsValidHitChanceCustom(SkillR, Target))) then
  225.         CastR()
  226.     end
  227. end
  228.  
  229. function FullCombo()
  230.     CastSlots()
  231.     CastE()
  232.     CastQ()
  233.     CastW()
  234.     CastWActivate()
  235.     Ultimate()
  236. end
  237.  
  238. function CastSlots()
  239.     if Target ~= nil and not Target.dead then
  240.         if GetDistance(Target) <= QMaxRange then
  241.             if DFGReady then CastSpell(DFGSlot, Target) end
  242.             if HXGReady then CastSpell(HXGSlot, Target) end
  243.             if BWCReady then CastSpell(BWCSlot, Target) end
  244.         end
  245.     end
  246. end
  247.  
  248. function Harass()
  249.     CastQ()
  250. end
  251.  
  252. function CastQ()
  253.     if Target ~= nil and not Target.dead then
  254.         if QReady and ValidTarget(Target, QRange) then
  255.             AutoCarry.CastSkillshot(SkillQ, Target)
  256.         elseif QReady and ValidTarget(Target, QMaxRange) then
  257.             -- Full Bouncing Bomb three bounce range
  258.             local PredictedPos = AutoCarry.GetPrediction(SkillQ, Target)
  259.  
  260.             if PredictedPos and AutoCarry.IsValidHitChance(SkillQ, Target) then
  261.                 local MyPos = Vector(myHero.x, myHero.y, myHero.z)
  262.                 local EnemyPos = Vector(PredictedPos.x, PredictedPos.y, PredictedPos.z)
  263.                 local CastPos = MyPos - (MyPos - EnemyPos):normalized() * QRange
  264.                 if CastPos and GetDistance(CastPos) < QMaxRange then
  265.                     -- CastSpell(SkillQ.spellKey, CastPos.x, CastPos.z)
  266.                     CastSkillshotBounce(SkillQ, CastPos)
  267.                 end
  268.             end
  269.         end
  270.     end
  271. end
  272.  
  273. function CastSkillshotBounce(skill, castPos)
  274.     if castPos and GetDistance(castPos) <= skill.range then
  275.         if not skill.minions or not AutoCarry.GetCollision(skill, myHero, castPos) then
  276.             CastSpell(skill.spellKey, castPos.x, castPos.z)
  277.         end
  278.     end
  279. end
  280.  
  281. function CastW(noTarget)
  282.     if noTarget and WReady then
  283.         -- Find vector from mousePos -> myHero
  284.         local vectorX,y,vectorZ = (Vector(myHero) - Vector(mousePos)):normalized():unpack()
  285.  
  286.         -- Cast Satchel behind myHero by specified distance, where behind is determined relative to mousePos -> myHero vector.
  287.         -- if hasBuff("Speed Shrine") then satchelDistance should be less, like 50.
  288.         local satchelDistance = 125
  289.         local posX = myHero.x + (vectorX * satchelDistance)
  290.         local posZ = myHero.z + (vectorZ * satchelDistance)
  291.         CastSpell(SkillW.spellKey, posX, posZ)
  292.     elseif Target ~= nil and ValidTarget(Target, WRange) and not Target.dead then
  293.         if WReady and GetDistance(Target) <= WRange then
  294.             AutoCarry.CastSkillshot(SkillW, Target)
  295.         end
  296.     end
  297. end
  298.  
  299. function CastWActivate()
  300.     if satchelChargeExists and pendingSatchelChargeActivation ~= nil then
  301.         if pendingSatchelChargeActivation == "satcheljump" then
  302.             -- Old delay method
  303.             -- local delayTime = 100
  304.             -- local endClockTime = GetTickCount() + delayTime
  305.             -- while (GetTickCount() < endClockTime) do
  306.             --  -- Sleep
  307.             -- end
  308.  
  309.             CastSpell(SkillW.spellKey)
  310.             CastE()
  311.             pendingSatchelChargeActivation = nil
  312.         end
  313.     end
  314. end
  315.  
  316. function CastE()
  317.     if Target ~= nil and ValidTarget(Target, ERange) and not Target.dead then
  318.         if EReady and GetDistance(Target) <= ERange then
  319.             AutoCarry.CastSkillshot(SkillE, Target)
  320.         end
  321.     end
  322. end
  323.  
  324. function CastR()
  325.     if Target ~= nil and ValidTarget(Target, RRange) and not Target.dead then
  326.         -- if RReady and GetDistance(Target) <= RRange then
  327.         enemyPos = AutoCarry.GetPrediction(SkillR, Target)
  328.         if RReady and enemyPos and ValidTarget(enemyPos, RRange) then
  329.             AutoCarry.CastSkillshot(SkillR, Target)
  330.         end
  331.     end
  332. end
  333.  
  334. function KillSteal()
  335.     for _, enemy in pairs(AutoCarry.EnemyTable) do
  336.         if ValidTarget(enemy, RRange) and not enemy.dead then
  337.             if (enemy.health + 30) < getDmg("R", enemy, myHero) and IsValidHitChanceCustom(SkillR, enemy) then
  338.                 enemyPos = AutoCarry.GetPrediction(SkillR, enemy)
  339.                 if RReady and enemyPos and GetDistance(enemyPos) < RRange then
  340.                     -- Message.AddMessage("Killsteal!", ColorARGB.Green, myHero)
  341.                     PrintFloatText(myHero, 10, "Ultimate Mega Killsteal!")
  342.                     if debugMode then PrintChat("Ultimate Mega Killsteal!") end
  343.                     AutoCarry.CastSkillshot(SkillR, enemy)
  344.                 end
  345.             end
  346.         end
  347.     end
  348. end
  349.  
  350. function SatchelJump()
  351.     -- E is cast before and after jump to insure that a target near either location can be hit.
  352.     pendingSatchelChargeActivation = "satcheljump"
  353.     CastW(true)
  354.     CastE()
  355. end
  356.  
  357. function SmartFarmWithQ()
  358.     local minions = {}
  359.     for _, minion in pairs(AutoCarry.EnemyMinions().objects) do
  360.         if ValidTarget(minion) and QReady and GetDistance(minion) <= QMaxRange then
  361.             if minion.health < getDmg("Q", minion, myHero) then
  362.                 table.insert(minions, minion)
  363.             end
  364.         end
  365.     end
  366.  
  367.     local pos1 = {x=0,z=0}
  368.     local pos1Count = 0
  369.     local pos2 = {x=0,z=0}
  370.     local pos2Count = 0
  371.  
  372.     local closeMinion = QWidth * 1.5
  373.  
  374.     for _, minion in pairs(minions) do
  375.         if pos1Count == 0 then
  376.             pos1.x = minion.x
  377.             pos1.z = minion.z
  378.             pos1Count = 1
  379.         elseif GetDistance(pos1, minion) < closeMinion then
  380.             pos1.x = ((pos1.x * pos1Count) + minion.x) / (pos1Count + 1)
  381.             pos1.z = ((pos1.z * pos1Count) + minion.z) / (pos1Count + 1)
  382.             pos1Count = pos1Count + 1
  383.         elseif pos2Count == 0 then
  384.             pos2.x = minion.x
  385.             pos2.z = minion.z
  386.             pos2Count = 1
  387.         elseif GetDistance(pos1, minion) < closeMinion then
  388.             pos2.x = ((pos2.x * pos2Count) + minion.x) / (pos2Count + 1)
  389.             pos2.z = ((pos2.z * pos2Count) + minion.z) / (pos2Count + 1)
  390.             pos2Count = pos2Count + 1
  391.         end
  392.     end
  393.  
  394.     if debugMode and (pos1Count > 1 or pos2Count > 1) then
  395.         PrintChat("pos1Count: "..pos1Count..", pos2Count: "..pos2Count)
  396.     end
  397.  
  398.     if pos1Count > pos2Count and pos1Count >= 2 then
  399.         CastSpell(SkillQ.spellKey, pos1.x, pos1.z)
  400.     elseif pos2Count >= 2 then
  401.         CastSpell(SkillQ.spellKey, pos2.x, pos2.z)
  402.     end
  403. end
  404.  
  405. function IsManaLow()
  406.     if myHero.mana < (myHero.maxMana * ( AutoCarry.PluginMenu.ManaManager / 100)) then
  407.         return true
  408.     else
  409.         return false
  410.     end
  411. end
  412.  
  413. function IsTargetHealthLow()
  414.     local targetLowHealth = .40
  415.  
  416.     if Target ~= nil and Target.health < (Target.maxHealth * targetLowHealth) then
  417.         return true
  418.     else
  419.         return false
  420.     end
  421. end
  422.  
  423. function IsTargetManaLow()
  424.     local targetLowMana = .15
  425.  
  426.     if Target ~= nil and Target.mana < (Target.maxMana * targetLowMana) then
  427.         return true
  428.     else
  429.         return false
  430.     end
  431. end
  432.  
  433. -- Sliding scale hitchance based on target distance.
  434. function getScalingHitChanceFromDistance(SkillRange, Target)
  435.     local minHitChance = AutoCarry.PluginMenu.KillstealMinHitchance
  436.     local maxHitChance = 95
  437.  
  438.     hitChance = minHitChance + ((1 - (SkillRange - GetDistance(Target)) / (SkillRange - 0))) * (maxHitChance - minHitChance)
  439.     if debugMode then PrintChat("HitChance Info: skillrange="..SkillRange..", targetdistance="..GetDistance(Target)..", hitchance:"..hitChance) end
  440.     return hitChance
  441. end
  442.  
  443. function IsValidHitChanceCustom(skill, target)
  444.     if VIP_USER then
  445.         pred = TargetPredictionVIP(skill.range, skill.speed*1000, skill.delay/1000, skill.width)
  446.         return pred:GetHitChance(target) > getScalingHitChanceFromDistance(skill.range, target)/100 and true or false
  447.     elseif not VIP_USER then
  448.         local nonVIPMaxHitChance = 70
  449.         return getScalingHitChanceFromDistance(skill.range, target) < nonVIPMaxHitChance and true or false
  450.     end
  451. end
  452.  
  453. --[[
  454. function satchelChargeExistsDelete()
  455.     for i=1, objManager.maxObjects do
  456.         local obj = objManager:getObject(i)
  457.  
  458.         if obj ~= nil and obj.name:find("Satchel Charge") then
  459.             return true
  460.         end
  461.     end
  462.     return false
  463. end
  464. --]]
  465.  
  466. -- Handle Manual Skill Shots
  467.  
  468. function PluginOnWndMsg(msg,key)
  469.     Target = AutoCarry.GetAttackTarget()
  470.     if Target ~= nil then
  471.         if msg == KEY_DOWN and key == KeyQ then CastQ() end
  472.         if msg == KEY_DOWN and key == KeyW then CastW() end
  473.         if msg == KEY_DOWN and key == KeyE then CastE() end
  474.         if msg == KEY_DOWN and key == KeyR then CastR() end
  475.     end
  476. end
  477.  
  478. -- Drawing
  479.  
  480. function PluginOnDraw()
  481.     if AutoCarry.PluginMenu.Draw then
  482.         DrawCircle(myHero.x, myHero.y, myHero.z, AutoCarry.SkillsCrosshair.range, 0x808080) -- Gray
  483.  
  484.         if myHero:CanUseSpell(SkillQ.spellKey) then
  485.             DrawCircle(myHero.x, myHero.y, myHero.z, QRange, 0x0099CC) -- Blue
  486.         end
  487.        
  488.         if myHero:CanUseSpell(SkillW.spellKey) then
  489.             DrawCircle(myHero.x, myHero.y, myHero.z, WRange, 0xFFFF00) -- Yellow
  490.         end
  491.        
  492.         if myHero:CanUseSpell(SkillE.spellKey) then
  493.             DrawCircle(myHero.x, myHero.y, myHero.z, ERange, 0x00FF00) -- Green
  494.         end
  495.  
  496.         if AutoCarry.PluginMenu.DrawUlt then
  497.             if myHero:CanUseSpell(SkillR.spellKey) then
  498.                 DrawCircle(myHero.x, myHero.y, myHero.z, RRange, 0xFF0000) -- Red
  499.             end
  500.         end
  501.  
  502.         Target = AutoCarry.GetAttackTarget()
  503.         if Target ~= nil then
  504.             for j=0, 10 do
  505.                 DrawCircle(Target.x, Target.y, Target.z, 40 + j*1.5, 0x00FF00) -- Green
  506.             end
  507.         end
  508.     end
  509.    
  510.     DrawKillable()
  511. end
  512.  
  513. function CalculateDamage()
  514.         if ValidTarget(Target) then
  515.                 local dfgdamage, hxgdamage, bwcdamage, ignitedamage, Sheendamage, Trinitydamage, LichBanedamage  = 0, 0, 0, 0, 0, 0, 0
  516.                 local pdamage = getDmg("P",Target,myHero)
  517.                 local qdamage = getDmg("Q",Target,myHero)
  518.                 local wdamage = getDmg("W",Target,myHero)
  519.                 local edamage = getDmg("E",Target,myHero)
  520.                 local rdamage = getDmg("R",Target,myHero)
  521.                 local hitdamage = getDmg("AD",Target,myHero)
  522.                 local dfgdamage = (DFGSlot and getDmg("DFG",Target,myHero) or 0)
  523.                 local hxgdamage = (HXGSlot and getDmg("HXG",Target,myHero) or 0)
  524.                 local bwcdamage = (BWCSlot and getDmg("BWC",Target,myHero) or 0)
  525.                 local ignitedamage = (ignite and getDmg("IGNITE",Target,myHero) or 0)
  526.                 local Sheendamage = (SheenSlot and getDmg("SHEEN",Target,myHero) or 0)
  527.                 local Trinitydamage = (TrinitySlot and getDmg("TRINITY",Target,myHero) or 0)
  528.                 local LichBanedamage = (LichBaneSlot and getDmg("LICHBANE",Target,myHero) or 0)
  529.                 local combo1 = hitdamage + qdamage + wdamage + edamage + rdamage + Sheendamage + Trinitydamage + LichBanedamage --0 cd
  530.                 local combo2 = hitdamage + Sheendamage + Trinitydamage + LichBanedamage
  531.                 local combo3 = hitdamage + Sheendamage + Trinitydamage + LichBanedamage
  532.                 local combo4 = 0
  533.                
  534.                 if QREADY then
  535.                         combo2 = combo2 + qdamage
  536.                         combo3 = combo3 + qdamage
  537.                         --combo4 = combo4 + qdamage
  538.                 end
  539.                 if WREADY then
  540.                         combo2 = combo2 + wdamage
  541.                         combo3 = combo3 + wdamage
  542.                 end
  543.                 if EREADY then
  544.                         combo2 = combo2 + edamage
  545.                         combo3 = combo3 + edamage
  546.                         --combo4 = combo4 + edamage
  547.                 end
  548.                 if RREADY then
  549.                         combo2 = combo2 + rdamage
  550.                         combo3 = combo3 + rdamage
  551.                         combo4 = combo4 + rdamage
  552.                 end
  553.                 if DFGREADY then        
  554.                         combo1 = combo1 + dfgdamage            
  555.                         combo2 = combo2 + dfgdamage
  556.                         combo3 = combo3 + dfgdamage
  557.                         --combo4 = combo4 + dfgdamage
  558.                 end
  559.                 if HXGREADY then              
  560.                         combo1 = combo1 + hxgdamage    
  561.                         combo2 = combo2 + hxgdamage
  562.                         combo3 = combo3 + hxgdamage
  563.                         --combo4 = combo4 + hxgdamage
  564.                 end
  565.                 if BWCREADY then
  566.                         combo1 = combo1 + bwcdamage
  567.                         combo2 = combo2 + bwcdamage
  568.                         combo3 = combo3 + bwcdamage
  569.                         combo4 = combo4 + bwcdamage
  570.                 end
  571.                 if IREADY then
  572.                         combo1 = combo1 + ignitedamage
  573.                         combo2 = combo2 + ignitedamage
  574.                         combo3 = combo3 + ignitedamage
  575.                 end
  576.                 if combo4 >= Target.health then killable[calculationenemy] = 4 doUlt = true
  577.                 elseif combo3 >= Target.health then killable[calculationenemy] = 3 doUlt = false
  578.                 elseif combo2 >= Target.health then killable[calculationenemy] = 2 doUlt = false
  579.                 elseif combo1 >= Target.health then killable[calculationenemy] = 1  doCombo = true doUlt = false
  580.                 else killable[calculationenemy] = 0 doCombo = false doUlt = false end
  581.         end
  582.         if calculationenemy == 1 then calculationenemy = heroManager.iCount
  583.         else calculationenemy = calculationenemy-1 end
  584. end
  585.  
  586. function DrawKillable()
  587.     if 1 == 2 and Target ~= nil and AutoCarry.PluginMenu.DrawPrediction then
  588.         if VIP_USER then
  589.             pred = TargetPredictionVIP(SkillQ.range, SkillQ.speed*1000, SkillQ.delay/1000, SkillQ.width)
  590.         elseif not VIP_USER then
  591.             pred = TargetPrediction(SkillQ.range, SkillQ.speed, SkillQ.delay, SkillQ.width)
  592.         end
  593.         predPos = pred:GetPrediction(Target)
  594.         DrawCircle(predPos.x, Target.y, predPos.z, 200, 0x0000FF)
  595.     end
  596.     for i=1, heroManager.iCount do
  597.         local enemydraw = heroManager:GetHero(i)
  598.         if ValidTarget(enemydraw) then
  599.             if AutoCarry.PluginMenu.DrawKillablEenemy then
  600.                 if killable[i] == 1 then
  601.                     for j=0, 20 do
  602.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0x0000FF)
  603.                     end
  604.                 elseif killable[i] == 2 then
  605.                     for j=0, 10 do
  606.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  607.                     end
  608.                 elseif killable[i] == 3 then
  609.                     for j=0, 10 do
  610.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  611.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
  612.                     end
  613.                 elseif killable[i] == 4 then
  614.                     for j=0, 10 do
  615.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  616.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
  617.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 140 + j*1.5, 0xFF0000)
  618.                     end
  619.                 end
  620.             end
  621.             if AutoCarry.PluginMenu.DrawText and waittxt ~= nil and waittxt[i] == 1 and killable ~= nil and killable[i] ~= 0 then
  622.                     PrintFloatText(enemydraw,0,floattext[killable[i]])
  623.             end
  624.         end
  625.         if waittxt ~= nil then
  626.             if waittxt[i] == 1 then waittxt[i] = 30
  627.             else waittxt[i] = waittxt[i]-1 end
  628.         end
  629.     end
  630. end
  631.  
  632. --[[
  633. class 'ColorARGB' -- {
  634.  
  635.     function ColorARGB:__init(red, green, blue, alpha)
  636.         self.R = red or 255
  637.         self.G = green or 255
  638.         self.B = blue or 255
  639.         self.A = alpha or 255
  640.     end
  641.  
  642.     function ColorARGB.FromArgb(red, green, blue, alpha)
  643.         return Color(red,green,blue, alpha)
  644.     end
  645.  
  646.     function ColorARGB:ToARGB()
  647.         return ARGB(self.A, self.R, self.G, self.B)
  648.     end
  649.  
  650.     ColorARGB.Red = ColorARGB(255, 0, 0, 255)
  651.     ColorARGB.Yellow = ColorARGB(255, 255, 0, 255)
  652.     ColorARGB.Green = ColorARGB(0, 255, 0, 255)
  653.     ColorARGB.Aqua = ColorARGB(0, 255, 255, 255)
  654.     ColorARGB.Blue = ColorARGB(0, 0, 255, 255)
  655.     ColorARGB.Fuchsia = ColorARGB(255, 0, 255, 255)
  656.     ColorARGB.Black = ColorARGB(0, 0, 0, 255)
  657.     ColorARGB.White = ColorARGB(255, 255, 255, 255)
  658. -- }
  659.  
  660. --Notification class
  661. class 'Message' -- {
  662.  
  663.     Message.instance = ""
  664.  
  665.     function Message:__init()
  666.         self.notifys = {}
  667.  
  668.         AddDrawCallback(function(obj) self:OnDraw() end)
  669.     end
  670.  
  671.     function Message.Instance()
  672.         if Message.instance == "" then Message.instance = Message() end return Message.instance
  673.     end
  674.  
  675.     function Message.AddMessage(text, color, target)
  676.         return Message.Instance():PAddMessage(text, color, target)
  677.     end
  678.  
  679.     function Message:PAddMessage(text, color, target)
  680.         local x = 0
  681.         local y = 200
  682.         local tempName = "Screen"
  683.         local tempcolor = color or ColorARGB.Red
  684.  
  685.         if target then  
  686.             tempName = target.networkID
  687.         end
  688.  
  689.         self.notifys[tempName] = { text = text, color = tempcolor, duration = GetGameTimer() + 2, object = target}
  690.     end
  691.  
  692.     function Message:OnDraw()
  693.         for i, notify in pairs(self.notifys) do
  694.             if notify.duration < GetGameTimer() then notify = nil
  695.             else
  696.                 notify.color.A = math.floor((255/2)*(notify.duration - GetGameTimer()))
  697.  
  698.                 if i == "Screen" then  
  699.                     local x = 0
  700.                     local y = 200
  701.                     local gameSettings = GetGameSettings()
  702.                     if gameSettings and gameSettings.General then
  703.                         if gameSettings.General.Width then x = gameSettings.General.Width/2 end
  704.                         if gameSettings.General.Height then y = gameSettings.General.Height/4 - 100 end
  705.                     end  
  706.                     --PrintChat(tostring(notify.color))
  707.                     local p = GetTextArea(notify.text, 40).x
  708.                     self:DrawTextWithBorder(notify.text, 40, x - p/2, y, notify.color:ToARGB(), ARGB(notify.color.A, 0, 0, 0))
  709.                 else    
  710.                     local pos = WorldToScreen(D3DXVECTOR3(notify.object.x, notify.object.y, notify.object.z))
  711.                     local x = pos.x
  712.                     local y = pos.y - 25
  713.                     local p = GetTextArea(notify.text, 40).x
  714.  
  715.                     self:DrawTextWithBorder(notify.text, 30, x- p/2, y, notify.color:ToARGB(), ARGB(notify.color.A, 0, 0, 0))
  716.                 end
  717.             end
  718.         end
  719.     end
  720.  
  721.     function Message:DrawTextWithBorder(textToDraw, textSize, x, y, textColor, backgroundColor)
  722.         DrawText(textToDraw, textSize, x + 1, y, backgroundColor)
  723.         DrawText(textToDraw, textSize, x - 1, y, backgroundColor)
  724.         DrawText(textToDraw, textSize, x, y - 1, backgroundColor)
  725.         DrawText(textToDraw, textSize, x, y + 1, backgroundColor)
  726.         DrawText(textToDraw, textSize, x , y, textColor)
  727.     end
  728. -- }
  729. --]]
Advertisement
Add Comment
Please, Sign In to add comment