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

TFS 1.X+ Help me understand object and effects display

Dominicana

New Member
Joined
Apr 16, 2018
Messages
7
Reaction score
0
Hello,

Im about to edit some existing objects and effects, and my problem is that i cannot figure out how to make a 1 effect to spell, that hits multiple tiles.
For example (Effect made by object builder)
31239305_1708229432563635_1174598582506881024_n.jpg

How to make spell with area damage
{1, 1, 1},
{1, 3, 1},
{1, 1, 1}
That displays only One explosion that hits in 3x3 square, not 9 explosions looking the same?
Or EFFECT that his center is not right lower tile, but the middle one?

Second problem is with non-walkable objects
31351500_1708236692562909_2124668962112274432_n.jpg

Left tile - Walkable tile, Red tile - Non-walkable tile
My question is, can we swap tiles with their walkability?
That tree had to be non walkable on both LOWER tiles, can we do that?

Thanks!
 
Lua:
local acombat1 = createCombatObject()
local acombat2 = createCombatObject()
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 43)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 36)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1, -1, -1, -1)
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 43)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 36)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -1, -1, -1, -1)
local arr1 = {
{0, 0, 0},
{0, 3, 0},
{0, 0, 0},
}
local arr2 = {
{1, 1, 1},
{1, 0, 1},
{1, 1, 1},
}
local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
setCombatArea(acombat1, area1)
setCombatArea(acombat2, area2)
function onTargetTile(cid, pos)
    doCombat(cid,combat1,positionToVariant(pos))
end
function onTargetTile2(cid, pos)
    doCombat(cid,combat2,positionToVariant(pos))
end
setCombatCallback(acombat1, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
setCombatCallback(acombat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2")
local function onCastSpell1(parameters)
    doCombat(parameters.cid, acombat1, parameters.var)
end
local function onCastSpell2(parameters)
    doCombat(parameters.cid, acombat2, parameters.var)
end
function onCastSpell(cid, var)
local parameters = {cid = cid, var = var}
    addEvent(onCastSpell1, 0, parameters)
    addEvent(onCastSpell2, 10, parameters)
    return true
end

This could be a solution I think ? U just add at the second combat a empty effect and at the first one your effect which u wanted

EDIT: saw now ur using tfs 1.x idk if this script work then, sorry
 
Lua:
local acombat1 = createCombatObject()
local acombat2 = createCombatObject()
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 43)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 36)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1, -1, -1, -1)
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 43)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 36)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -1, -1, -1, -1)
local arr1 = {
{0, 0, 0},
{0, 3, 0},
{0, 0, 0},
}
local arr2 = {
{1, 1, 1},
{1, 0, 1},
{1, 1, 1},
}
local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
setCombatArea(acombat1, area1)
setCombatArea(acombat2, area2)
function onTargetTile(cid, pos)
    doCombat(cid,combat1,positionToVariant(pos))
end
function onTargetTile2(cid, pos)
    doCombat(cid,combat2,positionToVariant(pos))
end
setCombatCallback(acombat1, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
setCombatCallback(acombat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2")
local function onCastSpell1(parameters)
    doCombat(parameters.cid, acombat1, parameters.var)
end
local function onCastSpell2(parameters)
    doCombat(parameters.cid, acombat2, parameters.var)
end
function onCastSpell(cid, var)
local parameters = {cid = cid, var = var}
    addEvent(onCastSpell1, 0, parameters)
    addEvent(onCastSpell2, 10, parameters)
    return true
end

This could be a solution I think ? U just add at the second combat a empty effect and at the first one your effect which u wanted

EDIT: saw now ur using tfs 1.x idk if this script work then, sorry

Just copy pasted this spell and it works, now gonna try to edit this

For the second one you can place invisible unpassable object. There are no items that take 2 tiles.

Nice idea, it can work with me
 
So, i tried to edit this spell to make it work with that effect, it works only when monster is standing on north from me, when monster stand north-east to me, my effect changes place where it displays.
Do i need to make seperate arrays for every direction i face monster? I want that spell to be only cast on target
 
Back
Top