• 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 Problem with Function ( Tile not found )

Drs1705

Member
Joined
Dec 26, 2011
Messages
69
Reaction score
14
When I put the function in a doPushCreature spell, which serves to push the creature to determine one area, I get an error message on the console

[15/05/2013 17:45:18] [Error - Spell Interface]
[15/05/2013 17:45:18] In a timer event called from:
[15/05/2013 17:45:18] data / spells / scripts / ar / soprar.lua: onCastSpell
[15/05/2013 17:45:18] Description:
[15/05/2013 17:45:18] (luaGetThingFromPos) Tile not found

function doPushCreature:
Code:
function doPushCreature(uid, direction, distance, speed)
-- Desenvolvido por Dokmos 30/01/2009
-- Apoio Dinastias
local pos = getThingPos(uid)
local PARAM = {{1}, {500}}
local DIRECTION = {
{{0,0},{6,7},{1,3}}, {{1,1},{5,7},{0,2}}, {{2,2},{4,5},{1,3}}, {{3,3},{4,6},{0,2}},
{{4,4},{2,3}}, {{5,5}, {1,2}}, {{6,6},{0,1}}, {{7,7},{0,3}}
}
table.insert(PARAM[1], distance)
table.insert(PARAM[2], speed)

        for dvar = 1, #DIRECTION[direction+1] do
        rand = math.random(2)
        d = DIRECTION[direction+1][dvar][rand]
        dir = {x = (math.fmod(d,2)*(-(d-2))+math.floor(d/4)*math.fmod(d,2)*d-math.floor(d/4)), y = (((d-1)*(d-1-(d-1)*math.abs(d-2))*(1-math.floor(d/4)))-(math.floor(d/4)*(math.floor(d/6)*2-1)))}
        newtile = {x = (pos.x+dir.x), y = (pos.y+dir.y), z = pos.z}
                if  (getTileThingByPos(newtile).uid ~= 0) and (hasProperty(getTileThingByPos(newtile).uid,3) == FALSE) and (queryTileAddThing(uid,newtile) == 1) then break end
        rand = (math.fmod(rand,2)+1)
        d = DIRECTION[direction+1][dvar][rand]
        dir = {x = (math.fmod(d,2)*(-(d-2))+math.floor(d/4)*math.fmod(d,2)*d-math.floor(d/4)), y = (((d-1)*(d-1-(d-1)*math.abs(d-2))*(1-math.floor(d/4)))-(math.floor(d/4)*(math.floor(d/6)*2-1)))}
        newtile = {x = (pos.x+dir.x), y = (pos.y+dir.y), z = pos.z}
                if  (getTileThingByPos(newtile).uid ~= 0) and (hasProperty(getTileThingByPos(newtile).uid,3) == FALSE) and (queryTileAddThing(uid,newtile) == 1) then break end
                if (dvar == #DIRECTION[direction+1]) then
                newtile = pos
                end
        end
        
        doTeleportThing(uid, newtile, TRUE)
        if (PARAM[1][#PARAM[1]] > 1) then
        addEvent(doPushCreature, PARAM[2][#PARAM[2]], uid, direction, (distance-1), speed)
        end     
end


my Spell:
Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 2)

function onGetFormulaValues(cid, level)
min = -(level * 1.40) * 1.0
max = -(level * 1.60) * 1.0

        return min, max
end

setCombatCallback(combat1, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 2)

function onGetFormulaValues(cid, level)
min = -(level * 1.40) * 1.0
max = -(level * 1.60) * 1.0

        return min, max
end

setCombatCallback(combat2, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 2)

function onGetFormulaValues(cid, level)
min = -(level * 1.40) * 1.0
max = -(level * 1.60) * 1.0

        return min, max
end


setCombatCallback(combat3, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")


local arr1 = {
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 0, 1, 3, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
}

local arr2 = {
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 3, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
}

local arr3 = {
{0, 0, 0, 0, 0, 0, 0},
{1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 3, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
}

local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)

local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end
local function onCastSpell2(parameters)
doCombat(parameters.cid, parameters.combat2, parameters.var)
end
local function onCastSpell3(parameters)
doCombat(parameters.cid, parameters.combat3, parameters.var)
end

function onCastSpell(cid, var)
if not isHandsFree(cid) then
return true
end

local function UM(cid)
pos = getPosfromArea(cid,arr1)
n = 0

while n < #pos do
n = n+1
thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=253}
if isPlayer(getThingfromPos(thing).uid) or isMonster(getThingfromPos(thing).uid) then 
doPushCreature(getThingfromPos(thing).uid,getPlayerLookDir(cid))
    end
end
end
 
local function DOIS(cid)
pos = getPosfromArea(cid,arr2)
n = 0

while n < #pos do
n = n+1
thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=253}
if isPlayer(getThingfromPos(thing).uid) or isMonster(getThingfromPos(thing).uid) then 
doPushCreature(getThingfromPos(thing).uid,getPlayerLookDir(cid))
    end
end
end
 
local function TRES(cid)
pos = getPosfromArea(cid,arr3)
n = 0

while n < #pos do
n = n+1
thing = {x=pos[n].x,y=pos[n].y,z=pos[n].z,stackpos=253}
if isPlayer(getThingfromPos(thing).uid) or isMonster(getThingfromPos(thing).uid) then 
doPushCreature(getThingfromPos(thing).uid,getPlayerLookDir(cid))
    end
end
end
 

local spellname = "soprar"
         
if exhaustion.check(cid, 23000) == FALSE then  

local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3 }
addEvent(onCastSpell1, 0, parameters)
addEvent(onCastSpell2, 200, parameters)
addEvent(onCastSpell3, 400, parameters)
addEvent(UM, 0, cid)
addEvent(DOIS, 200, cid)
addEvent(TRES, 400, cid)
exhaustion.set(cid, 23000, 0.9)

   doSendAnimatedText(getCreaturePosition(cid), "Soprar", TEXTCOLOR_WHITE)
else
   doPlayerSendCancel(cid, "Preparando habilidade " .. spellname .. ", preciso de " ..exhaustion.get(cid, 23000).." segundo.")
end  

return FALSE

How can I solve this? If I want to set "isWalkable" the spell, how do?
Sorry my bad english

- - - Updated - - -

buump

- - - Updated - - -

buump
 
Back
Top