Advertisement
Rochet2

Draw a geometrical form

Aug 9th, 2013
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- http://emudevs.com/showthread.php/394-Draw-a-geometrical-form
  2. local UNIT_FIELD_FLAGS = 0x0006 + 0x0035 -- Size: 1, Type: INT, Flags: PUBLIC
  3. local UNIT_FLAG_NOT_SELECTABLE = 0x02000000 -- 26    33554432  cannot select the unit
  4. local INVISIBLE_DUMMY = 24417 --invisible man + cannot select the unit
  5. local BEAM_SPELL = 33535
  6. local DISTANCE = 5
  7. local DELAY = 5000
  8. local CORNERS = 5
  9.  
  10. local function Buffcommand(event, player, msg, Type, lang)
  11.     if(tonumber(msg)) then
  12.         CORNERS = tonumber(msg)
  13.         local T = {}
  14.         for i = 0, CORNERS*2-1 do
  15.             local rads = math.pi*2/CORNERS*i
  16.             local X, Y = player:GetRelativePoint(DISTANCE, rads)
  17.             local guard = player:SummonGuardian( INVISIBLE_DUMMY, X, Y, player:GetHeight(X, Y), rads, DELAY)
  18.             guard:SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)
  19.             guard:SetRooted(true)
  20.             table.insert(T, guard)
  21.         end
  22.         for i = 1, #T/2 do
  23.             T[i]:CastSpell(T[i+1], BEAM_SPELL)
  24.         end
  25.         for i = #T/2+1, #T-2 do
  26.             T[i]:CastSpell(T[i+2], BEAM_SPELL)
  27.         end
  28.         T[#T-1]:CastSpell(T[1], BEAM_SPELL)
  29.         T[#T]:CastSpell(T[2], BEAM_SPELL)
  30.         return false
  31.     end
  32. end
  33. RegisterServerHook(18, Buffcommand)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement