• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Error in console

Status
Not open for further replies.

azzkaban

Monster Maker
Joined
Feb 23, 2010
Messages
1,103
Reaction score
196
Location
Iquique Chile
Error in console: [30/4/2013 15:10:48] >>> Loading test spell.xml ...[Error - Event::checkScript] Event onCastSpell not found (mods/scripts/test.lua)


script:
LUA:
-- SPELL EVIL SPIRIT BY: XOTSERVX --

local min, max = 100, 200 -- dano

function isWalkable(pos, creature, proj, pz)-- by Nord
if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
if getTopCreature(pos).uid > 0 and creature then return false end
if getTileInfo(pos).protection and pz then return false, true end
local n = not proj and 3 or 2
for i = 0, 255 do
pos.stackpos = i
local tile = getTileThingByPos(pos)
if tile.itemid ~= 0 and not isCreature(tile.uid) then
if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
return false
end
end
end
return true
end

function getPosDirs(p, dir)
return dir == 1 and {x=p.x-1, y=p.y, z=p.z} or dir == 2 and {x=p.x-1, y=p.y+1, z=p.z} or dir == 3 and {x=p.x, y=p.y+1, z=p.z} or dir == 4 and {x=p.x+1, y=p.y+1, z=p.z} or dir == 5 and {x=p.x+1, y=p.y, z=p.z} or dir == 6 and {x=p.x+1, y=p.y-1, z=p.z} or dir == 7 and {x=p.x, y=p.y-1, z=p.z} or dir == 8 and {x=p.x-1, y=p.y-1, z=p.z}
end

function posIgual(pos1, pos2)
return pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z and true or false
end

effect = 62
distance = 31
damage = COMBAT_DEATHDAMAGE

evilspirit = {
walk = function (cid, min, max, pos, rounds, ultimapos)
if rounds == 0 then return true end
if not isCreature(cid) then return true end
posdisp = {}
for _, dir in pairs({1, 5, 7, 3}) do
if isWalkable(getPosDirs(pos, dir)) and not posIgual(getPosDirs(pos, dir), getThingPos(cid)) and not posIgual(getPosDirs(pos, dir), ultimapos) then
table.insert(posdisp, getPosDirs(pos, dir))
end
end
if #posdisp < 1 then return true end
posesc = posdisp[math.random(1, #posdisp)]
ultimapos = pos
doSendDistanceShoot(pos, posesc, distance)
doAreaCombatHealth(cid, damage, posesc, 0, -min, -max, effect)
addEvent(evilspirit.walk, 140, cid, -min, -max, posesc, rounds - 1, ultimapos)
end
}

function onUse(cid,item,item2,frompos,pos,topos)
evilspirit.walk(cid, 10, 20, getThingPos(cid), 40, {x=1, y=1, z=1})
for i = 1, 13 do
addEvent(evilspirit.walk, i * math.random(300, 500), cid, min, max, getThingPos(cid), 40, {x=1, y=1, z=1})
end
return true
end
 
This spell is designed to be an action script for a rune it would require a little bit if work to make it a spell I'm on my phone right now so I can't write anything up for ya just look at your spells and tinker a little see if you can get it or I'm sure someone will make a spell version for you =)
 
interesting spell
LUA:
-- SPELL EVIL SPIRIT BY: XOTSERVX --
local min, max = 100, 200 -- damage
 
function isWalkable(pos, creature, proj, pz)-- by Nord
    if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
    if getTopCreature(pos).uid > 0 and creature then return false end
    if getTileInfo(pos).protection and pz then return false, true end
    local n = not proj and 3 or 2
    for i = 0, 255 do
        pos.stackpos = i
        local tile = getTileThingByPos(pos)
        if tile.itemid ~= 0 and not isCreature(tile.uid) then
            if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
                return false
            end
        end
    end
    return true
end
 
function getPosDirs(p, dir)
    return dir == 1 and {x=p.x-1, y=p.y, z=p.z} or dir == 2 and {x=p.x-1, y=p.y+1, z=p.z} or dir == 3 and {x=p.x, y=p.y+1, z=p.z} or dir == 4 and {x=p.x+1, y=p.y+1, z=p.z} or dir == 5 and {x=p.x+1, y=p.y, z=p.z} or dir == 6 and {x=p.x+1, y=p.y-1, z=p.z} or dir == 7 and {x=p.x, y=p.y-1, z=p.z} or dir == 8 and {x=p.x-1, y=p.y-1, z=p.z}
end
 
function posIgual(pos1, pos2)
    return pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z and true or false
end
 
effect = 62
distance = 31
damage = COMBAT_DEATHDAMAGE
 
evilspirit = {
    walk = function (cid, min, max, pos, rounds, ultimapos)
        if rounds == 0 then return true end
        if not isCreature(cid) then return true end
        posdisp = {}
        for _, dir in pairs({1, 5, 7, 3}) do
            if isWalkable(getPosDirs(pos, dir)) and not posIgual(getPosDirs(pos, dir), getThingPos(cid)) and not posIgual(getPosDirs(pos, dir), ultimapos) then
                table.insert(posdisp, getPosDirs(pos, dir))
            end
        end
        if #posdisp < 1 then return true end
        posesc = posdisp[math.random(1, #posdisp)]
        ultimapos = pos
        doSendDistanceShoot(pos, posesc, distance)
        doAreaCombatHealth(cid, damage, posesc, 0, -min, -max, effect)
        addEvent(evilspirit.walk, 140, cid, -min, -max, posesc, rounds - 1, ultimapos)
    end
}
 
function onCastSpell(cid, var)
    evilspirit.walk(cid, 10, 20, getThingPos(cid), 40, {x=1, y=1, z=1})
    for i = 1, 13 do
        addEvent(evilspirit.walk, i * math.random(300, 500), cid, min, max, getThingPos(cid), 40, {x=1, y=1, z=1})
    end
    return true
end
 
Status
Not open for further replies.
Back
Top