Advertisement
Guest User

Brand-v1.0017.lua

a guest
Mar 7th, 2013
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.44 KB | None | 0 0
  1. --Brand-v1.0017
  2. --[[
  3.         Unlimited
  4.         --Modded/Edited/made to work, by xkjtx
  5.         -Attack Range(650) -- Redish
  6.         -- All ability ranges turn off while on CD
  7.             -Ability(Range) -- Color : On/Off Toggle :
  8.             -Q Range(900) -- Blueish
  9.             -W Range(900) -- Orangeish
  10.             -E Range(625) -- Greenish
  11.             -R Range(900) -- Purpleish
  12.         -Prediction Range(80 on the target) -blueish purple(tried to get a light version)
  13.  
  14.         -- Better to harass first, then after harass press combo key
  15.  
  16.         -Move to mouse works with Harass Hot-Key only! When harassing make sure they are moving so the prediction is good..
  17.  
  18.         -Known Bug...
  19.             -Some times you are unable to cast spells yourself. Turn off KS hot-key(Toggle Off) and you should be able to cast spells yourself.
  20.  
  21.  
  22. ]]
  23.  
  24. if myHero.charName ~= "Brand" then return end
  25.  
  26.     local player = GetMyHero()
  27.  
  28.     local comboKey = 32 -- Space
  29.     local harassKey = string.byte("S") -- S
  30.     local ksKey = string.byte("X") -- X
  31.  
  32.     local kill = {}
  33.     local range = 550
  34.     local range2 = 750
  35.     local qrange = 900
  36.     local erange = 625
  37.     local travelduration = 780
  38.     local predic
  39.     local DFGSlot, HXGSlot = nil, nil
  40.     local HXGREADY, DFGREADY, QREADY, WREADY, EREADY, RREADY = false, false, false, false, false, false
  41.  
  42.     local ts = TargetSelector(TARGET_LOW_HP,qrange,DAMAGE_MAGIC,true) -- TRUE so you .can' select your target!!! Will default when not selected.. Good for jungle and farming.
  43.     local delay = 100
  44.     local qspeed = 1.2
  45.     local startAttackSpeed = 0.625
  46.     local lastBasicAttack = 0
  47.     local swingDelay = 0.15
  48.     local swing = 0
  49.     local burntime = 0
  50.  
  51.     function OnLoad()
  52.         PrintChat(">> Brand-v1.0017 Loaded!")
  53.         acConfig = scriptConfig("UnlimitedBrand", "Brand-v1.0017")
  54.         acConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, comboKey) -- Space
  55.         acConfig:addParam("harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, harassKey) -- S -- will auto Q and R on killable target
  56.         acConfig:addParam("killsteal", "Auto kill", SCRIPT_PARAM_ONKEYTOGGLE, false, ksKey) -- X -- Off by default to try and fix an issue --
  57.         acConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  58.         acConfig:addParam("abilityRange", "Ability Circles", SCRIPT_PARAM_ONOFF, true) -- Turn off and on when on/off CD
  59.         acConfig:addParam("minionP", "Use minion prediction", SCRIPT_PARAM_ONOFF, true)
  60.         acConfig:addParam("moveMe", "Move to mouse", SCRIPT_PARAM_ONOFF, true) -- only works with harass
  61.         acConfig:permaShow("scriptActive")
  62.         acConfig:permaShow("harass")
  63.         acConfig:permaShow("killsteal")
  64.         acConfig:permaShow("minionP")
  65.         acConfig:permaShow("moveMe")
  66.         ts.name = "Brand"
  67.         acConfig:addTS(ts)
  68.         lastBasicAttack = os.clock()
  69.     end
  70.  
  71.     function OnCreateObj(obj)
  72.         if obj ~= nil and string.find(obj.name, "BrandFireMark") then
  73.             for i=1, heroManager.iCount do
  74.                 local enemy = heroManager:GetHero(i)
  75.                 if enemy.team ~= myHero.team and GetDistance(obj,enemy) < erange then
  76.                     burntime = GetTickCount()
  77.                     burned = true
  78.                 end
  79.             end
  80.         end
  81.     end
  82.  
  83.     function OnDeleteObj(obj)
  84.         if obj ~= nil and string.find(obj.name, "BrandFireMark") then
  85.             for i=1, heroManager.iCount do
  86.                 local enemy = heroManager:GetHero(i)
  87.                 if enemy.team ~= myHero.team and GetDistance(obj,enemy) < erange then
  88.                     burntime = GetTickCount()
  89.                     burned = false
  90.                 end
  91.             end
  92.         end
  93.     end
  94.  
  95.     function OnTick()
  96.         ts:update()
  97.  
  98.         if myHero.dead then
  99.             return
  100.         end
  101.  
  102.         if ts.target ~= nil then
  103.             travelduration = (delay + GetDistance(myHero, ts.target)/qspeed)
  104.             ts:SetPrediction(travelduration)
  105.             predic = ts.nextPosition
  106.             AttackDelay = (1000/(myHero.attackSpeed/(1/startAttackSpeed)))/1000 -- 1/(myHero.attackSpeed*startAttackSpeed)
  107.             if swing == 1 and os.clock() > lastBasicAttack + AttackDelay then
  108.                 swing = 0
  109.             end
  110.  
  111.             if acConfig.scriptActive and ts.target ~= nil then -- Works for multiple hot-keys
  112.                 if GetDistance(ts.target) <= range+150 and swing == 0 then
  113.                     myHero:Attack(ts.target) -- only need one myHero:Attack and here it is..
  114.                 end
  115.             end
  116.         end
  117.        
  118.         QREADY = (myHero:CanUseSpell(_Q) == READY)
  119.         WREADY = (myHero:CanUseSpell(_W) == READY)
  120.         EREADY = (myHero:CanUseSpell(_E) == READY)
  121.         RREADY = (myHero:CanUseSpell(_R) == READY)
  122.  
  123.         HXGSlot = GetInventorySlotItem(3146)
  124.         DFGSlot = GetInventorySlotItem(3128)
  125.         HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  126.         DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  127.         Damage()
  128.  
  129.         if acConfig.scriptActive then
  130.             if ts.target ~= nil and GetDistance(ts.target) <= erange then
  131.                 if ValidTarget(ts.target, 750) then
  132.                     if DFGREADY then CastSpell(DFGSlot, ts.target) end
  133.                     if HXGREADY then CastSpell(HXGSlot, ts.target) end
  134.                 end
  135.                 if EREADY then
  136.                     CastSpell(_E, ts.target)
  137.                 end
  138.                 if predic ~= nil and QREADY and GetTickCount() - burntime < 3600 and burned then
  139.                     if acConfig.minionP and not GetMinionCollision(myHero,ts.nextPosition,70) then
  140.                         CastSpell(_Q, predic.x, predic.z)
  141.                     elseif not acConfig.minionP then ----------------- This added -deni
  142.                         CastSpell(_Q, predic.x, predic.z)
  143.                     end
  144.                 end
  145.                 if WREADY and not ts.target.canMove then -- Will not cast until target cant move
  146.                     CastSpell(_W, ts.target.x, ts.target.z)
  147.                 end
  148.                 if WREADY and myHero:CanUseSpell(_Q) == COOLDOWN and GetDistance(ts.target) <= qrange then
  149.                 -- Will cast even if target can move(predicts location) TARGET MUST BE MOVING~~! -- Better to harass first, then press combo key
  150.                     CastSpell(_W, predic.x, predic.z)
  151.                 end
  152.                 if ts.target ~= nil and RREADY and not ts.target.canMove and myHero:CanUseSpell(_Q) == COOLDOWN and myHero:CanUseSpell(_W) == COOLDOWN and myHero:CanUseSpell(_E) == COOLDOWN then
  153.                     CastSpell(_R, ts.target)
  154.                 end
  155.             end
  156.         end
  157.  
  158.         if acConfig.harass then
  159.             if acConfig.moveMe then
  160.                 player:MoveTo(mousePos.x, mousePos.z) -- move to mouse(will not AA while moving, but will cast all spells)
  161.             end
  162.             if ts.target ~= nil then
  163.                 if WREADY and predic ~= nil and GetDistance(ts.target) <= qrange then -- Will cast even if target can move(predicts location)
  164.                     CastSpell(_W, predic.x, predic.z)
  165.                 end
  166.                 if burned and EREADY and GetDistance(ts.target) <= erange then
  167.                     CastSpell(_E, ts.target)
  168.                 end
  169.                 if predic ~= nil and QREADY and GetDistance(ts.target) <= qrange and burned then
  170.                     if acConfig.minionP and not GetMinionCollision(myHero,ts.nextPosition,70) then
  171.                         CastSpell(_Q, predic.x, predic.z)
  172.                     elseif not acConfig.minionP then ----------------- This added -deni
  173.                         CastSpell(_Q, predic.x, predic.z)
  174.                     end
  175.                 end
  176.             end
  177.         end
  178.  
  179.         if acConfig.killsteal and not acConfig.scriptActive and not acConfig.harass and ts.target ~= nil then
  180.             for i=1, heroManager.iCount do
  181.                 local enemy = heroManager:GetHero(i)
  182.                 local rdmg = getDmg("R",enemy,myHero)
  183.                 local edmg = getDmg("E",enemy,myHero)
  184.                 if edmg > enemy.health and myHero:GetDistance(enemy) <= erange and myHero:CanUseSpell(_E) == READY then
  185.                     CastSpell(_E,enemy)
  186.                 elseif rdmg > enemy.health and myHero:GetDistance(enemy) <= range2 and myHero:CanUseSpell(_R) == READY then
  187.                     CastSpell(_R,enemy)
  188.                 end
  189.             end
  190.         end
  191.     end
  192.  
  193.     function Damage()
  194.         ts:update()
  195.         for i=1, heroManager.iCount do
  196.             local dfgdamage = 0
  197.             local enemy = heroManager:GetHero(i)
  198.             local qdmg = getDmg("Q",enemy,myHero)
  199.             local wdmg = getDmg("W",enemy,myHero)
  200.             local edmg = getDmg("E",enemy,myHero)
  201.             local rdmg = getDmg("R",enemy,myHero)
  202.             local dfgdamage = (DFGSlot and getDmg("DFG",enemy,myHero) or 0)
  203.        
  204.             local possible = qdmg + edmg + wdmg + rdmg + dfgdamage
  205.             local thatkill = 0
  206.            
  207.             if myHero:CanUseSpell(_Q) == READY then
  208.                 thatkill = thatkill + qdmg
  209.             end
  210.        
  211.             if myHero:CanUseSpell(_E) == READY  then
  212.                 thatkill = thatkill + edmg
  213.             end
  214.            
  215.             if myHero:CanUseSpell(_W) == READY  then
  216.                 thatkill = thatkill + wdmg
  217.             end
  218.            
  219.             if myHero:CanUseSpell(_R) == READY  then
  220.                 thatkill = thatkill + rdmg
  221.             end
  222.            
  223.             if DFGREADY then   
  224.                 thatkill = thatkill + dfgdamage
  225.             end
  226.        
  227.             if thatkill >= enemy.health then
  228.                 kill[i] = 2
  229.             elseif possible>= enemy.health then
  230.                 kill[i] = 1
  231.             else
  232.                 kill[i] = 0
  233.             end
  234.         end
  235.     end
  236.  
  237.     function OnProcessSpell(unit, spell)
  238.         if unit.isMe and spell and spell.name and spell.name:lower():find("attack") then
  239.             swing = 1
  240.             lastBasicAttack = os.clock()
  241.         end
  242.     end
  243.  
  244.     function OnDraw()
  245.         if myHero.dead then
  246.             return
  247.         end
  248.  
  249.         if acConfig.drawcircles then
  250.             DrawCircle(myHero.x, myHero.y, myHero.z, range+100, 0xFF0000) -- Attack range -- Redish -Always on
  251.             if acConfig.abilityRange then -- on/off toggle in menu
  252.                 if QREADY then
  253.                     DrawCircle(myHero.x, myHero.y, myHero.z, qrange, 0x0000CC) -- Q range -- Blueish
  254.                 end
  255.                 if WREADY then
  256.                     DrawCircle(myHero.x, myHero.y, myHero.z, qrange, 0xFF6600) -- W range -- Orangeish
  257.                 end
  258.                 if EREADY then
  259.                     DrawCircle(myHero.x, myHero.y, myHero.z, erange, 0x009900) -- E range -- Greenish
  260.                 end
  261.                 if RREADY then
  262.                     DrawCircle(myHero.x, myHero.y, myHero.z, qrange, 0x990099) -- R range -- Purpleish(Also when Q and W are not on CD)
  263.                 end
  264.             end
  265.             if predic ~= nil and ts.target ~= nil then
  266.                 DrawCircle(predic.x, predic.y, predic.z, 80, 0x000099) -- blueish purple(tried to get a light version)
  267.             end
  268.         end
  269.  
  270.         if acConfig.drawcircles and ts.target ~= nil then
  271.             for i=1, heroManager.iCount do
  272.                 local enemydraw = heroManager:GetHero(i)
  273.                 if ValidTarget(enemydraw) then
  274.                     if kill[i] == 1 then
  275.                         PrintFloatText(enemydraw,0,"Cooldown")
  276.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 100, 0xFF80FF00)
  277.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 150, 0xFF80FF00)
  278.                     elseif kill[i] == 2 then
  279.                         PrintFloatText(enemydraw,0,"MURDER!")
  280.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 100, 0xFF80FF00)
  281.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 150, 0xFF80FF00)
  282.                         DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 200, 0xFF80FF00) 
  283.                     end
  284.                 end
  285.             end
  286.         end
  287.     end
  288.  
  289.     function OnWndMsg(msg,key)
  290.         if key == kshk then
  291.             if msg == KEY_DOWN then
  292.                 if ks then
  293.                     ks = false
  294.                     PrintChat("Auto KillSteal Disabled!")
  295.                 else
  296.                     ks = true
  297.                     PrintChat("Auto KillSteal Enabled!")
  298.                 end
  299.             end
  300.         end
  301.     end
  302.  
  303.     function OnSendChat(msg)
  304.         ts:OnSendChat(msg, "pri")
  305.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement