Guest User

Untitled

a guest
Apr 24th, 2013
16,090
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.82 KB | None | 0 0
  1. -- iCass made by Apple
  2. -- minor changes by burn
  3.  
  4. if myHero.charName ~= "Cassiopeia" then return end
  5.  
  6. --[[ Config ]]--
  7. local QDelay = 600
  8. local WDelay = 300
  9. local QRange = 850
  10. local ERange = 700
  11. local RRange = 850
  12. local BRKid, DFGid, EXECid, YOGHid, RANOid, BWCid, HXGid = 3153, 3128, 3123, 3142, 3143, 3144, 3146
  13. local BRKSlot, DFGSlot, EXECSlot, YOGHSlot, RANOSlot, BWCSlot, HXGSlot = nil, nil, nil, nil, nil, nil, nil
  14. --[[ Script Variables]]--
  15. local poisonedtimets = 0
  16. local poisonedtime = {}
  17. local ts = TargetSelector(TARGET_LOW_HP,QRange,DAMAGE_MAGIC, false)
  18. local abilitySequence = {1,3,2,1,1,4,1,3,1,2,4,3,2,3,2,4,3,2}
  19.  
  20. function OnLoad()
  21.     acConfig = scriptConfig("iCass", "iCass")  
  22.     acConfig:addParam("scriptActive","Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  23.     acConfig:addParam("harass", "Poke!", SCRIPT_PARAM_ONKEYDOWN, false, 65) --A
  24.     acConfig:addParam("CastUltimate", "Cast R", SCRIPT_PARAM_ONKEYDOWN, false, 82) --R
  25.     acConfig:addParam("SpamE", "Spam E?", SCRIPT_PARAM_ONOFF, true)
  26.     acConfig:addParam("KillE", "KS with E?", SCRIPT_PARAM_ONOFF, true)
  27.     acConfig:addParam("drawcircles","Draw Our Range", SCRIPT_PARAM_ONOFF, true)
  28.     acConfig:addParam("PMove","Move when Combo or Poke?", SCRIPT_PARAM_ONOFF, true)
  29.     acConfig:addParam("autolvl","Auto level?", SCRIPT_PARAM_ONOFF, true)
  30.     acConfig:permaShow("scriptActive")
  31.     acConfig:permaShow("CastUltimate")
  32.     acConfig:permaShow("SpamE")
  33.     ts.name = "Cassiopeia"
  34.     acConfig:addTS(ts)
  35.     for i=1, heroManager.iCount do poisonedtime[i] = 0 end
  36. end
  37.  
  38. function OnTick()
  39.     ts:update()
  40.    
  41.     if acConfig.autolvl then
  42.         if myHero:GetSpellData(_Q).level + myHero:GetSpellData(_W).level + myHero:GetSpellData(_E).level + myHero:GetSpellData(_R).level < myHero.level then
  43.             local spellSlot = { SPELL_1, SPELL_2, SPELL_3, SPELL_4, }
  44.             local level = { 0, 0, 0, 0 }
  45.             for i = 1, myHero.level, 1 do
  46.                 level[abilitySequence[i]] = level[abilitySequence[i]] + 1
  47.             end
  48.             for i, v in ipairs({ myHero:GetSpellData(_Q).level, myHero:GetSpellData(_W).level, myHero:GetSpellData(_E).level, myHero:GetSpellData(_R).level }) do
  49.                 if v < level[i] then LevelSpell(spellSlot[i]) end
  50.             end
  51.         end
  52.     end
  53.    
  54.     DFGSlot = GetInventorySlotItem(DFGid)
  55.     EXECSlot = GetInventorySlotItem(EXECid)
  56.     YOGHSlot = GetInventorySlotItem(YOGHid)
  57.     RANOSlot = GetInventorySlotItem(RANOid)
  58.     BWCSlot = GetInventorySlotItem(BWCid)
  59.     HXGSlot = GetInventorySlotItem(HXGid)
  60.     BRKSlot = GetInventorySlotItem(BRKid)
  61.    
  62.     if acConfig.CastUltimate and myHero:CanUseSpell(_R) == READY and ts.target ~= nil then
  63.         CastSpell(_R, ts.target.x, ts.target.z)
  64.     end
  65.    
  66.     if ValidTarget(ts.target) then poisonedtimets = poisonedtime[ts.index] end
  67.    
  68.     if acConfig.scriptActive or acConfig.harass then
  69.         if ValidTarget(ts.target, QRange) then
  70.             if myHero:CanUseSpell(_Q) == READY then
  71.                 local QPos = GetPredictionPos(ts.target, QDelay)
  72.                 if QPos ~= nil then
  73.                     CastSpell(_Q, QPos.x, QPos.z)
  74.                 end
  75.             end
  76.             if acConfig.scriptActive and myHero:CanUseSpell(_W) == READY then
  77.                 local WPos = GetPredictionPos(ts.target, WDelay)
  78.                 if WPos ~= nil then
  79.                     CastSpell(_W, WPos.x, WPos.z)
  80.                 end
  81.             end
  82.         end
  83.     end
  84.    
  85.     if ValidTarget(ts.target, ERange) and myHero:CanUseSpell(_E) == READY then
  86.         if acConfig.scriptActive or acConfig.SpamE or (getDmg("E", ts.target, myHero) > ts.target.health and acConfig.KillE) then
  87.             if (GetTickCount()-poisonedtimets < 2600) then
  88.                 if acConfig.scriptActive then
  89.                     if iReady(DFGSlot) then CastSpell(DFGSlot, ts.target) end
  90.                     if iReady(EXECSlot) then CastSpell(EXECSlot, ts.target) end
  91.                     if iReady(YOGHSlot) then CastSpell(YOGHSlot) end
  92.                     if iReady(RANOSlot) then CastSpell(RANOSlot, ts.target) end
  93.                     if iReady(BWCSlot) then CastSpell(BWCSlot, ts.target) end
  94.                     if iReady(HXGSlot) and not acConfig.KillHXG then CastSpell(HXGSlot, ts.target) end
  95.                     if iReady(BRKSlot) then CastSpell(BRKSlot, ts.target) end
  96.                 end
  97.                 CastSpell(_E, ts.target)
  98.             end
  99.         end
  100.     end
  101.     if acConfig.PMove and ts.target ~= nil and (acConfig.scriptActive or acConfig.harass) then myHero:MoveTo(mousePos.x, mousePos.z) end
  102. end
  103.  
  104. function OnCreateObj(obj)
  105.     if obj.name:find("Global_Poison") then
  106.         for i=1, heroManager.iCount do
  107.             local enemy = heroManager:GetHero(i)
  108.             if enemy.team ~= myHero.team and GetDistance(obj, enemy) < 80 then poisonedtime[i] = GetTickCount() end
  109.         end
  110.     end
  111. end
  112.  
  113. function iReady(itemslot)
  114.     if itemslot ~= nil and myHero:CanUseSpell(itemslot) then
  115.         return true
  116.     else
  117.         return false
  118.     end
  119. end
  120.  
  121. function OnDraw()
  122.     if not myHero.dead and acConfig.drawcircles then
  123.         DrawCircle(myHero.x, myHero.y, myHero.z, QRange, 0x25de69)
  124.         DrawCircle(myHero.x, myHero.y, myHero.z, ERange, 0xc2743c)
  125.         if ValidTarget(ts.target) then
  126.             DrawText("Targetting: " .. ts.target.charName, 15, 100, 100, 0xFFFF0000)
  127.             DrawCircle(ts.target.x, ts.target.y, ts.target.z, 100, 0xFF80FF00)
  128.         end
  129.     end
  130. end
Advertisement
Add Comment
Please, Sign In to add comment