Advertisement
Laggona

Darius - Wurf - v1.0.3

Nov 22nd, 2014
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.15 KB | None | 0 0
  1. -- Darius Wurf v1.0.3 --
  2. -- Edited 22/11/2014 --
  3. -- Created By: Laggona --
  4. if myHero.charName ~= "Darius" then return end
  5. ----- Declaring variables
  6. local tsE
  7. local tsQ
  8. local tsR
  9. local tsAA
  10. local target = heroManager:getHero(2)
  11. myHero = GetMyHero()
  12. local lastAttack, lastWindUpTime, lastAttackCD = 0, 0, 0
  13. local myTrueRange = 0
  14. PrintChat(" >> Darius - Wurf v1.0.3")
  15.  
  16. -- OnLoad Functions
  17. function OnLoad()
  18. -- Creating Config Menu -- In-Game Menu --
  19.   Config = scriptConfig("Darius - Wurf", "Darius Combo")
  20.                 Config:addSubMenu("drawing", "drawing")
  21.                 Config:addSubMenu("combo" , "combo")
  22.                
  23.         Config.drawing:addParam("drawCircle", "Draw Circle", SCRIPT_PARAM_ONOFF, true)
  24.                 Config.drawing:addParam("checkKillable", "Draw Killable", SCRIPT_PARAM_ONOFF, true)
  25.                
  26.         Config.combo:addParam("Combo", "E > W > Q > R", SCRIPT_PARAM_ONKEYDOWN, false, string.byte(" "))
  27.         Config.combo:addParam("Harass", "Perfect Q- Harass", SCRIPT_PARAM_ONKEYTOGGLE, false, string.byte("T"))
  28.                 Config.combo:addParam("Yolo", "Cast Ult Low HP", SCRIPT_PARAM_ONOFF, false)
  29.                
  30.         Config.combo:permaShow("Combo")
  31.                 Config.combo:permaShow("Harass")
  32.                
  33.     myTrueRange = myHero.range + GetDistance(myHero.minBBox)
  34.        
  35. -- Updating Target Finder/Target Selector
  36.         tsE = TargetSelector(TARGET_LOW_HP_PRIORITY,540)
  37.         tsQ = TargetSelector(TARGET_LOW_HP_PRIORITY,420)
  38.         tsR = TargetSelector(TARGET_LOW_HP_PRIORITY,460)
  39.         tsAA = TargetSelector(TARGET_LOW_HP_PRIORITY,325)
  40. end
  41.  
  42. -- On Draw Functions
  43. function OnDraw()
  44.         -- If DrawCircle config is true then display Circles
  45.         if(Config.drawing.drawCircle) then
  46.         DrawCircle(myHero.x, myHero.y, myHero.z, 420, 0xFF1919)
  47.         DrawCircle(myHero.x, myHero.y, myHero.z, 540, 0xFF1919)
  48.         DrawCircle(myHero.x, myHero.y, myHero.z, 460, 0xFF1919)
  49.         end
  50.                                
  51.                 if not myHero.dead then
  52.                         if Config.drawing.checkKillable then checkKillable() end
  53.                 end
  54.  end
  55.  
  56.  function checkKillable()
  57.         for _, enemy in ipairs(GetEnemyHeroes()) do
  58.                 if ValidTarget(enemy) and enemy.visible then
  59.                         local qDmg = getDmg("Q", target, myHero,3)
  60.                         local rDmg = getDmg("R", target, myHero,3)
  61.                        
  62.                         if enemy.health <= (rDmg + qDmg) then
  63.                                 DrawText3D(tostring("KILL HIM!!"), enemy.x, enemy.y, enemy.z, 20, ARGB(255, 225, 0, 00), true)
  64.                                 elseif enemy.health >= (qDmg * 4) then
  65.                                 DrawText3D(tostring("Just Wait"), enemy.x, enemy.y, enemy.z, 20, ARGB(255, 225, 0, 00), true)
  66.                         end
  67.                 end
  68.         end
  69. end
  70.                        
  71.         -- On tick Functions
  72. function OnTick()
  73.         -- Update Target Finder/Target Selector
  74.         tsE:update()
  75.         tsQ:update()
  76.         tsR:update()
  77.         tsAA:update()
  78.                                      
  79.         -- If TargetSelected"R" is not equal to false then Get rDmg
  80.         if (tsR ~= nil) then
  81.                         local rDmg = getDmg("R", target, myHero,3)
  82.         end
  83.                
  84.         -- If Config for auto harass is true then if target in range and spell ready use spell
  85.         if (Config.combo.Harass) then
  86.                                 for _, enemy in ipairs(GetEnemyHeroes()) do
  87.                 if ValidTarget(enemy) and enemy.visible then
  88.                                         if (tsQ.target ~= nil) and GetDistance(enemy) >= 271 and GetDistance(enemy) < 419 then
  89.                                                 if (myHero:CanUseSpell(_Q) == READY) then
  90.                         CastSpell(_Q, tsQ.target.x,tsQ.target.z)
  91.                         end
  92.                                         end
  93.                  end
  94.                         end
  95. end
  96. -- if Config for Combo is true then perform functions
  97. if (Config.combo.Combo) then
  98.  
  99.         if (tsE.target ~= nil) then  -- If target is not equal to false
  100.                 if (myHero:CanUseSpell(_E) == READY) then -- If my heros spell is available
  101.                         CastSpell(_E, tsE.target.x,tsE.target.z) -- Cast spell "E"
  102.                                 if (myHero:CanUseSpell(_W) == READY) then -- If my heros spell is avaiable
  103.                                         CastSpell(_W) -- Cast spell "W"
  104.                     end
  105.                  end
  106.                                  
  107.         if (myHero:CanUseSpell(_W) == READY) then CastSpell (_W) end
  108. end
  109.        
  110. if (tsQ.target ~= nil) then -- If target is not equal to false
  111.         if(myHero:CanUseSpell(_Q) == READY) then -- Can my hero use "Q"?      
  112.                 CastSpell(_Q, tsQ.target.x,tsQ.target.z) -- Cast spell "Q"
  113.         end
  114.     end
  115.        for _, enemy in ipairs(GetEnemyHeroes()) do
  116.                 if ValidTarget(enemy) and enemy.visible then -- If valid target enemy and the enemy visible
  117.                         local rDmg = getDmg("R", enemy, myHero, 3) -- Get damage for R, and apply to rDmg
  118.                                 if enemy.health <= rDmg and GetDistance(enemy) <= 460 then -- If enemys health is less than R's Dmg
  119.                     if (tsR ~= nil) then
  120.                         if(myHero:CanUseSpell(_R) == READY) then -- If my hero can use R
  121.                             CastSpell(_R, tsR.target) -- Cast spell "R" on target.
  122.                             end
  123.                         end
  124.                     end
  125.                 end
  126.             end
  127.         end
  128.  
  129. if (Config.combo.Combo) then
  130.         _OrbWalk()
  131. end
  132.  
  133.  
  134. if (Config.combo.Yolo) then
  135. if (myHero.health <= myHero.maxHealth * 0.20) then
  136.     for _, enemy in ipairs(GetEnemyHeroes()) do
  137.                 if ValidTarget(enemy) and enemy.visible then
  138.                     if  GetDistance(enemy) < 460 then
  139.                         if (tsR ~= nil) then
  140.                             if(myHero:CanUseSpell(_R) == READY) then -- If my hero can use R
  141.                                 CastSpell(_R, tsR.target) -- Cast spell "R" on target.
  142.                             end
  143.                         end
  144.                     end
  145.                 end
  146.             end
  147.         end
  148. end
  149.        
  150. end
  151.  
  152. function OnProcessSpell(object, spell)
  153.     if object == myHero then
  154.         if spell.name:lower():find("attack") then
  155.             lastAttack = GetTickCount() - GetLatency()/2
  156.             lastWindUpTime = spell.windUpTime*1000
  157.             lastAttackCD = spell.animationTime*1000
  158.         end
  159.     end
  160. end
  161.  
  162. function _OrbWalk()
  163.     myTarget = GetTarget()
  164.     if myTarget ~=nil and GetDistance(myTarget ) <= myTrueRange then       
  165.         if timeToShoot() then
  166.             myHero:Attack(myTarget )
  167.         elseif heroCanMove()  then
  168.             moveToCursor()
  169.         end
  170.     else       
  171.         moveToCursor()
  172.     end
  173. end
  174.  
  175. function heroCanMove()
  176.     return (GetTickCount() + GetLatency()/2 > lastAttack + lastWindUpTime + 20)
  177. end
  178.  
  179. function timeToShoot()
  180.     return (GetTickCount() + GetLatency()/2 > lastAttack + lastAttackCD)
  181. end
  182.  
  183. function moveToCursor()
  184.     if GetDistance(mousePos) > 1 then
  185.         local moveToPos = myHero + (Vector(mousePos) - myHero):normalized()*300
  186.         myHero:MoveTo(moveToPos.x, moveToPos.z)
  187.     end
  188. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement