Advertisement
Guest User

Caitlyn-myMod.lua

a guest
Apr 11th, 2013
939
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.22 KB | None | 0 0
  1. --[[
  2.         Caitlyn
  3.  
  4.     AesConfig version 0.4 beta By Puze aka Bestplox
  5.  
  6.         --xkjtx modded to his liking..
  7. ]]--
  8.  
  9.  
  10. -- RANGE
  11. local ERange = 1000
  12. -- PREDICTION
  13. local QPredic = TargetPrediction(1300, 2.2, 610) -- Range , Speed, Delay
  14. local WPredic = TargetPrediction(800)
  15. local EPredic = TargetPrediction(1000, 0, 8)
  16. -- Misc
  17. local ignite = nil
  18. local IREADY = false
  19.  
  20.  
  21. function OnLoad()
  22.     --PrintChat(" >> Caitlyn combo loaded!")
  23.     Config = scriptConfig("Caitlyn Combo", "ConfigCombo")
  24.     Config:addParam("combo", "Use Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32) -- SpaceBar
  25.     Config:addParam("ult", "Use ult", SCRIPT_PARAM_ONKEYTOGGLE, false, 88) -- X
  26.     Config:addParam("trap", "Trap under enemy", SCRIPT_PARAM_ONKEYDOWN, false, 83) -- S
  27.     Config:addParam("autoignite", "Use ignite", SCRIPT_PARAM_ONOFF, false) -- I use my own
  28.     Config:addParam("net", "Use net in combo", SCRIPT_PARAM_ONKEYTOGGLE, false, 86) -- V
  29.     Config:addParam("movement", "Move to mouse", SCRIPT_PARAM_ONOFF, true) -- only moves with Trap hot-key
  30.     Config:addParam("draw", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  31.     Config:permaShow("ult")
  32.     Config:permaShow("net")
  33.     ts = TargetSelector(TARGET_LOW_HP, 1400, DAMAGE_PHYSICAL, true) -- setting to true, gives the option to focus your own target
  34.     ts.name = "Caitlyn"
  35.     Config:addTS(ts)
  36.    
  37.     enemyMinions = minionManager(MINION_ENEMY, 1200, player)
  38.  
  39.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then
  40.         ignite = SUMMONER_1
  41.     elseif
  42.         myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then
  43.         ignite = SUMMONER_2
  44.     end
  45. end
  46.  
  47. function OnTick()
  48.     ts:update()
  49.     enemyMinions:update()
  50.    
  51.  
  52. -- COMBO   
  53.     if Config.combo and ts.target ~= nil then
  54.         -- Q
  55.         QPredict = QPredic:GetPrediction(ts.target)
  56.         if myHero:CanUseSpell(_Q) == READY and QPredict ~= nil and GetDistance(QPredict) <= 1300 then
  57.             CastSpell(_Q, QPredict.x, QPredict.z)
  58.         end
  59.        
  60.         -- E
  61.         EPredict = EPredic:GetPrediction(ts.target)
  62.         if myHero:CanUseSpell(_E) == READY and EPredict ~= nil and Config.net and GetDistance(EPredict) <= 1000 then
  63.             if not minionCollision(EPredict, 60, ERange) then
  64.                 CastSpell(_E, EPredict.x, EPredict.z)
  65.             end
  66.         end
  67.     end
  68.  
  69. -- TRAP
  70.     if Config.trap and ts.target ~= nil then
  71.         WPredict = WPredic:GetPrediction(ts.target)
  72.         if myHero:CanUseSpell(_W) == READY and WPredict ~= nil then
  73.             CastSpell(_W, WPredict.x, WPredict.z)
  74.         end
  75.     end
  76.    
  77.             -- Auto Attack -- Will only AA after casting spells in Combo
  78.         if ts.target ~= nil and Config.combo and GetDistance(ts.target) <= 850 then
  79.             myHero:Attack(ts.target)
  80.         end
  81.        
  82.  
  83. -- MOVE TO MOUSE
  84.     if Config.movement and Config.trap then -- taken out :  or Config.combo
  85.         myHero:MoveTo(mousePos.x, mousePos.z)
  86.     end
  87.  
  88. -- Ultimate
  89.     if Config.ult then
  90.         local rDmg = 0     
  91.         if myHero:CanUseSpell(_R) == READY then
  92.             for i = 1, heroManager.iCount, 1 do
  93.                 local target = heroManager:getHero(i)
  94.                 if ValidTarget(target) then
  95.                     rDmg = (getDmg("R", target, myHero) - 100)
  96.                     if target ~= nil and target.team ~= myHero.team and not target.dead and target.visible and GetDistance(target) <= 3000
  97.                     and target.health < rDmg and GetDistance(target) >= 400 then
  98.                         CastSpell(_R, target)
  99.                     end
  100.                 end
  101.             end
  102.         end
  103.     end
  104.  
  105. -- Ignite
  106.     if Config.autoignite then
  107.         IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)    
  108.         if IREADY then
  109.             local ignitedmg = 0    
  110.             for j = 1, heroManager.iCount, 1 do
  111.                 local enemyhero = heroManager:getHero(j)
  112.                     if ValidTarget(enemyhero,600) then
  113.                         ignitedmg = 50 + 20 * myHero.level
  114.                             if enemyhero.health <= ignitedmg then
  115.                                 CastSpell(ignite, enemyhero)
  116.                             end
  117.                     end
  118.             end
  119.         end
  120.     end
  121.  
  122.  
  123. -- Draw
  124. function OnDraw()
  125.     if Config.draw then
  126.         if myHero:CanUseSpell(_Q) == READY then
  127.             DrawCircle(myHero.x, myHero.y, myHero.z, 1300, 0xFF0000)
  128.         end
  129.         if myHero:CanUseSpell(_E) == READY then
  130.             DrawCircle(myHero.x, myHero.y, myHero.z, 1000, 0xFF0000)
  131.         end
  132.         DrawCircle(myHero.x, myHero.y, myHero.z, 650, 0xFF0000) -- real AA range
  133.     end
  134.  
  135. end
  136.  
  137. -- Minion Collision
  138. function minionCollision(predic, width, range)
  139.         for _, minionObjectE in pairs(enemyMinions.objects) do
  140.                 if predic ~= nil and player:GetDistance(minionObjectE) < range then
  141.                         ex = player.x
  142.                         ez = player.z
  143.                         tx = predic.x
  144.                         tz = predic.z
  145.                         dx = ex - tx
  146.                         dz = ez - tz
  147.                         if dx ~= 0 then
  148.                                 m = dz/dx
  149.                                 c = ez - m*ex
  150.                         end
  151.                         mx = minionObjectE.x
  152.                         mz = minionObjectE.z
  153.                         distanc = (math.abs(mz - m*mx - c))/(math.sqrt(m*m+1))
  154.                         if distanc < width and math.sqrt((tx - ex)*(tx - ex) + (tz - ez)*(tz - ez)) > math.sqrt((tx - mx)*(tx - mx) + (tz - mz)*(tz - mz)) then
  155.                                 return true
  156.                         end
  157.                 end
  158.         end
  159.     return false
  160.     end
  161. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement