Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.37 KB | None | 0 0
  1. -- distances: 4, 5, 29, 31, 32
  2. -- death on X
  3. -- explosion on +
  4.  
  5. function onSay(player, words, param)
  6.     local pos = player:getPosition()
  7.     local table =
  8.         {
  9.             [1] = {x = pos.x - 1, y = pos.y - 1, z = pos.z},
  10.             [2] = {x = pos.x, y = pos.y - 1, z = pos.z},
  11.             [3] = {x = pos.x + 1, y = pos.y - 1, z = pos.z},
  12.             [4] = {x = pos.x + 1, y = pos.y, z = pos.z},
  13.             [5] = {x = pos.x + 1, y = pos.y + 1, z = pos.z},
  14.             [6] = {x = pos.x, y = pos.y + 1, z = pos.z},
  15.             [7] = {x = pos.x - 1, y = pos.y + 1, z = pos.z},
  16.             [8] = {x = pos.x - 1, y = pos.y, z = pos.z}
  17.         }
  18.     local delay = 0
  19.     player:say('[MAGIC UP!]', TALKTYPE_MONSTER_SAY)
  20.     for i = 1, 2 do
  21.         addEvent(function() Position(pos):sendMagicEffect(CONST_ME_EXPLOSIONAREA) end, delay)
  22.         for _, position in ipairs(table) do
  23.             for i = 1, 3 do
  24.                 addEvent(function() Position(pos):sendDistanceEffect(position, CONST_ANI_EXPLOSION) end, delay + (i - 1) * 120)
  25.             end
  26.             if (_ % 2) == 0 then
  27.                 addEvent(function() Position(position):sendMagicEffect(CONST_ME_BLOCKHIT) Position(position):sendMagicEffect(CONST_ME_EXPLOSIONHIT) end, delay + 200)
  28.             end
  29.         end
  30.         delay = delay + 220
  31.         for _, position in ipairs(table) do
  32.             if (_ % 2) == 1 then
  33.                 for i = 1, 3 do
  34.                     addEvent(function() Position(position):sendDistanceEffect(pos, CONST_ANI_EXPLOSION) end, delay + (i - 1) * 120)
  35.                 end
  36.             end
  37.         end
  38.     end
  39.     return false
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement