Kain2030

OnDraw Bugsplat Test.lua

Sep 5th, 2013
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.39 KB | None | 0 0
  1. local ts = TargetSelector(TARGET_LOW_HP, 1200, DAMAGE_PHYSICAL, true)
  2.  
  3. function OnLoad()
  4.     MyConfig = scriptConfig("OnDraw Bugsplat Test", "OnDraw Bugsplat Test")
  5.     MyConfig:addParam("DrawRanges", "Draw Ranges", SCRIPT_PARAM_ONOFF, false)
  6.     MyConfig:addParam("DrawArrow", "Draw Arrow", SCRIPT_PARAM_ONOFF, true)
  7.  
  8.     PrintChat(">> OnDraw Bugsplat Test <<")
  9. end
  10.  
  11. function CanCast(Spell)
  12.     return (myHero:CanUseSpell(Spell) == READY)
  13. end
  14.  
  15. function OnTick()
  16.     ts:update()
  17. end
  18.  
  19. function OnDraw()
  20.     if MyConfig.DrawRanges and not myHero.dead then
  21.         DrawCircle(myHero.x, myHero.y, myHero.z, ts.range, 0x808080) -- Gray
  22.  
  23.         if CanCast(_Q) then
  24.             DrawCircle(myHero.x, myHero.y, myHero.z, QRange, 0x0099CC) -- Blue
  25.         end
  26.        
  27.         if CanCast(_W) then
  28.             DrawCircle(myHero.x, myHero.y, myHero.z, WRange, 0xFFFF00) -- Yellow
  29.         end
  30.        
  31.         if CanCast(_E) then
  32.             DrawCircle(myHero.x, myHero.y, myHero.z, ERange, 0x00FF00) -- Green
  33.         end
  34.  
  35.         if CanCast(_R) then
  36.             DrawCircle(myHero.x, myHero.y, myHero.z, RRange, 0xFF0000) -- Red
  37.         end
  38.     end
  39.  
  40.     if ts ~= nil and ValidTarget(ts.target, QRange) and not ts.target.dead then
  41.         DrawArrowsToPos(myHero, ts.target)
  42.     end
  43. end
  44.  
  45. function DrawArrowsToPos(pos1, pos2)
  46.     if pos1 and pos2 then
  47.         startVector = D3DXVECTOR3(pos1.x, pos1.y, pos1.z)
  48.         endVector = D3DXVECTOR3(pos2.x, pos2.y, pos2.z)
  49.  
  50.         DrawArrows(startVector, endVector, 60, 0xE97FA5, 100)
  51.     end
  52. end
Advertisement
Add Comment
Please, Sign In to add comment