• 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!

magic wall on water tiles

Firulis

New Member
Joined
Jan 3, 2017
Messages
34
Solutions
2
Reaction score
1
I have a spell that creates magic walls around a player and this is used to trap people in my server but the problem with it is that if a player uses the spell near water or a border the magic wall appears on water, making it seem like the tile is walk able when it really isn't, can someone help me configure my spell so that it only spawns magic tiles on places that people can walk on, and not water or lava, or swamp, or any other border
this is the spell i use: I use OTX 2.9, Client 8.60, I wouldn't mind editing sources.
Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat1, COMBAT_PARAM_CREATEITEM, 1497)

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


local area1 = createCombatArea(arr1)


setCombatArea(combat1, area1)


local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end


function onCastSpell(cid, var)

local parameters = { cid = cid, var = var, combat1 = combat1 }

addEvent(onCastSpell1, 100, parameters)

end
 
Try this(Tested on tfs 1.3)

Lua:
local combat = createCombatObject()

local arr = {
    {0, 0, 0, 0, 0, 0, 0},
    {0, 1, 1, 1, 1, 1, 0},
    {0, 1, 0, 0, 0, 1, 0},
    {0, 1, 0, 2, 0, 1, 0},
    {0, 1, 0, 0, 0, 1, 0},
    {0, 1, 1, 1, 1, 1, 0},
    {0, 0, 0, 0, 0, 0, 0}
}

local area = createCombatArea(arr)
    setCombatArea(combat, area)

function onWallTile(cid, pos)
    local tile = Tile(pos)
    if tile then
        if tile:getCreatureCount() <= 0 and not tile:hasFlag(TILESTATE_BLOCKSOLID)and not tile:hasFlag(TILESTATE_BLOCKPATH) then
            local wall = Game.createItem(1497, 1, pos)
            wall:decay()
            pos:sendMagicEffect(CONST_ME_ENERGYHIT)
            cid:getPosition():sendDistanceEffect(pos, CONST_ANI_ENERGY)
        end
    end
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onWallTile")

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
 
Try this(Tested on tfs 1.3)

Lua:
local combat = createCombatObject()

local arr = {
    {0, 0, 0, 0, 0, 0, 0},
    {0, 1, 1, 1, 1, 1, 0},
    {0, 1, 0, 0, 0, 1, 0},
    {0, 1, 0, 2, 0, 1, 0},
    {0, 1, 0, 0, 0, 1, 0},
    {0, 1, 1, 1, 1, 1, 0},
    {0, 0, 0, 0, 0, 0, 0}
}

local area = createCombatArea(arr)
    setCombatArea(combat, area)

function onWallTile(cid, pos)
    local tile = Tile(pos)
    if tile then
        if tile:getCreatureCount() <= 0 and not tile:hasFlag(TILESTATE_BLOCKSOLID)and not tile:hasFlag(TILESTATE_BLOCKPATH) then
            local wall = Game.createItem(1497, 1, pos)
            wall:decay()
            pos:sendMagicEffect(CONST_ME_ENERGYHIT)
            cid:getPosition():sendDistanceEffect(pos, CONST_ANI_ENERGY)
        end
    end
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onWallTile")

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
I dont think its compatible with my distro, something about WallTile
 
Back
Top