• 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+ Spells from older version TFS

Creater

From 0 to Hero :>
Joined
Oct 15, 2018
Messages
107
Reaction score
7
Location
Poland
Hey guys,

My question right now is a possible to convert in some way spells to tfs 1.3?

Unfortunately I dont know older version of server because I have got some bug when I running it and in details properties dont showing what a version is it.
 
Solution
There's no magic way you'll just change all spells from old TFS version to newer one, You'll have to open 1 spell by 1 spell and change all old function names to the new function names, It won't be so hard because you'll change small lines like this example.
TFS 0.4
Lua:
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
TFS 1.3
Lua:
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
And you'll have to add them in different way to your spells.xml too.
TFS 0.4
XML:
    <instant name="Eternal Winter" words="exevo gran mas frigo" lvl="60" mana="1200" prem="1" selftarget="1" exhaustion="1800" needlearn="0" event="script" value="attack/eternal winter.lua">
        <vocation id="2"/>
        <vocation id="6"/>...
There's no magic way you'll just change all spells from old TFS version to newer one, You'll have to open 1 spell by 1 spell and change all old function names to the new function names, It won't be so hard because you'll change small lines like this example.
TFS 0.4
Lua:
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
TFS 1.3
Lua:
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
And you'll have to add them in different way to your spells.xml too.
TFS 0.4
XML:
    <instant name="Eternal Winter" words="exevo gran mas frigo" lvl="60" mana="1200" prem="1" selftarget="1" exhaustion="1800" needlearn="0" event="script" value="attack/eternal winter.lua">
        <vocation id="2"/>
        <vocation id="6"/>
    </instant>
TFS 1.3
XML:
    <instant group="attack" name="Eternal Winter" words="exevo gran mas frigo" level="60" mana="1050" premium="1" selftarget="1" cooldown="40000" needlearn="0" script="attack/eternal_winter.lua">
        <vocation name="Druid" />
        <vocation name="Elder Druid" />
    </instant>
 
Solution
There's no magic way you'll just change all spells from old TFS version to newer one, You'll have to open 1 spell by 1 spell and change all old function names to the new function names, It won't be so hard because you'll change small lines like this example.
TFS 0.4
Lua:
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
TFS 1.3
Lua:
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
And you'll have to add them in different way to your spells.xml too.
TFS 0.4
XML:
    <instant name="Eternal Winter" words="exevo gran mas frigo" lvl="60" mana="1200" prem="1" selftarget="1" exhaustion="1800" needlearn="0" event="script" value="attack/eternal winter.lua">
        <vocation id="2"/>
        <vocation id="6"/>
    </instant>
TFS 1.3
XML:
    <instant group="attack" name="Eternal Winter" words="exevo gran mas frigo" level="60" mana="1050" premium="1" selftarget="1" cooldown="40000" needlearn="0" script="attack/eternal_winter.lua">
        <vocation name="Druid" />
        <vocation name="Elder Druid" />
    </instant>

Oooo, super thanks! I've got one more question just thi couldown how counting it? Because that's is like a exhausted?

And with instant group is just only attack, support (buff?) and healing?
 
Cooldown is same as Exhaustion 1000 = 1 second
and about instant group
for healing you can change it to : instant group="healing"
for haste/light and support spells you can change it to : instant group="support"
for attack like the one I posted above : <instant group="attack"
Nothing else.
 
Okay, so now I changed one skill, but when i start my server immediately is closing.

Here is a code what i Changed

Code:
local combat1 = createCombatObject()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 204)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -55.2, 1, -55.2, 1)

local combat2 = createCombatObject()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 137)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)


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

arr2 = {
    {1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 2, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0}
}

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

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

local function onCastSpell2(parameters)
    return isPlayer(parameters.cid) and doCombat(parameters.cid, combat2, parameters.var)
end

function onCastSpell(cid, var)
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 100, parameters)
addEvent(onCastSpell2, 200, parameters)
return TRUE
end

and of course from script:
Code:
    <instant group="attack" name="Booyaki" words="Booyaki" level="125" mana="5500" premium="0" range="4" casterTargetOrDirection="1" blockwalls="1" cooldown="2000" needlearn="0" script="pref/booyaki.lua">
        <vocation name="pref" />

and what's a meaqn castertargetofdirection?

@edit
I forgot put </instant> at the end, but now when I going to server I can't using this spell. Anyway I can't using /m and /n command. :/
 
Last edited:
Try this one
Lua:
local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat1:setParameter(COMBAT_PARAM_EFFECT, 204)
combat1:setFormula(COMBAT_FORMULA_LEVELMAGIC, -55.2, 1, -55.2, 1)
local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, 137)
combat2:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)

local area1 = {
    {0, 0, 0, 0, 0},
    {0, 1, 1, 1, 0},
    {0, 1, 3, 1, 0},
    {0, 1, 1, 1, 0},
    {0, 0, 0, 0, 0}
    }
local area2 =  {
    {1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 2, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0}
}

combat1:setArea(createCombatArea(area1))
combat2:setArea(createCombatArea(area2))

local function onCastSpell1(param)
    return isPlayer(param.cid) and combat:execute(param.cid, param.combat1, param.var)
end

local function onCastSpell2(param)
    return isPlayer(param.cid) and combat:execute(param.cid, param.combat2, param.var)
end

    function onCastSpell(creature, variant)
    local param = { cid = cid, var = var}
    addEvent(onCastSpell1, 100, param)
    addEvent(onCastSpell2, 200, param)
    return true
end
and for /m /n did you set your player group id to 3 and account type to 5?
 
Any errors on console? or when using it? Account Type not id which can be found in Accounts not Players.
type.PNG
 
Oh sorry. Now I can summon monster, but still spell not working

@edit
that looking previously this spell in script:
Code:
<instant name="Booyka" words="Booki" lvl="125" mana="5500" aggressive="1"  exhaustion="1000" needlearn="0" event="script" value="reki/boki.lua">
        <vocation id="17"/>
        <vocation id="18"/>
        <vocation id="19"/>
        <vocation id="20"/>
        <vocation id="21"/>
        <vocation id="22"/>
        <vocation id="23"/>
        <vocation id="24"/>
        <vocation id="25"/>
        <vocation id="257"/>
        <vocation id="26"/>
    </instant>
 
Try this one should work.

Lua:
local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat1:setParameter(COMBAT_PARAM_EFFECT, 204)
combat1:setFormula(COMBAT_FORMULA_LEVELMAGIC, -55.2, 1, -55.2, 1)
local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, 137)
combat2:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)

local area1 = {
    {0, 0, 0, 0, 0},
    {0, 1, 1, 1, 0},
    {0, 1, 3, 1, 0},
    {0, 1, 1, 1, 0},
    {0, 0, 0, 0, 0}
    }
local area2 =  {
    {1, 0, 0, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 2, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0}
}

combat1:setArea(createCombatArea(area1))
combat2:setArea(createCombatArea(area2))


function onCastSpell1(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat1:execute(player, variant)
    end
end

function onCastSpell2(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat2:execute(player, variant)
    end
end



function onCastSpell(creature, variant)
   local player = Player(creature)
    if not player then
        return false
    end
    addEvent(onCastSpell1, 100, player:getId(), variant:getNumber())
    addEvent(onCastSpell2, 200, player:getId(), variant:getNumber())
    return true
end
 
Ohhh yeah! Right now working! Thank you, you are amazing!

Can you give me small advice on future when I'l be want change a lot of spells? On what I must looking etc.?

Thanks!
 
As I said above you'll have to change most of functions in order to make it work because 0.4 function names are totally different from 1.3 function names.
Some spells can be hard and some can be simple, it depends.
Just check the differences between the 1.3 script above and 0.4 script and check what is changed.
You can also post any issues with spells in Support board and we'll help you.
 
Back
Top Bottom