Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ZG.VAR.FireballExplode(pUnit)
- local x2 = pUnit:GetX()
- local y2 = pUnit:GetY()
- pUnit:CastSpell(76010) -- visual
- pUnit:RemoveAura(71706) -- main visual
- for k,plr in pairs(pUnit:GetInRangePlayers()) do
- if plr:GetPhase() == 2 and plr:GetDistanceYards(pUnit) < 20 then
- local x1 = plr:GetX()
- local y1 = plr:GetY()
- local x = x2 - x1
- local y = y2 - y1
- local angle = math.pi + math.atan2(-y, -x)
- -- 25 = distance
- local x = x1 - (25 * math.cos(angle))
- local y = y1 - (25 * math.sin(angle))
- local z = pUnit:GetLandHeight(x, y)
- if z > 200 or z < 20 then
- z = plr:GetZ()
- end
- pUnit:Strike(plr, 2, 76010, 700, 1000, 0.1)
- plr:MoveKnockback(x, y, z, 2, 9)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment