Advertisement
Guest User

Cass-Helper-v1.3a-3-25-2012.lua

a guest
Mar 26th, 2013
1,564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.03 KB | None | 0 0
  1. --[[
  2.     Cassiopeia Combo 1.3b by eXtragoZ -- edited/modded by xkjtx
  3.             -- Using prediction added by xkjtx
  4.        
  5.     -Full combo: Items -> Q -> W -> E (if poisoned or low life)(configurable)
  6.         -Harass: Cast Q at target
  7.         -Ult hot-key: When hot key pressed(and target in range) Cass with cast Ult at your mouse position
  8.     -Supports Deathfire Grasp, Bilgewater Cutlass, Hextech Gunblade
  9.     -Target configuration
  10.     -Press shift to configure
  11.     I recommend using it with AIOSkillshots
  12. ]]--
  13.  
  14. if myHero.charName ~= "Cassiopeia" then return end
  15. --[[        Code        ]]
  16. local TSrange = 900
  17. local erange = 700
  18. local qwrrange = 845 -- lowered to make sure Q hits
  19. -- Active
  20. local poisonedtimets = 0
  21. local poisonedtime = {}
  22. -- draw
  23. -- ts
  24. local ts
  25. local travelDuration, predic = nil, nil
  26. local delay = 300
  27. local speed = 1.975
  28. --
  29. local ignite = nil
  30. local DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = nil, nil, nil, nil, nil, nil
  31. local QREADY, WREADY, EREADY, RREADY, DFGREADY, HXGREADY, BWCREADY, IREADY = false, false, false, false, false, false, false, false
  32.  
  33. function OnLoad()
  34.     CCConfig = scriptConfig("Cassiopeia Combo 1.3", "cassiopeiacombo")
  35.     CCConfig:addParam("scriptActive", "Active", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  36.     CCConfig:addParam("harassActive", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("S"))
  37.     CCConfig:addParam("ultActive", "Ult at Mouse Pos", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("R"))
  38.     CCConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  39.     CCConfig:addParam("useonlowhp", "Use E on low hp", SCRIPT_PARAM_ONOFF, true)
  40.     CCConfig:permaShow("scriptActive")
  41.     CCConfig:permaShow("harassActive")
  42.     CCConfig:permaShow("ultActive")
  43.     ts = TargetSelector(TARGET_LOW_HP,TSrange,DAMAGE_MAGIC)
  44.     ts.name = "Cassiopeia"
  45.     CCConfig:addTS(ts)
  46.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  47.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end
  48.     for i=1, heroManager.iCount do poisonedtime[i] = 0 end
  49. end
  50.  
  51. function OnTick()
  52.     ts:update()
  53.     DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100)
  54.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  55.     WREADY = (myHero:CanUseSpell(_W) == READY)
  56.     EREADY = (myHero:CanUseSpell(_E) == READY)
  57.     RREADY = (myHero:CanUseSpell(_R) == READY)
  58.     DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  59.     HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  60.     BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  61.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  62.     if ts.index ~= nil then poisonedtimets = poisonedtime[ts.index] end
  63.  
  64.     if ts.target ~= nil and not myHero.dead then
  65.         travelDuration = (delay + GetDistance(myHero, ts.target)/speed)
  66.         ts:SetPrediction(travelDuration)
  67.         predic = ts.nextPosition
  68.         if CCConfig.scriptActive then
  69.             if predic ~= nil and QREADY and GetDistance(predic) <= qwrrange then
  70.                 CastSpell(_Q, predic.x, predic.z)
  71.             end
  72.             if predic ~= nil and EREADY and GetDistance(predic) <= qwrrange then
  73.                 CastSpell(_W, predic.x, predic.z)
  74.             end
  75.             --[[if GetDistance(ts.target) <= erange and EREADY then
  76.                 CastSpell(_E, ts.target)
  77.             end]]
  78.             if GetDistance(ts.target) <= erange then
  79.                 myHero:Attack(ts.target)
  80.             end
  81.         end
  82.         if CCConfig.harassActive then
  83.             if predic ~= nil and QREADY and GetDistance(predic) <= qwrrange then
  84.                 CastSpell(_Q, predic.x, predic.z)
  85.             end
  86.         end
  87.     end
  88.  
  89.     --[[if CCConfig.harassActive and ts.target ~= nil then
  90.         if QREADY then
  91.             CastSpell(_Q, ts.target.x, ts.target.z)
  92.             myHero:Attack(ts.target)
  93.         end
  94.     end]]
  95.     if CCConfig.scriptActive and ts.target ~= nil then
  96.         if DFGREADY then CastSpell(DFGSlot, ts.target) end
  97.         if HXGREADY then CastSpell(HXGSlot, ts.target) end
  98.         if BWCREADY then CastSpell(BWCSlot, ts.target) end
  99.         --if QREADY then CastSpell(_Q, ts.target.x, ts.target.z) end
  100.         --if WREADY then CastSpell(_W, ts.target.x, ts.target.z) end
  101.         if EREADY and (GetTickCount()-poisonedtimets < 2600 or (getDmg("E", ts.target, myHero) >= ts.target.health and CCConfig.useonlowhp)) then
  102.             CastSpell(_E, ts.target)
  103.         end
  104.     end
  105.     if CCConfig.ultActive and ts.target ~= nil and GetDistance(ts.target)<=qwrrange then CastSpell(_R, mousePos.x, mousePos.z) end
  106. end
  107.  
  108. function OnCreateObj(obj)
  109.     if obj.name:find("Global_Poison") then
  110.         for i=1, heroManager.iCount do
  111.             local enemy = heroManager:GetHero(i)
  112.             if enemy.team ~= myHero.team and GetDistance(obj, enemy) < 80 then poisonedtime[i] = GetTickCount() end
  113.         end
  114.     end
  115. end
  116.  
  117. function OnDraw()
  118.     if CCConfig.drawcircles and not myHero.dead then
  119.         DrawCircle(myHero.x, myHero.y, myHero.z, erange, 0x19A712)
  120.         if ts.target ~= nil then
  121.             for j=0, 15 do
  122.                 DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  123.             end
  124.         end
  125.     end
  126. end
  127.  
  128. function OnSendChat(msg)
  129.     ts:OnSendChat(msg, "pri")
  130. end
  131. PrintChat(" >> Cassiopeia Combo 1.3 loaded!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement