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

change spell to tfs 1.4

felp

New Member
Joined
May 30, 2023
Messages
8
Reaction score
1
hi guys is there any way someone can give me this strength I need this spell on my server I got it from version 8.6 and today I'm using version 1000 tfs 1.4 but it's not working can anyone make this change?

View attachment 75967
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, true)

arr = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
}

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

function spellCallback(param)
local form = 3.5

if param.count > 0 or math.random(0, 1) == 1 then
doSendMagicEffect(param.pos, CONST_ME_MORTAREA)
doAreaCombatHealth(param.cid, COMBAT_DEATHDAMAGE, param.pos, 0, -(((form*getPlayerLevel(param.cid)/2)*getPlayerMagLevel(param.cid))/20)/2, -(((form*getPlayerLevel(param.cid)/2)*getPlayerMagLevel(param.cid))/20), CONST_ME_EXPLOSIONHIT)
end

if(not isCreature(param.cid)) then
return false
end

if(param.count < 5) then
param.count = param.count + 1
addEvent(spellCallback, math.random(1000, 3000), param)
end
end

function onCastSpell(cid, var)
doPlayerSetPzLocked(cid)
return doCombat(cid, combat, var)
end

function onTargetTile(cid, pos)
local param = {}
param.cid = cid
param.pos = pos
param.count = 0
spellCallback(param)
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
doSetCreatureOutfit(cid,{lookType = 290, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = getCreatureOutfit(cid).lookAddons}, 18 * 1000)
return doCombat(cid, combat, var)
end
 
just swap the old functions for the new one example here
Replace createCombatObject() with Combat()
Replace setCombatParam() with combat:setParameter()
Replace setCombatFormula() with combat:setFormula()
Replace createCombatArea() with CombatArea()
Replace addDamageCondition() with condition:addDamage()
Replace setCombatCondition() with combat:addCondition()
Replace onCastSpell() with combat.onCastSpell()
Replace createConditionObject() with Condition()
Replace setConditionParam() with condition:setParameter()
Replace doCombat() with combat:execute()

compatible functions for TFS 1.4 it is necessary to convert all functions!!

and so on..
I hope you understand

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

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

local area = CombatArea(arr)
combat:setArea(area)

function spellCallback(cid, param)
    local form = 3.5

    if param.count > 0 or math.random(0, 1) == 1 then
        Game.createEffect(EFFECT_MORTAREA, param.pos)
        combat:execute(cid, param.pos)
    end

    if not isCreature(cid) then
        return false
    end

    if param.count < 5 then
        param.count = param.count + 1
        addEvent(spellCallback, math.random(1000, 3000), cid, param)
    end
end

function onCastSpell(cid, var)
    Player(cid):setPzLocked(true)
    return combat:execute(cid, var)
end

function onTargetTile(cid, pos)
    local param = {cid = cid, pos = pos, count = 0}
    spellCallback(cid, param)
end

combat:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
    local player = Player(cid)
    player:setOutfit({lookType = 290, lookHead = player:getOutfit().lookHead, lookBody = player:getOutfit().lookBody, lookLegs = player:getOutfit().lookLegs, lookFeet = player:getOutfit().lookFeet, lookAddons = player:getOutfit().lookAddons}, 18 * 1000)
    return combat:execute(cid, var)
end
 
just swap the old functions for the new one example here
Replace createCombatObject() with Combat()
Replace setCombatParam() with combat:setParameter()
Replace setCombatFormula() with combat:setFormula()
Replace createCombatArea() with CombatArea()
Replace addDamageCondition() with condition:addDamage()
Replace setCombatCondition() with combat:addCondition()
Replace onCastSpell() with combat.onCastSpell()
Replace createConditionObject() with Condition()
Replace setConditionParam() with condition:setParameter()
Replace doCombat() with combat:execute()

compatible functions for TFS 1.4 it is necessary to convert all functions!!

and so on..
I hope you understand

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

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

local area = CombatArea(arr)
combat:setArea(area)

function spellCallback(cid, param)
    local form = 3.5

    if param.count > 0 or math.random(0, 1) == 1 then
        Game.createEffect(EFFECT_MORTAREA, param.pos)
        combat:execute(cid, param.pos)
    end

    if not isCreature(cid) then
        return false
    end

    if param.count < 5 then
        param.count = param.count + 1
        addEvent(spellCallback, math.random(1000, 3000), cid, param)
    end
end

function onCastSpell(cid, var)
    Player(cid):setPzLocked(true)
    return combat:execute(cid, var)
end

function onTargetTile(cid, pos)
    local param = {cid = cid, pos = pos, count = 0}
    spellCallback(cid, param)
end

combat:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
    local player = Player(cid)
    player:setOutfit({lookType = 290, lookHead = player:getOutfit().lookHead, lookBody = player:getOutfit().lookBody, lookLegs = player:getOutfit().lookLegs, lookFeet = player:getOutfit().lookFeet, lookAddons = player:getOutfit().lookAddons}, 18 * 1000)
    return combat:execute(cid, var)
end
good morning friend there was an error

1685888261779.png
 
this line 26 gave an error but the magic is working fine, I hope someone understands and can fix this line, I'm not very good in c++ "addevent etc"
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

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

local area = createCombatArea(arr)
combat:setArea(area)

function spellCallback(cid, param)
    local form = 3.5

    if param.count > 0 or math.random(0, 1) == 1 then
        doSendMagicEffect(param.pos, CONST_ME_MORTAREA)
        combat:execute(cid, param.pos)
    end

    if not isCreature(cid) then
        return false
    end

    if param.count < 5 then
        param.count = param.count + 1
        addEvent(spellCallback, math.random(1000, 3000), cid, param)
    end
end

function onCastSpell(cid, var)
    doPlayerSetPzLocked(cid)
    return combat:execute(cid, var)
end

function onTargetTile(cid, pos)
    local param = {cid = cid, pos = pos, count = 0}
    spellCallback(cid, param)
end

combat:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
    doSetCreatureOutfit(cid, {lookType = 290, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = getCreatureOutfit(cid).lookAddons}, 18 * 1000)
    return combat:execute(cid, var)
end
 
Last edited:
Back
Top