local dirs = {0, 7, 1, 5, 2, 4, 3, 6}
function spinSpell(cid, interval, combattype, distanceeffect, effect, min, max, dir, n, i)
dir = dir or 1
n = n or 7
i = i or 1
local creature = Creature(cid)
if creature and i <= n then
local pos = creature:getPosition()
if Tile(pos):hasFlag(TILESTATE_PROTECTIONZONE) then
return false
end
pos:getNextPosition(dirs[dir])
local tile = Tile(pos)
if not (tile:hasProperty(CONST_PROP_BLOCKPROJECTILE) or tile:hasFlag(TILESTATE_FLOORCHANGE) or tile:hasFlag(TILESTATE_TELEPORT) or tile:hasFlag(TILESTATE_PROTECTIONZONE)) then
doAreaCombatHealth(cid, combattype, pos, 0, min, max, effect)
creature:getPosition():sendDistanceEffect(pos, distanceeffect)
end
i = i + 1
addEvent(spinSpell, interval, cid, interval, combattype, distanceeffect, effect, min, max, dir % 8 + 1, n, i)
return true
end
end
function onCastSpell(creature, variant)
return spinSpell(creature:getId(), 100, COMBAT_FIREDAMAGE, CONST_ANI_FIRE, CONST_ME_FIREAREA, -100, -200, 1, 24)
end