Guest User

Apple iZed v1.2

a guest
Nov 22nd, 2012
5,864
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.92 KB | None | 0 0
  1. --[[ iZed by Apple
  2.  
  3. Spacebar for PewPew!
  4. T for Poke!]]--
  5.  
  6. if myHero.charName ~= "Zed" then return end
  7.  
  8. require "AllClass"
  9.  
  10. --[[ Config ]]--
  11. local HK1 = 32 -- PewPew! Hotkey
  12. local HK2 = 84 -- Harass Hotkey
  13.  
  14. --[[ Constants ]]--
  15. local QRange = 900
  16. local WRange = 550
  17. local ERange = 290
  18. local RRange = 625
  19. local DFGid, EXECid, YOGHid, RANOid, BWCid, HXGid = 3128, 3123, 3142, 3143, 3144, 3146
  20. local DFGSlot, EXECSlot, YOGHSlot, RANOSlot, BWCSlot, HXGSlot = nil, nil, nil, nil, nil, nil
  21.  
  22. --[[ Script Variables ]]--
  23. local ts = TargetSelector(TARGET_LOW_HP,QRange)
  24. local tp = TargetPrediction(QRange, 1.17, 200, 50) -- Need proper variables
  25. local prediction
  26. local clone
  27.  
  28. function OnLoad()
  29.     acConfig = scriptConfig("iZed", "zedhelper")
  30.     acConfig:addParam("scriptActive", "PewPew!", SCRIPT_PARAM_ONKEYDOWN, false, HK1)
  31.     acConfig:addParam("harass", "Poke!", SCRIPT_PARAM_ONKEYDOWN, false, HK2)
  32.     acConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  33.     acConfig:addParam("onlynuke", "Only items when ult?", SCRIPT_PARAM_ONOFF, true)
  34.     acConfig:permaShow("scriptActive")
  35.     acConfig:permaShow("harass")
  36.     ts.name = "Zed"
  37.  
  38.     acConfig:addTS(ts)
  39.  
  40.     clone = nil
  41. end
  42.  
  43. function OnTick()
  44.     ts:update()
  45.     if acConfig.scriptActive then PewPew() end
  46.     if acConfig.harass then Poke() end
  47.     DFGSlot = GetInventorySlotItem(DFGid)
  48.     EXECSlot = GetInventorySlotItem(EXECid)
  49.     YOGHSlot = GetInventorySlotItem(YOGHid)
  50.     RANOSlot = GetInventorySlotItem(RANOid)
  51.     BWCSlot = GetInventorySlotItem(BWCid)
  52.     HXGSlot = GetInventorySlotItem(HXGid)
  53. end
  54.  
  55. function PewPew()
  56.     ts:update()
  57.     if TargetValid(ts.target) then
  58.         if myHero:CanUseSpell(_R) == READY and GetDistance(ts.target) < RRange then
  59.             CastSpell(_R, ts.target)
  60.             if iReady(DFGSlot) then CastSpell(DFGSlot, ts.target) end
  61.             if iReady(EXECSlot) then CastSpell(EXECSlot, ts.target) end
  62.             if iReady(YOGHSlot) then CastSpell(YOGHSlot) end
  63.             if iReady(RANOSlot) then CastSpell(RANOSlot, ts.target) end
  64.             if iReady(BWCSlot) then CastSpell(BWCSlot, ts.target) end
  65.             if iReady(HXGSlot) then CastSpell(HXGSlot, ts.target) end
  66.         elseif clone ~= nil then
  67.             if myHero:CanUseSpell(_W) == READY and ts.target:GetDistance(clone) < 125 and ts.target:GetDistance(clone) < GetDistance(ts.target) then
  68.                 CastSpell(_W)
  69.             end
  70.         end
  71.     end
  72.     if myHero:CanUseSpell(_E) == READY or myHero:CanUseSpell(_Q) == READY then
  73.         if TargetValid(ts.target) and clone == nil and myHero:CanUseSpell(_W) == READY and (GetDistance(ts.target) < (WRange + QRange) or GetDistance(ts.target) < (WRange + ERange)) then
  74.             CastSpell(_W, ts.target)
  75.         end
  76.         for i=1, heroManager.iCount do
  77.             local enemy = heroManager:GetHero(i)
  78.             if enemy.team ~= player.team and enemy ~= nil then
  79.                 if acConfig.onlynuke == false and GetDistance(ts.target) < ERange then
  80.                     if iReady(DFGSlot) then CastSpell(DFGSlot, ts.target) end
  81.                     if iReady(EXECSlot) then CastSpell(EXECSlot, ts.target) end
  82.                     if iReady(YOGHSlot) then CastSpell(YOGHSlot) end
  83.                     if iReady(RANOSlot) then CastSpell(RANOSlot, ts.target) end
  84.                     if iReady(BWCSlot) then CastSpell(BWCSlot, ts.target) end
  85.                     if iReady(HXGSlot) then CastSpell(HXGSlot, ts.target) end
  86.                 end
  87.                 if clone ~= nil then
  88.                     if enemy:GetDistance(clone) < ERange or GetDistance(enemy) < ERange then
  89.                         CastSpell(_E)
  90.                     end
  91.                 elseif GetDistance(enemy) < ERange then
  92.                     CastSpell(_E)
  93.                 end
  94.                 if clone ~= nil then
  95.                     if enemy:GetDistance(clone) < QRange and GetDistance(enemy) < QRange then
  96.                         TargetPrediction__OnTick()
  97.                         prediction = tp:GetPrediction(enemy)
  98.                         if prediction ~= nil then
  99.                             CastSpell(_Q,prediction.x, prediction.z)
  100.                         end
  101.                     elseif enemy:GetDistance(clone) < QRange or GetDistance(enemy) < QRange then
  102.                         TargetPrediction__OnTick()
  103.                         prediction = tp:GetPrediction(enemy)
  104.                         if prediction ~= nil then
  105.                             CastSpell(_Q,prediction.x, prediction.z)
  106.                         end
  107.                     end
  108.                 elseif GetDistance(enemy) < QRange then
  109.                     TargetPrediction__OnTick()
  110.                     prediction = tp:GetPrediction(enemy)
  111.                     if prediction ~= nil then
  112.                         CastSpell(_Q,prediction.x, prediction.z)
  113.                     end
  114.                 end
  115.             end
  116.         end
  117.     end
  118. end
  119.  
  120. function Poke()
  121.     ts:update()
  122.     if TargetValid(ts.target) and GetDistance(ts.target) < WRange + QRange then
  123.         if clone == nil and myHero:CanUseSpell(_W) == READY then
  124.             EnemyPos = Vector(ts.target.x,ts.target.z)
  125.             HeroPos = Vector(myHero.x,myHero.z)
  126.             ClonePos = HeroPos + ( HeroPos - EnemyPos ):normalized() * (-0.5)
  127.             CastSpell(_W, ClonePos.x, ClonePos.z)
  128.             TargetPrediction__OnTick()
  129.             prediction = tp:GetPrediction(ts.target)
  130.             if prediction ~= nil then
  131.                 CastSpell(_Q,prediction.x, prediction.z)
  132.             end
  133.         else
  134.             TargetPrediction__OnTick()
  135.             prediction = tp:GetPrediction(ts.target)
  136.             if prediction ~= nil then
  137.                 CastSpell(_Q,prediction.x, prediction.z)
  138.             end
  139.         end
  140.     end
  141. end
  142.  
  143. function OnCreateObj(obj)
  144.     if obj.name:find("Zed_Clone_idle.troy") then
  145.         clone = obj
  146.     end
  147. end
  148.  
  149. function OnDeleteObj(obj)
  150.     if obj.name:find("Zed_Clone_idle.troy") then
  151.         clone = nil
  152.     end            
  153. end
  154.  
  155. function TargetValid(target)
  156.     if target ~= nil and target.dead == false and target.team == TEAM_ENEMY and target.visible == true then
  157.         return true
  158.     else
  159.         return false
  160.     end
  161. end
  162.  
  163. function iReady(itemslot)
  164.     if itemslot ~= nil and myHero:CanUseSpell(itemslot) then
  165.         return true
  166.     else
  167.         return false
  168.     end
  169. end
  170.  
  171. function OnDraw()
  172.     if acConfig.drawcircles and not myHero.dead then
  173.         DrawCircle(myHero.x,myHero.y,myHero.z, QRange, 0xFF80FF00)
  174.         if ts.target ~= nil then
  175.             DrawText("Targetting: " .. ts.target.charName, 18, 100, 100, 0xFFFF0000)
  176.             DrawCircle(ts.target.x, ts.target.y, ts.target.z, 100, 0xFF80FF00)
  177.         end
  178.         if clone ~= nil then
  179.             DrawCircle(clone.x, clone.y, clone.z, ERange, 0xFFFF0000)
  180.         elseif ClonePos ~= nil then
  181.             DrawCircle(ClonePos.x, ClonePos.y, ClonePos.z, 100, 0xFFFF0000)
  182.         end
  183.     end
  184.     SC__OnDraw()
  185. end
  186.  
  187. function OnWndMsg(msg,key)
  188.     SC__OnWndMsg(msg,key)
  189. end
Advertisement
Add Comment
Please, Sign In to add comment