stoneharry

Untitled

Mar 20th, 2012
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.15 KB | None | 0 0
  1. function TOC.VAR.Jaraxxus_PathOfFireSpawn(pUnit, Event)
  2.     local id = pUnit:GetInstanceID()
  3.     if id == nil then id = 1 end
  4.     --if TOC[id].VAR.chaos then
  5.         for _,plrs in pairs(pUnit:GetInRangePlayers()) do
  6.             local found = false
  7.             for _,names in pairs(TOC[id].VAR.chaosplayers) do
  8.                 if plrs:GetName() == names then
  9.                     found = true
  10.                     break
  11.                 end
  12.             end
  13.             if not found then
  14.                 pUnit:SendChatMessage(12,0,"Not found, inserting into table and moving to player : "..plrs:GetName())
  15.                 table.insert(TOC[id].VAR.chaosplayers, plrs:GetName())
  16.                 pUnit:SetMovementFlags(1)
  17.                 pUnit:MoveTo(plrs:GetX(), plrs:GetY(), plrs:GetZ(), 0)
  18.                 pUnit:RegisterEvent("TOC.VAR.SpawnMoreStaticFiresJarax", 700, 14)
  19.             end
  20.         end
  21.     --[[else
  22.         local range = 0
  23.         local target = nil
  24.         for _,plrs in pairs(pUnit:GetInRangePlayers()) do
  25.             if plrs:GetDistanceYards(pUnit) > range then
  26.                 range = plrs:GetDistanceYards(pUnit)
  27.                 target = plrs
  28.             end
  29.         end
  30.         if target ~= nil then
  31.             pUnit:SetMovementFlags(1)
  32.             pUnit:MoveTo(target:GetX(), target:GetY(), target:GetZ(), 0)
  33.             pUnit:RegisterEvent("TOC.VAR.SpawnMoreStaticFiresJarax", 700, 14)
  34.         end
  35.     end]]
  36. end
Advertisement
Add Comment
Please, Sign In to add comment