Advertisement
Guest User

Karthus

a guest
Aug 16th, 2015
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.37 KB | None | 0 0
  1. OnLoop(function(myHero)
  2.     killableInfo()
  3.     local target = GetCurrentTarget()
  4.     if ValidTarget(target, math.huge) then
  5.         -- DrawText(GetObjectName(target),20,0,150,0xff00ff00)
  6.         if KeyIsDown(32) then
  7.             castE(target)
  8.             castW(target)
  9.             castQ(target)
  10.         end
  11.     end
  12. end)
  13.  
  14. function castQ( target )
  15.     -- CastStartPosVec,EnemyChampionPtr,EnemyMoveSpeed,YourSkillshotSpeed,SkillShotDelay,SkillShotRange,SkillShotWidth,MinionCollisionCheck,AddHitBox;
  16.     pred = GetPredictionForPlayer(GetOrigin(target),target,GetMoveSpeed(target),math.huge,500,GetCastRange(myHero,_Q),200,false,true)
  17.     if IsInDistance(target, GetCastRange(myHero,_Q)) and CanUseSpell(myHero,_Q) == READY and pred.HitChance == 1 then  
  18.         CastSkillShot(_Q,pred.PredPos.x,pred.PredPos.y,pred.PredPos.z)
  19.     end
  20. end
  21.  
  22. function castW( target )
  23.     -- CastStartPosVec,EnemyChampionPtr,EnemyMoveSpeed,YourSkillshotSpeed,SkillShotDelay,SkillShotRange,SkillShotWidth,MinionCollisionCheck,AddHitBox;
  24.     pred = GetPredictionForPlayer(GetOrigin(target),target,GetMoveSpeed(target),math.huge,500,GetCastRange(myHero,_W),800,false,true)
  25.     if IsInDistance(target, GetCastRange(myHero,_W)) and CanUseSpell(myHero,_W) == READY and pred.HitChance == 1 then  
  26.         CastSkillShot(_W,pred.PredPos.x,pred.PredPos.y,pred.PredPos.z)
  27.     end
  28. end
  29.  
  30. function castE( target )
  31.     -- open E
  32.     if IsInDistance(target, GetCastRange(myHero,_E)) and CanUseSpell(myHero,_E) == READY and GotBuff(myHero,"KarthusDefile") <= 0 then
  33.         CastTargetSpell(myHero, _E)
  34.     end
  35.  
  36.     -- close E
  37.     if not IsInDistance(target, GetCastRange(myHero,_E)) and GotBuff(myHero,"KarthusDefile") > 0 then
  38.         CastTargetSpell(myHero, _E)
  39.     end
  40. end
  41.  
  42. function killableInfo()
  43.     -- no need show killable info when R in cd
  44.     if CanUseSpell(myHero,_R) ~= READY then return end
  45.  
  46.     rDmg = 100 + GetCastLevel(myHero,_R) * 150 + GetBonusAP(myHero) * 0.6
  47.     -- info = "R dmg : "..rDmg .. "\n"
  48.     info = ""
  49.     for nID, enemy in pairs(GetEnemyHeroes()) do
  50.         if IsObjectAlive(enemy) then
  51.             realdmg = CalcDamage(myHero, enemy, 0, rDmg)
  52.             hp = GetCurrentHP(enemy)
  53.             if realdmg > hp then
  54.                 info = info..GetObjectName(enemy)
  55.                 if not IsVisible(enemy) then
  56.                     info = info.." maybe"
  57.                 end
  58.                 info = info.."  killable\n"
  59.             end
  60.             -- info = info..GetObjectName(enemy).."    HP:"..hp.."  dmg: "..realdmg.." "..killable.."\n"
  61.         end
  62.   end
  63.   DrawText(info,40,500,0,0xffff0000)
  64. end
  65.  
  66. PrintChat("simple karthus script loaded")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement