Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.18 KB | None | 0 0
  1. function onAdvance(player, skill, oldLevel, newLevel)
  2.     if oldLevel < newLevel then -- we only want the effect to go off when we level up
  3.         local pos = player:getPosition()
  4.         local table =
  5.             {
  6.                 [1] = {x = pos.x - 1, y = pos.y - 1, z = pos.z},
  7.                 [2] = {x = pos.x, y = pos.y - 1, z = pos.z},
  8.                 [3] = {x = pos.x + 1, y = pos.y - 1, z = pos.z},
  9.                 [4] = {x = pos.x + 1, y = pos.y, z = pos.z},
  10.                 [5] = {x = pos.x + 1, y = pos.y + 1, z = pos.z},
  11.                 [6] = {x = pos.x, y = pos.y + 1, z = pos.z},
  12.                 [7] = {x = pos.x - 1, y = pos.y + 1, z = pos.z},
  13.                 [8] = {x = pos.x - 1, y = pos.y, z = pos.z}
  14.             }
  15.         delay = 0
  16.         for i = 1, 2 do
  17.             addEvent(function() Position(pos):sendMagicEffect(CONST_ME_HOLYAREA) end, delay)
  18.             for _, position in ipairs(table) do
  19.                 if (_ % 4) == 0 then
  20.                     for _, position in ipairs(table) do
  21.                         if (_ % 2) == (0 + (i - 1)) then
  22.                             addEvent(function() Position(position):sendMagicEffect(CONST_ME_FIREWORK_YELLOW + math.random(0, 2)) end, delay - 20)
  23.                         end
  24.                     end
  25.                 end
  26.                 addEvent(function() Position(position):sendDistanceEffect(pos, CONST_ANI_ENERGYBALL) end, delay)
  27.                 delay = delay + 80
  28.             end
  29.         end
  30.     end
  31.     return true
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement