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

Convert to tfs 1.3

dervin13

Active Member
Joined
Apr 26, 2008
Messages
458
Solutions
1
Reaction score
28
Lua:
local removeTime = 3 * 1000
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)
 
local arr = {
{0, 1, 0},
{0, 2, 0},
{0, 0, 0}
}
 
local area = createCombatArea(arr)
setCombatArea(combat, area)
 
function onCastSpell(cid, var)
    area.stackpos = 254
    local magicWall = GetThingFromPos(area)
    addEvent(removeItem, removeTime, magicWall.uid)
    return doCombat(cid, combat, var)
end
Is possible to convert it to tfs 1.3??
 
Bump, I tried some changes and nothing. Tried to use m wall of id 1498 to change in items.xml but it always create 1497
 
Bump, I tried some changes and nothing. Tried to use m wall of id 1498 to change in items.xml but it always create 1497
In line 3 u have:
Lua:
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)
Creating item with id 1497. Change to:
Lua:
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1498)
U changed this, and still creating item id 1497?
 
In line 3 u have:
Lua:
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)
Creating item with id 1497. Change to:
Lua:
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1498)
U changed this, and still creating item id 1497?

Yes, I tried this, to use another cooldown in a spell but it always create 1497, even if i put 1498

Used this on
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat:setParameter(COMBAT_PARAM_CREATEITEM, 1498)

function onCastSpell(creature, variant, isHotkey)
    return combat:execute(creature, variant)
end
 
Tried to restart and nothing. It creates 1497
Lua:
    <item id="1497" article="a" name="magic wall">
        <attribute key="type" value="magicfield" />
        <attribute key="decayTo" value="0" />
        <attribute key="duration" value="20" />
    </item>
    <item id="1498" article="a" name="magic wall">
        <attribute key="type" value="magicfield" />
        <attribute key="decayTo" value="0" />
        <attribute key="duration" value="10" />
    </item>
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat:setParameter(COMBAT_PARAM_CREATEITEM, 1498)

arr = {
   {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, 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, 0},
   {0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 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, 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, 0}
   }

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

function onCastSpell(creature, variant, isHotkey)
    return combat:execute(creature, variant)
end

Maybe a way to use game.create item?
or add event to remove item?
 
Last edited:
Solved, I found a way. Based in some scripts that I found.

I use this to normal magic wall
Lua:
local id = 1497
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat:setParameter(COMBAT_PARAM_CREATEITEM, id)


function removeMw(pos, mw, wall)
    local tile = Tile(pos)
    mw = tile:getItemById(mw)
    wall = tile:getItemById(wall)
    if mw then mw:remove() end
    if wall then wall:remove() end
end

function onCastSpell(creature, var, isHotkey)
    local c = combat:execute(creature, var)
    if c then
        local pos = variantToPosition(var)
        local wall = Game.createItem(1497, 1, pos)
        addEvent(removeMw, 20000, pos, id, wall:getId())
    end
    return c
end

Then I change the duration of magic wall in items to lower one that I wanted! Thank you all!!!
 
Solved, I found a way. Based in some scripts that I found.

I use this to normal magic wall
Lua:
local id = 1497
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat:setParameter(COMBAT_PARAM_CREATEITEM, id)


function removeMw(pos, mw, wall)
    local tile = Tile(pos)
    mw = tile:getItemById(mw)
    wall = tile:getItemById(wall)
    if mw then mw:remove() end
    if wall then wall:remove() end
end

function onCastSpell(creature, var, isHotkey)
    local c = combat:execute(creature, var)
    if c then
        local pos = variantToPosition(var)
        local wall = Game.createItem(1497, 1, pos)
        addEvent(removeMw, 20000, pos, id, wall:getId())
    end
    return c
end

Then I change the duration of magic wall in items to lower one that I wanted! Thank you all!!!
Nice, i will try both methods! Good work.
 
Back
Top