16HeX16

Caitlyn KS

Apr 7th, 2013
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.27 KB | None | 0 0
  1. --[[ Caitlyn KS by HeX ]]--
  2. local qp = TargetPrediction(1300, 2.2, 641)
  3.  
  4. function OnLoad()
  5.     PrintChat("<font color='#CCCCCC'> >> Caitlyn KS loaded! <<</font>")
  6.     CKConfig = scriptConfig("CaitKS Config", "CaitKSConfig")
  7.     CKConfig:addParam("FireQ", "Fire Q", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  8.     CKConfig:addParam("autoUlt", "Ult when killable", SCRIPT_PARAM_ONKEYTOGGLE, true, 90)
  9.     CKConfig:permaShow("FireQ")
  10.     CKConfig:permaShow("autoUlt")
  11.     ts = TargetSelector(TARGET_LOW_HP, 1400, DAMAGE_PHYSICAL)
  12.     ts.name = "Caitlyn"
  13.     CKConfig:addTS(ts)
  14. end
  15.  
  16. function OnTick()  
  17.     ts:update()
  18.  
  19.     if CKConfig.FireQ and ts.target ~= nil then
  20.         predic = qp:GetPrediction(ts.target)
  21.         if predic ~= nil and myHero:CanUseSpell(_Q) == READY and GetDistance(predic) <= 1300 then
  22.             CastSpell(_Q, predic.x, predic.z)
  23.         end
  24.     end
  25.    
  26.     if CKConfig.autoUlt then
  27.         local rDmg = 0     
  28.         if myHero:CanUseSpell(_R) == READY then
  29.             for i = 1, heroManager.iCount, 1 do
  30.                 local target = heroManager:getHero(i)
  31.                 if ValidTarget(target) then
  32.                     rDmg = getDmg("R", target, myHero)
  33.                     if target ~= nil and target.team ~= myHero.team and not target.dead and target.visible and GetDistance(target) <= 3000 and target.health < rDmg then
  34.                         CastSpell(_R, target)
  35.                     end
  36.                 end
  37.             end
  38.         end
  39.     end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment