Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solarBeam(cid, positions, c)
- if not isCreature(cid) then return true end
- if #positions == 0 then
- local effect = {
- [0] = {
- [1] = {{x = 0, y= -1}, 118},
- [2] = {{x = 0, y= -2}, 117},
- [3] = {{x = 0, y= -3}, 117},
- [4] = {{x = 0, y= -4}, 119},
- },
- [1] = {
- [1] = {{x = 1, y= 0}, 110},
- [2] = {{x = 2, y= 0}, 112},
- [3] = {{x = 3, y= 0}, 112},
- [4] = {{x = 4, y= 0}, 111},
- },
- [2] = {
- [1] = {{x = 0, y= 1}, 115},
- [2] = {{x = 0, y= 2}, 117},
- [3] = {{x = 0, y= 3}, 117},
- [4] = {{x = 0, y= 4}, 116},
- },
- [3] = {
- [1] = {{x = -1, y= 0}, 113},
- [2] = {{x = -2, y= 0}, 112},
- [3] = {{x = -3, y= 0}, 112},
- [4] = {{x = -4, y= 0}, 114},
- }
- }
- for status = 1, 4 do
- local dir = effect[Creature(cid):getDirection()][status]
- c.pos = Creature(cid):getPosition()
- local pos = {x = c.pos.x + dir[1].x, y = c.pos.y + dir[1].y, z = c.pos.z}
- doAreaCombatHealth(c.cid, c.type, pos, 0, c.min, c.max, dir[2])
- end
- return true
- end
- local randomPos = math.random(1, #positions)
- doSendDistanceShoot(positions[randomPos], Creature(cid):getPosition(), 38)
- doSendMagicEffect(Creature(cid):getPosition(), 40)
- table.remove(positions, randomPos)
- addEvent(solarBeam, 300, cid, positions, c)
- end
- function onCastSpell(cid, var)
- local c = spellConfig(cid, "Solar Beam")
- local positions = {}
- for x = -1, 1 do
- for y = -1, 1 do
- table.insert(positions, {x = c.pos.x + x, y = c.pos.y + y, z = c.pos.z})
- end
- end
- solarBeam(cid, positions, c)
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement