• 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.2 looking for unique area spell

Tbol

Well-Known Member
Joined
Apr 7, 2019
Messages
529
Reaction score
56
Hello
looking for area spell with pattern like this and after it casted once it would cast another pattern and the repeat first pattern and so on and on

b4741f786df6fa8de39935017fc32468.png


It suppose to warn the player that it will cast spell on these areas so somekind of effect would be casted on those places before spell would appear because this spell suppose to stun player for 3 seconds so they suppose to dodge it. Creatures will be able to cast this spell
 
Last edited:
a example:

data/scripts/testspell.lua
Lua:
local combats = {}
local areas = {
    -- Area 1
    {{1, 0, 1, 0, 1, 0, 1},
     {0, 1, 0, 1, 0, 1, 0},
     {1, 0, 1, 0, 1, 0, 1},
     {0, 1, 0, 3, 0, 1, 0},
     {1, 0, 1, 0, 1, 0, 1},
     {0, 1, 0, 1, 0, 1, 0},
     {1, 0, 1, 0, 1, 0, 1}},
    -- Area 2
    {{0, 1, 0, 1, 0, 1, 0},
     {1, 0, 1, 0, 1, 0, 1},
     {0, 1, 0, 1, 0, 1, 0},
     {1, 0, 1, 3, 1, 0, 1},
     {0, 1, 0, 1, 0, 1, 0},
     {1, 0, 1, 0, 1, 0, 1},
     {0, 1, 0, 1, 0, 1, 0}}
}
 
for i = 1, #areas do
combats[i] = Combat()
combats[i]:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combats[i]:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
combats[i]:setArea(createCombatArea(areas[i]))
function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 8) + 50
    local max = (level / 5) + (magicLevel * 12) + 75
    return -min, -max
end
 
combats[i]:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
end
local function castSpell(creatureId, variant, combatIndex)
    local creature = Creature(creatureId)
    if creature then
        combats[combatIndex]:execute(creature, variant)
    end
end
 
local spell = Spell("instant")
function spell.onCastSpell(creature, variant)
    for i = 2, #areas do
        addEvent(castSpell, 250 * i, creature:getId(), variant, i)
    end
    return combats[1]:execute(creature, variant)
end
 
spell:name("Hell's Core 2")
spell:words("exevo gran flam")
spell:group("attack")
spell:vocation("sorcerer", "master sorcerer")
spell:id(24)
spell:cooldown(40 * 1000)
spell:groupCooldown(4 * 1000)
spell:level(60)
spell:mana(1100)
spell:isSelfTarget(true)
spell:isPremium(true)
spell:register()

GIF 18-11-2021 03-03-25 p. m..gif
 
a example:

data/scripts/testspell.lua
Lua:
local combats = {}
local areas = {
    -- Area 1
    {{1, 0, 1, 0, 1, 0, 1},
     {0, 1, 0, 1, 0, 1, 0},
     {1, 0, 1, 0, 1, 0, 1},
     {0, 1, 0, 3, 0, 1, 0},
     {1, 0, 1, 0, 1, 0, 1},
     {0, 1, 0, 1, 0, 1, 0},
     {1, 0, 1, 0, 1, 0, 1}},
    -- Area 2
    {{0, 1, 0, 1, 0, 1, 0},
     {1, 0, 1, 0, 1, 0, 1},
     {0, 1, 0, 1, 0, 1, 0},
     {1, 0, 1, 3, 1, 0, 1},
     {0, 1, 0, 1, 0, 1, 0},
     {1, 0, 1, 0, 1, 0, 1},
     {0, 1, 0, 1, 0, 1, 0}}
}
 
for i = 1, #areas do
combats[i] = Combat()
combats[i]:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combats[i]:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
combats[i]:setArea(createCombatArea(areas[i]))
function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 8) + 50
    local max = (level / 5) + (magicLevel * 12) + 75
    return -min, -max
end
 
combats[i]:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
end
local function castSpell(creatureId, variant, combatIndex)
    local creature = Creature(creatureId)
    if creature then
        combats[combatIndex]:execute(creature, variant)
    end
end
 
local spell = Spell("instant")
function spell.onCastSpell(creature, variant)
    for i = 2, #areas do
        addEvent(castSpell, 250 * i, creature:getId(), variant, i)
    end
    return combats[1]:execute(creature, variant)
end
 
spell:name("Hell's Core 2")
spell:words("exevo gran flam")
spell:group("attack")
spell:vocation("sorcerer", "master sorcerer")
spell:id(24)
spell:cooldown(40 * 1000)
spell:groupCooldown(4 * 1000)
spell:level(60)
spell:mana(1100)
spell:isSelfTarget(true)
spell:isPremium(true)
spell:register()

View attachment 63504
Hmm it misses two most important stuff that i mentioned which is warning before it is casted and player stun because if it cast it instantly how people suppose to dodge it. Btw im not using data/scripts. Tfs 1.2 doesnt have it.
 
Hmm it misses two most important stuff that i mentioned which is warning before it is casted and player stun because if it cast it instantly how people suppose to dodge it. Btw im not using data/scripts. Tfs 1.2 doesnt have it.
Youll need to install a stun function for that.
There are a few on the forum.
And about the warning just copy the wave evennt with an addevent function make it deal 0 damage (no formula) and use the orange square effect on it.
 
maybe:

data/scripts/spell.lua
Lua:
local combats = {}
local areas = {
    -- Area 1
    { arr = {{1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 3, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1}},
        effect = CONST_ME_TUTORIALSQUARE
    },
    -- Area 2
    { arr = {{1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 3, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1}},
        type = COMBAT_FIREDAMAGE,
        effect = CONST_ME_FIREAREA
    },
    -- Area 3
    { arr = {{0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 3, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0}},
        effect = CONST_ME_TUTORIALSQUARE
    },
    -- Area 4
    { arr = {{0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 3, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0}},
        type = COMBAT_FIREDAMAGE,
        effect = CONST_ME_FIREAREA
    }
}
 
for i, arr in pairs(areas) do
combats[i] = Combat()
if arr.effect then combats[i]:setParameter(COMBAT_PARAM_EFFECT, arr.effect) end
combats[i]:setArea(createCombatArea(arr.arr))
if arr.type then
    combats[i]:setParameter(COMBAT_PARAM_TYPE, arr.type)
    function onGetFormulaValues(player, level, magicLevel)
        local min = (level / 5) + (magicLevel * 8) + 50
        local max = (level / 5) + (magicLevel * 12) + 75
        return -min, -max
    end
 
    combats[i]:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
    end
end
local function castSpell(creatureId, variant, combatIndex)
    local creature = Creature(creatureId)
    if creature then
        combats[combatIndex]:execute(creature, variant)
    end
end
 
local spell = Spell("instant")
function spell.onCastSpell(creature, variant)
    for i = 2, #areas do
        addEvent(castSpell, 500 * i, creature:getId(), variant, i)
    end
    return combats[1]:execute(creature, variant)
end
 
spell:name("Hell's Core 2")
spell:words("exevo gran flam")
spell:group("attack")
spell:vocation("sorcerer", "master sorcerer")
spell:id(24)
spell:cooldown(40 * 1000)
spell:groupCooldown(4 * 1000)
spell:level(60)
spell:mana(1100)
spell:isSelfTarget(true)
spell:isPremium(true)
spell:register()
GIF 20-11-2021 01-34-40 a. m..gif
 
maybe:

data/scripts/spell.lua
Lua:
local combats = {}
local areas = {
    -- Area 1
    { arr = {{1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 3, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1}},
        effect = CONST_ME_TUTORIALSQUARE
    },
    -- Area 2
    { arr = {{1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 3, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1}},
        type = COMBAT_FIREDAMAGE,
        effect = CONST_ME_FIREAREA
    },
    -- Area 3
    { arr = {{0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 3, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0}},
        effect = CONST_ME_TUTORIALSQUARE
    },
    -- Area 4
    { arr = {{0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 3, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0}},
        type = COMBAT_FIREDAMAGE,
        effect = CONST_ME_FIREAREA
    }
}
 
for i, arr in pairs(areas) do
combats[i] = Combat()
if arr.effect then combats[i]:setParameter(COMBAT_PARAM_EFFECT, arr.effect) end
combats[i]:setArea(createCombatArea(arr.arr))
if arr.type then
    combats[i]:setParameter(COMBAT_PARAM_TYPE, arr.type)
    function onGetFormulaValues(player, level, magicLevel)
        local min = (level / 5) + (magicLevel * 8) + 50
        local max = (level / 5) + (magicLevel * 12) + 75
        return -min, -max
    end
 
    combats[i]:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
    end
end
local function castSpell(creatureId, variant, combatIndex)
    local creature = Creature(creatureId)
    if creature then
        combats[combatIndex]:execute(creature, variant)
    end
end
 
local spell = Spell("instant")
function spell.onCastSpell(creature, variant)
    for i = 2, #areas do
        addEvent(castSpell, 500 * i, creature:getId(), variant, i)
    end
    return combats[1]:execute(creature, variant)
end
 
spell:name("Hell's Core 2")
spell:words("exevo gran flam")
spell:group("attack")
spell:vocation("sorcerer", "master sorcerer")
spell:id(24)
spell:cooldown(40 * 1000)
spell:groupCooldown(4 * 1000)
spell:level(60)
spell:mana(1100)
spell:isSelfTarget(true)
spell:isPremium(true)
spell:register()
View attachment 63514
Works perfectly. So for stun i should need to merge it with this spell?
 
Works perfectly. So for stun i should need to merge it with this spell?
Yes. then just add this into sarah's code


Lua:
 -- Stun
    local stun = Condition(CONDITION_STUN)
    stun:setParameter(CONDITION_PARAM_TICKS, stunDuration)
    stunCreature:addCondition(stun)

prob youll need to add an extra combat parameter then just call it inside her oncast code
 
Yes. then just add this into sarah's code


Lua:
 -- Stun
    local stun = Condition(CONDITION_STUN)
    stun:setParameter(CONDITION_PARAM_TICKS, stunDuration)
    stunCreature:addCondition(stun)

prob youll need to add an extra combat parameter then just call it inside her oncast code
Aight installed it in src
4e6866e4beaec4d655664cbfec105b58.png

Lua:
local combats = {}
local areas = {
    -- Area 1
    { arr = {{1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 3, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1}},
        effect = CONST_ME_POFF
    },
    -- Area 2
    { arr = {{1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 3, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1}},
        type = COMBAT_FIREDAMAGE,
        effect = CONST_ME_FIREAREA
    },
    -- Area 3
    { arr = {{0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 3, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0}},
        effect = CONST_ME_POFF
    },
    -- Area 4
    { arr = {{0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 3, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0}},
        type = COMBAT_FIREDAMAGE,
        effect = CONST_ME_FIREAREA
    }
}
 
for i, arr in pairs(areas) do
combats[i] = Combat()
if arr.effect then combats[i]:setParameter(COMBAT_PARAM_EFFECT, arr.effect) end
combats[i]:setArea(createCombatArea(arr.arr))
if arr.type then
    combats[i]:setParameter(COMBAT_PARAM_TYPE, arr.type)
    function onGetFormulaValues(player, level, magicLevel)
        local min = (level / 5) + (magicLevel * 8) + 50
        local max = (level / 5) + (magicLevel * 12) + 75
        return -min, -max
    end
 
    combats[i]:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
    end
end
local function castSpell(creatureId, variant, combatIndex)
    local creature = Creature(creatureId)
    if creature then
        combats[combatIndex]:execute(creature, variant)
    end
end
 
function onCastSpell(creature, variant)
    for i = 2, #areas do
        addEvent(castSpell, 800 * i, creature:getId(), variant, i)
        -- Stun
        local stun = Condition(CONDITION_STUN)
        stun:setParameter(CONDITION_PARAM_TICKS, stunDuration)
        stunCreature:addCondition(stun)
    end
    return combats[1]:execute(creature, variant)
end
 
hi people! what spell creator are u using for that? im looking to create spells that can make the Character "teleport" or moove 2-3 squares and then hit in an are but i can only find a spell creator released in 2012 and has no such options :(
 
Back
Top