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

Spell Ascuas Funkeln Spell's

Ascuas Funkeln

Rakkedo Game
Joined
Apr 14, 2013
Messages
549
Solutions
32
Reaction score
305
Location
Poland
GitHub
AscuasFunkeln
Its for TFS 0.3.6(8.6) - However, they should work on others too.

@edit
Code fixed

Regeneration Spell - (With healing effects, displayed healing values etc.)

Code:
-- Regeneration Spell by Ascuas Funkeln
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5 * 2000) -- Set it via onCastSpell, second and third number.
setCombatCondition(combat, condition)

function Regeneration(cid, HPV, max, delay)
    local player = isPlayer(cid)
    if not player then
        return
    end

    local HpValue = (getPlayerLevel(cid) * 8.0 + getPlayerMagLevel(cid) * 9.0) -- Healing value by editing numbers.
doCreatureAddHealth(cid, HpValue)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) -- Setup own effect.
    if HPV < max then
        addEvent(Regeneration, delay, cid, HPV+1, max, delay)
    end
end

function onCastSpell(cid, var)
if exhaustion.check(cid, 45353) then
doPlayerSendCancel(cid, "You are still exhausted for "..exhaustion.get(cid, 45353).." seconds.")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
return false
end
doCreatureSay(cid, 'Test', TALKTYPE_MONSTER) -- Write here spell name xD
doCreatureAddMana(cid, -5)
doPlayerAddSpentMana(cid, 5)
exhaustion.set(cid, 45353, 10)
    return doCombat(cid, combat, var) and Regeneration(cid, 1, 15, 500) -- second number is how many ticks spell have, third is a ticks delay.
end

Edited by @Sarah Wesker for 1.x

Code:
local function eventRegeneration(playerId, seconds)
    local player = Player(playerId)
    if seconds > 0 and player then
        local healvalue = ((player:getLevel() * 0.2) + (player:getMagicLevel() * 2))
        player:addHealth(healvalue)
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
        addEvent(eventRegeneration, 1000, playerId, seconds - 1)
    end
end

local coolDownStorageID = 666777
local coolDownSeconds = 10

function onCastSpell(player, variant)
    if player:getStorageValue(coolDownStorageID) <= os.time() then
        player:setStorageValue(coolDownStorageID, os.time() + (coolDownSeconds - 1))
        return eventRegeneration(player:getId(), coolDownSeconds)
    end
    return not player:sendCancelMessage("You are exhausted.")
end
 
Last edited:
I just looking for that option that doing magiceffect every tick ,Thanks!

Hello, there i will share with you (some :D) spells that I have prepared for my own project.
Its for TFS 0.3.6(8.6) - However, they should work on others too.
Today I will add the first spell.

Regeneration Spell - (With healing effects, displayed healing values etc.)
Lua:
-- Regeneration Spell by Ascuas Funkeln
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5 * 2000) -- Set it via onCastSpell, second and third number.
setCombatCondition(combat, condition)

function Regeneration(cid, HPV, max, delay)
    local player = isPlayer(cid)
    if not player then
        return
    end
    local HpValue = (getPlayerLevel(cid) * 5.0 + getPlayerMagLevel(cid) * 5.0) -- Healing value by editing numbers.
doCreatureAddHealth(cid, HpValue)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) -- Setup own effect.
    if HPV < max then
        addEvent(Regeneration, delay, cid, HPV+1, max, delay)
    end
end

function onCastSpell(cid, var)
    return doCombat(cid, combat, var) and Regeneration(cid, 1, 5, 2000) -- second number is how many ticks spell have, third is a ticks delay.
end

ENJOY, visit my signature links and preparing for release xD

BTW where to past :


  1. [*]if exhaustion.check(cid, 45353) then
    [*] doPlayerSendCancel(cid, "You are still exhausted for "..exhaustion.get(cid, 45353).." seconds.")
    [*] doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
    [*] return false
    [*]end
    [*]exhaustion.set(cid, 45353, 10)

  1. becouse i can make spam whit that spell ;D

 
Last edited by a moderator:
Hello, there i will share with you (some :D) spells that I have prepared for my own project.
Its for TFS 0.3.6(8.6) - However, they should work on others too.
Today I will add the first spell.

Regeneration Spell - (With healing effects, displayed healing values etc.)
Lua:
-- Regeneration Spell by Ascuas Funkeln
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5 * 2000) -- Set it via onCastSpell, second and third number.
setCombatCondition(combat, condition)

function Regeneration(cid, HPV, max, delay)
    local player = isPlayer(cid)
    if not player then
        return
    end
    local HpValue = (getPlayerLevel(cid) * 5.0 + getPlayerMagLevel(cid) * 5.0) -- Healing value by editing numbers.
doCreatureAddHealth(cid, HpValue)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) -- Setup own effect.
    if HPV < max then
        addEvent(Regeneration, delay, cid, HPV+1, max, delay)
    end
end

function onCastSpell(cid, var)
    return doCombat(cid, combat, var) and Regeneration(cid, 1, 5, 2000) -- second number is how many ticks spell have, third is a ticks delay.
end

ENJOY, visit my signature links and preparing for release xD

on tfs 1.0, it can crash you server. Also, in your addEvent, you are passing delay twice

it would be great if it was possible to add magic effect in condition by deafult, would be much better :p

Nvm, delay is the number haha, good job
 
Last edited by a moderator:
BTW where to past :


  1. becouse i can make spam whit that spell ;D
I test it now on unedited tfs and i see problem,
Lua:
-- Regeneration Spell by Ascuas Funkeln
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_LIGHT)
setConditionParam(condition, CONDITION_PARAM_LIGHT_LEVEL, 10)
setConditionParam(condition, CONDITION_PARAM_LIGHT_COLOR, 215)
setConditionParam(condition, CONDITION_PARAM_TICKS, (6 * 60 + 10) * 1000)
setCombatCondition(combat, condition)

function Regeneration(cid, HPV, max, delay)
    local player = isPlayer(cid)
    if not player then
        return
    end

    local HpValue = (getPlayerLevel(cid) * 8.0 + getPlayerMagLevel(cid) * 9.0) -- Healing value by editing numbers.
doCreatureAddHealth(cid, HpValue)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) -- Setup own effect.
    if HPV < max then
        addEvent(Regeneration, delay, cid, HPV+1, max, delay)
    end
end

function onCastSpell(cid, var)
if exhaustion.check(cid, 45353) then
doPlayerSendCancel(cid, "You are still exhausted for "..exhaustion.get(cid, 45353).." seconds.")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
return false
end
doCreatureAddMana(cid, -5)
doPlayerAddSpentMana(cid, 5)
exhaustion.set(cid, 45353, 10)
    return doCombat(cid, combat, var) and Regeneration(cid, 1, 15, 500) -- second number is how many ticks spell have, third is a ticks delay.
end
Fixed for "Basic 0.3.6."

Cant edit post LEL -.-
Idk why in fixed message i have pasted light conditions XDXD
There is good one
Lua:
-- Regeneration Spell by Ascuas Funkeln
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5 * 2000) -- Set it via onCastSpell, second and third number.
setCombatCondition(combat, condition)

function Regeneration(cid, HPV, max, delay)
    local player = isPlayer(cid)
    if not player then
        return
    end

    local HpValue = (getPlayerLevel(cid) * 8.0 + getPlayerMagLevel(cid) * 9.0) -- Healing value by editing numbers.
doCreatureAddHealth(cid, HpValue)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) -- Setup own effect.
    if HPV < max then
        addEvent(Regeneration, delay, cid, HPV+1, max, delay)
    end
end

function onCastSpell(cid, var)
if exhaustion.check(cid, 45353) then
doPlayerSendCancel(cid, "You are still exhausted for "..exhaustion.get(cid, 45353).." seconds.")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
return false
end
doCreatureAddMana(cid, -5) -- Mana cost with 
doPlayerAddSpentMana(cid, 5) -- Mana add to magic level spent
exhaustion.set(cid, 45353, 10)
    return doCombat(cid, combat, var) and Regeneration(cid, 1, 15, 500) -- second number is how many ticks spell have, third is a ticks delay.
end
 
Last edited by a moderator:
jHlXmCh.gif


Working , but there isnt any words after a spell cast , but its isnt problem so much ;)
 
jHlXmCh.gif


Working , but there isnt any words after a spell cast , but its isnt problem so much ;)

Lua:
-- Regeneration Spell by Ascuas Funkeln
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5 * 2000) -- Set it via onCastSpell, second and third number.
setCombatCondition(combat, condition)

function Regeneration(cid, HPV, max, delay)
    local player = isPlayer(cid)
    if not player then
        return
    end

    local HpValue = (getPlayerLevel(cid) * 8.0 + getPlayerMagLevel(cid) * 9.0) -- Healing value by editing numbers.
doCreatureAddHealth(cid, HpValue)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) -- Setup own effect.
    if HPV < max then
        addEvent(Regeneration, delay, cid, HPV+1, max, delay)
    end
end

function onCastSpell(cid, var)
if exhaustion.check(cid, 45353) then
doPlayerSendCancel(cid, "You are still exhausted for "..exhaustion.get(cid, 45353).." seconds.")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
return false
end
doCreatureSay(cid, 'Test', TALKTYPE_MONSTER) -- Write here spell name xD
doCreatureAddMana(cid, -5)
doPlayerAddSpentMana(cid, 5)
exhaustion.set(cid, 45353, 10)
    return doCombat(cid, combat, var) and Regeneration(cid, 1, 15, 500) -- second number is how many ticks spell have, third is a ticks delay.
end
 
In TFS 1.2 you get this error:
luaAddEvent(). Argument #3 is unsafe
data/spells/scripts/support/regen.lua:21: in function 'Regeneration'
data/spells/scripts/support/regen.lua:32: in function <data/spells/scripts/support/regen.lua:25>

any fixes?
 
In TFS 1.2 you get this error:
luaAddEvent(). Argument #3 is unsafe
data/spells/scripts/support/regen.lua:21: in function 'Regeneration'
data/spells/scripts/support/regen.lua:32: in function <data/spells/scripts/support/regen.lua:25>

any fixes?

for your version 1.x+
Code:
local function eventRegeneration(playerId, seconds)
    local player = Player(playerId)
    if seconds > 0 and player then
        local healvalue = ((player:getLevel() * 0.2) + (player:getMagicLevel() * 2))
        player:addHealth(healvalue)
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
        addEvent(eventRegeneration, 1000, playerId, seconds - 1)
    end
end

local coolDownStorageID = 666777
local coolDownSeconds = 10

function onCastSpell(player, variant)
    if player:getStorageValue(coolDownStorageID) <= os.time() then
        player:setStorageValue(coolDownStorageID, os.time() + (coolDownSeconds - 1))
        return eventRegeneration(player:getId(), coolDownSeconds)
    end
    return not player:sendCancelMessage("You are exhausted.")
end
 
Back
Top