Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- http://emudevs.com/showthread.php/394-Draw-a-geometrical-form
- local UNIT_FIELD_FLAGS = 0x0006 + 0x0035 -- Size: 1, Type: INT, Flags: PUBLIC
- local UNIT_FLAG_NOT_SELECTABLE = 0x02000000 -- 26 33554432 cannot select the unit
- local INVISIBLE_DUMMY = 24417 --invisible man + cannot select the unit
- local BEAM_SPELL = 33535
- local DISTANCE = 5
- local DELAY = 5000
- local CORNERS = 5
- local function Buffcommand(event, player, msg, Type, lang)
- if(tonumber(msg)) then
- CORNERS = tonumber(msg)
- local T = {}
- for i = 0, CORNERS*2-1 do
- local rads = math.pi*2/CORNERS*i
- local X, Y = player:GetRelativePoint(DISTANCE, rads)
- local guard = player:SummonGuardian( INVISIBLE_DUMMY, X, Y, player:GetHeight(X, Y), rads, DELAY)
- guard:SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)
- guard:SetRooted(true)
- table.insert(T, guard)
- end
- for i = 1, #T/2 do
- T[i]:CastSpell(T[i+1], BEAM_SPELL)
- end
- for i = #T/2+1, #T-2 do
- T[i]:CastSpell(T[i+2], BEAM_SPELL)
- end
- T[#T-1]:CastSpell(T[1], BEAM_SPELL)
- T[#T]:CastSpell(T[2], BEAM_SPELL)
- return false
- end
- end
- RegisterServerHook(18, Buffcommand)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement