stoneharry

Untitled

Nov 13th, 2012
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.75 KB | None | 0 0
  1. function ZG.VAR.FireballExplode(pUnit)
  2.  
  3.     local x2 = pUnit:GetX()
  4.     local y2 = pUnit:GetY()
  5.    
  6.     pUnit:CastSpell(76010) -- visual
  7.     pUnit:RemoveAura(71706) -- main visual
  8.    
  9.     for k,plr in pairs(pUnit:GetInRangePlayers()) do
  10.         if plr:GetPhase() == 2 and plr:GetDistanceYards(pUnit) < 20 then
  11.        
  12.             local x1 = plr:GetX()
  13.             local y1 = plr:GetY()
  14.  
  15.             local x = x2 - x1
  16.             local y = y2 - y1
  17.            
  18.             local angle = math.pi + math.atan2(-y, -x)
  19.  
  20.             -- 25 = distance
  21.             local x = x1 - (25 * math.cos(angle))
  22.             local y = y1 - (25 * math.sin(angle))
  23.            
  24.             local z = pUnit:GetLandHeight(x, y)
  25.             if z > 200 or z < 20 then
  26.                 z = plr:GetZ()
  27.             end
  28.            
  29.             pUnit:Strike(plr, 2, 76010, 700, 1000, 0.1)
  30.             plr:MoveKnockback(x, y, z, 2, 9)
  31.            
  32.         end
  33.     end
  34. end
Advertisement
Add Comment
Please, Sign In to add comment