mkc

Yorick - The world will end in Zombies (03/08/13)

mkc
Mar 7th, 2013
1,660
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.80 KB | None | 0 0
  1. -- ###################################################################################################### --
  2. -- #                                 Yorick - The world will end in zombies!                            # --
  3. -- #                                      by mkc based on Unlimited's                                   # --
  4. -- ###################################################################################################### --
  5.  
  6. if myHero.charName ~= "Yorick" then return end
  7.  
  8. -- ########### Configuration ############
  9.  
  10. local range = 125
  11. local wrange = 600
  12. local erange = 550
  13.  
  14. local kill = {}
  15. local ts = TargetSelector(TARGET_LOW_HP,erange,DAMAGE_MAGIC,false)
  16. local player = GetMyHero()
  17. local percent = 10 -- It will launch ult with 10% hp left.
  18.  
  19. -- ########### End of configuration ############
  20.  
  21. function OnLoad()
  22.  
  23. YConfig = scriptConfig("Yorick - The world will end in Zombies", "YorickCombo")
  24. YConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  25. YConfig:addParam("harass", "Harass (E + W)", SCRIPT_PARAM_ONKEYDOWN, false, 84)
  26. YConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  27. YConfig:addParam("useult","Use Ult",SCRIPT_PARAM_ONOFF, true)
  28. YConfig:permaShow("scriptActive")
  29. YConfig:permaShow("harass")
  30. ts.name = "Yorick"
  31. YConfig:addTS(ts)
  32. end
  33.  
  34. function OnTick()
  35.     ts:update()
  36.     Damage()
  37.     if ts.target ~= nil and YConfig.harass and GetDistance(ts.target)<wrange then
  38.         CastSpell(_W,ts.target.x,ts.target.z)
  39.         CastSpell(_E,ts.target)
  40.     end
  41.    
  42.     if myHero:GetSpellData(_R).level > 0 and myHero:CanUseSpell(_R) == READY and ts.target ~= nil and player.health < player.maxHealth*(percent/100) and YConfig.useult then
  43.         CastSpell(_R)
  44.         CastSpell(_R,ts.target)
  45.     end
  46.  
  47.     if ts.target ~= nil and YConfig.scriptActive and GetDistance(ts.target)<erange then
  48.         CastSpell(_W,ts.target.x,ts.target.z)
  49.         CastSpell(_Q)
  50.         myHero:Attack(ts.target)
  51.         CastSpell(_E,ts.target)
  52.         myHero:Attack(ts.target)
  53.     end
  54. end
  55.  
  56. function Damage()
  57.     ts:update()
  58.     for i=1, heroManager.iCount do
  59.    
  60.         if ts.target ~= nil then
  61.             local enemy = ts.target
  62.             local qdmg = getDmg("Q",enemy,myHero)
  63.             local wdmg = getDmg("W",enemy,myHero)
  64.             local edmg = getDmg("E",enemy,myHero)
  65.             local aa = getDmg("AD",enemy,myHero)
  66.             local possible = qdmg + wdmg + edmg + aa
  67.             local thatkill = 0
  68.    
  69.         if myHero:CanUseSpell(_Q) == READY then
  70.             thatkill = thatkill + qdmg + aa
  71.         end
  72.    
  73.         if myHero:CanUseSpell(_W) == READY then
  74.             thatkill = thatkill + wdmg
  75.         end
  76.        
  77.         if myHero:CanUseSpell(_E) == READY then
  78.             thatkill = thatkill + edmg
  79.         end
  80.    
  81.         if thatkill >= enemy.health then
  82.             kill[i] = 2
  83.             elseif possible>= enemy.health then
  84.             kill[i] = 1
  85.             else
  86.             kill[i] = 0
  87.         end
  88.     end
  89. end
  90. end
  91.  
  92. function OnDraw()
  93.     if YConfig.drawcircles and not myHero.dead then
  94.             DrawCircle(myHero.x,myHero.y,myHero.z, 550, 0xFF80FF00)
  95.             if YConfig.scriptActive then
  96.             DrawText("Script Active",18,100,80,0xFF80FF00)
  97.             end
  98.             if YConfig.harass then
  99.             DrawText("Harass",18,100,80,0xFF80FF00)
  100.             end
  101.        
  102.         if ts.target ~= nil then
  103.             DrawText("Targetting: " .. ts.target.charName, 18, 100, 100, 0xFFFF0000)
  104.             DrawCircle(ts.target.x, ts.target.y, ts.target.z, 100, 0xFF80FF00)
  105.         end
  106.        
  107.         for i=1, heroManager.iCount do
  108.             local enemydraw = heroManager:GetHero(i)
  109.             if ts.target ~= nil then
  110.                 if ValidTarget(enemydraw) then
  111.                     if kill[i] == 1 then
  112.                         PrintFloatText(enemydraw,0,"Cooldown")
  113.                         DrawCircle(ts.target.x, ts.target.y, ts.target.z, 100, 0xFF80FF00)
  114.                     elseif kill[i] == 2 then
  115.                         PrintFloatText(enemydraw,0,"Kill!")
  116.                         DrawCircle(ts.target.x, ts.target.y, ts.target.z, 100, 0xFF80FF00)
  117.                         DrawCircle(ts.target.x, ts.target.y, ts.target.z, 150, 0xFF80FF00)
  118.                     end
  119.                 end
  120.             end
  121.         end
  122.     end
  123. end
  124.  
  125.  
  126. PrintChat(" >> Yorick - The world will end in Zombies!")
Advertisement
Add Comment
Please, Sign In to add comment