Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onAdvance(player, skill, oldLevel, newLevel)
- if oldLevel < newLevel then -- we only want the effect to go off when we level up
- local pos = player:getPosition()
- local table =
- {
- [1] = {x = pos.x - 1, y = pos.y - 1, z = pos.z},
- [2] = {x = pos.x, y = pos.y - 1, z = pos.z},
- [3] = {x = pos.x + 1, y = pos.y - 1, z = pos.z},
- [4] = {x = pos.x + 1, y = pos.y, z = pos.z},
- [5] = {x = pos.x + 1, y = pos.y + 1, z = pos.z},
- [6] = {x = pos.x, y = pos.y + 1, z = pos.z},
- [7] = {x = pos.x - 1, y = pos.y + 1, z = pos.z},
- [8] = {x = pos.x - 1, y = pos.y, z = pos.z}
- }
- delay = 0
- for i = 1, 2 do
- addEvent(function() Position(pos):sendMagicEffect(CONST_ME_HOLYAREA) end, delay)
- for _, position in ipairs(table) do
- if (_ % 4) == 0 then
- for _, position in ipairs(table) do
- if (_ % 2) == (0 + (i - 1)) then
- addEvent(function() Position(position):sendMagicEffect(CONST_ME_FIREWORK_YELLOW + math.random(0, 2)) end, delay - 20)
- end
- end
- end
- addEvent(function() Position(position):sendDistanceEffect(pos, CONST_ANI_ENERGYBALL) end, delay)
- delay = delay + 80
- end
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement