Illprotectjew

IPJs Malz Ver 2.0

May 26th, 2014
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.38 KB | None | 0 0
  1. require 'Utils'
  2. require 'winapi'
  3. require 'SKeys'
  4. require 'vals_lib'
  5. local uiconfig = require 'uiconfig'
  6. local Q,W,E,R = 'Q','W','E','R'
  7. local version = '1.0'
  8. local Wtimer = GetTickCount()
  9. local Etimer = GetTickCount()
  10. local Rtimer = GetTickCount()
  11. local Itimer = GetTickCount()
  12. local Btimer = GetTickCount()
  13.  
  14.  cfg, menu = uiconfig.add_menu('IPJ Malzahar Config', 200)
  15.     menu.keydown('Combo', 'Combo', Keys.Y)
  16.     menu.keytoggle('Killsteal', 'Killsteal', Keys.A)
  17.     menu.keytoggle('Harass', 'Harrass', Keys.X)
  18.     menu.permashow('Combo')
  19.     menu.permashow('Killsteal')
  20.     menu.permashow('Harass')
  21. function Main()
  22.     if IsLolActive() and myHero.name == 'Malzahar' then
  23.         SetScriptTimer(10)
  24.         GetCD()
  25.         CheckItemCD()
  26.         SetVariables()
  27.         if cfg.Killsteal then
  28.         Killsteal()
  29.         end
  30.         local target = GetWeakEnemy('MAGIC',700)
  31.             if cfg.Combo then
  32.                 SpellTarget(E,QRDY,myHero,target,650)
  33.                 SpellPred(W,WRDY,myHero,target,650,1.5,99)
  34.                 SpellPred(Q,QRDY,myHero,target,650,2,99)
  35.                
  36.             end
  37.             if cfg.Harass then
  38.                 SpellTarget(E,QRDY,myHero,target,650)
  39.             end
  40.         if myHero.dead==0 and target~=nil then CustomCircle(75,15,2,target) end
  41.         if myHero.dead==0 then CustomCircle(645,3,3,myHero) end
  42.         if myHero.dead==0 then CustomCircle(650,1,2,myHero) end
  43.         if myHero.dead==0 then CustomCircle(655,3,4,myHero) end
  44.        
  45.     end
  46. end
  47.  
  48. function Killsteal()
  49.     for i = 1, objManager:GetMaxHeroes() do
  50.         local enemy = objManager:GetHero(i)
  51.         if enemy~=nil and enemy.team~=myHero.team and enemy.visible==1 and enemy.invulnerable==0 and enemy.dead==0 then
  52.  
  53.             local xQ = (25+(myHero.SpellLevelQ*55)+(myHero.ap*.8))*QRDY
  54.             local xW = (enemy.maxHealth/100)*(myHero.SpellLevelW+3+GG)
  55.             local xE = (20+(myHero.SpellLevelE*55)+(myHero.ap*.8))/4
  56.             local xR = (100+(myHero.SpellLevelR*150)+(myHero.ap*1.3))*RRDY
  57.             if GetMap() == 0 or GetMap() == 2 then
  58.                 xDFG = 0
  59.                 xBFT = (enemy.maxHealth*.2)/4
  60.             else xDFG = (enemy.maxHealth*.15)*DFG
  61.                 xBFT = 0
  62.             end
  63.             local xI = 50+(myHero.selflevel*20)/5
  64.            
  65.             if WRDY==1 or GetTickCount()+1000<Wtimer then
  66.                 True_W = xW*3
  67.             elseif GetTickCount()+1000>Wtimer and WRDY==0 then
  68.                 True_W = xW*2
  69.             elseif GetTickCount()+2000>Wtimer and WRDY==0 then
  70.                 True_W = xW
  71.             elseif GetTickCount()+3000>Wtimer and WRDY==0 then
  72.                 True_W = 0
  73.             end
  74.             if ERDY==1 or GetTickCount()+1000<Etimer then
  75.                 True_E = xE*4
  76.             elseif GetTickCount()+1000>Etimer and ERDY==0 then
  77.                 True_E = xE*3
  78.             elseif GetTickCount()+2000>Etimer and ERDY==0 then
  79.                 True_E = xE*2
  80.             elseif GetTickCount()+3000>Etimer and ERDY==0 then
  81.                 True_E = xE
  82.             elseif GetTickCount()+4000>Etimer and ERDY==0 then
  83.                 True_E = 0
  84.             end
  85.             if IGN==1 or GetTickCount()+1000<Itimer then
  86.                 True_I = xI*5
  87.             elseif GetTickCount()+1000>Itimer and IGN==0 then
  88.                 True_I = xI*4
  89.             elseif GetTickCount()+2000>Itimer and IGN==0 then
  90.                 True_I = xI*3
  91.             elseif GetTickCount()+3000>Itimer and IGN==0 then
  92.                 True_I = xI*2
  93.             elseif GetTickCount()+4000>Itimer and IGN==0 then
  94.                 True_I = xI
  95.             elseif GetTickCount()+5000>Itimer and IGN==0 then
  96.                 True_I = 0
  97.             end
  98.             if BFT==1 or GetTickCount()+1000<Btimer then
  99.                 True_BFT = xBFT*4
  100.             elseif GetTickCount()+1000>Btimer and BFT==0 then
  101.                 True_BFT = xBFT*3
  102.             elseif GetTickCount()+2000>Btimer and BFT==0 then
  103.                 True_BFT = xBFT*2
  104.             elseif GetTickCount()+3000>Btimer and BFT==0 then
  105.                 True_BFT = xBFT
  106.             elseif GetTickCount()+4000>Btimer and BFT==0 then
  107.                 True_BFT = 0
  108.             end
  109.             local effh = (enemy.health)*(1+((((enemy.magicArmor-(20*TrueMG))*myHero.magicPenPercent)-myHero.magicPen)/100))
  110.             DrawText('Damage = '..(xQ+True_W+True_E+xR+xDFG+True_BFT+True_I)+(((xQ+True_W+True_E+xR)*.2)*math.max(Debuff1(enemy),Debuff2())),70,170,Color.White)
  111.             DrawText('Health = '..effh,70,180,Color.White)
  112.             if effh<((xQ+True_W+True_E+xR+xDFG+True_BFT+True_I)+(((xQ+True_W+True_E+xR)*.2)*math.max(Debuff1(enemy),Debuff2())))*.975 and RRDY==1 and effh>xR*.75 then
  113.                
  114.                 DrawTextObject('KILL HIM',enemy,Color.Yellow)
  115.                 if GetDistance(enemy)<600 then
  116.                    
  117.                    
  118.                     if ERDY==1 then CastSpellTarget('E',target) end
  119.                     Bspell(enemy)
  120.                     if WRDY==1 then CastSpellXYZ('W',enemy.x,enemy.y,enemy.z) end
  121.                     if IGN==1 then CastSummonerIgnite(enemy) end
  122.                     if QRDY==1 then CastSpellXYZ('Q',enemy.x,enemy.y,enemy.z) end
  123.                     if RRDY==1 then CastSpellTarget('R',target) end
  124.                 end
  125.             end
  126.         end
  127.     end
  128. end
  129.    
  130. function Debuff1(target)
  131.     if (IsBuffedR(target,'TT_BlackfireTorch',150) or IsBuffedR(target,'obj_DeathfireGrasp_debuff',150)) or IsBuffedR(target,'ItemBlackfireTorch_mis',700) or IsBuffedR(target,'deathFireGrasp_mis',700) then
  132.         return 1
  133.     else
  134.         return 0
  135.     end
  136. end
  137. function Debuff2()
  138.     if (BFT+DFG)==1 then
  139.         return 1
  140.     else
  141.         return 0
  142.     end
  143. end
  144.  
  145. function Bspell(target)
  146.     if target~=nil then
  147.         UseItemOnTarget(3188, target)
  148.         UseItemOnTarget(3128, target)
  149.     end
  150. end
  151.  
  152. function OnCreateObj()
  153.     if obj~=nil and target~=nil and GetDistance(target,obj)<125 then
  154.         if obj.charName == 'AlzaharNullZoneFlash.troy' then Wtimer = GetTickCount() end -- 2,5 sec
  155.         if obj.charName == 'AlzaharMaleficVisions_tar.troy' then Etimer = GetTickCount() end -- 4 sec
  156.         if obj.charName == 'AlZaharNetherGrasp_tar.troy' then Rtimer = GetTickCount() end -- 2,5 sec
  157.         if obj.charName == 'Global_SS_Ignite.troy' then Itimer = GetTickCount() end -- 5 sec
  158.         if obj.charName == 'TT_BlackfireTorch.troy' and BFT==0 then Btimer = GetTickCount() -- 4 sec
  159.         end
  160.     end
  161. end
  162.  
  163. function SetVariables()
  164.     target = GetWeakEnemy('MAGIC',10000)
  165.     if GetInventorySlot(3001)~=nil then TrueMG = 1 else TrueMG = 0 end
  166.     if myHero.ap<100 then GG = 0
  167.     elseif myHero.ap>=100 and myHero.ap<199 then GG = 1
  168.     elseif myHero.ap>=200 and myHero.ap<299 then GG = 2
  169.     elseif myHero.ap>=300 and myHero.ap<399 then GG = 3
  170.     elseif myHero.ap>=400 and myHero.ap<499 then GG = 4
  171.     elseif myHero.ap>=500 and myHero.ap<599 then GG = 5
  172.     elseif myHero.ap>=600 and myHero.ap<699 then GG = 6
  173.     elseif myHero.ap>=700 and myHero.ap<799 then GG = 7
  174.     elseif myHero.ap>=800 and myHero.ap<899 then GG = 8
  175.     elseif myHero.ap>=900 and myHero.ap<999 then GG = 9
  176.     elseif myHero.ap>=1000 then GG = 10 end
  177. end
  178.  
  179. function IsBuffedR(target,name,range)
  180.     for i = 1, objManager:GetMaxObjects(), 1 do
  181.         obj = objManager:GetObject(i)
  182.         if obj~=nil and target~=nil and string.find(obj.charName,name) and ((range~= nil and GetDistance(obj, target) < range) or GetDistance(obj, target) < 150) then
  183.             return true
  184.         end
  185.     end
  186. end
  187.  
  188. SetTimerCallback('Main')
Advertisement
Add Comment
Please, Sign In to add comment