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

Lua {8.6} The Forgotten Server 0.3.6; Really fast healing spell?

xYzPrototype

Just a standard member
Joined
Feb 27, 2015
Messages
49
Reaction score
4
Location
EUW
Hello, I'm new to making servers/scripting and all the rest and have just made an account...

I am looking for a healing spell which heals the target 5x every second. For example, the spell
Code:
Exura Sio"FRIEND"
only heals the target once, I am looking for a spell that heals the target 5x every second for 5 seconds if that's possible?

Thanks
 
use
Code:
local i = 5
addEvent("yourHealFunction", 1*1000, cid, i, ...)
and in this function after healing lower "i" variable by one and add
Code:
if i > 0 then
addEvent("yourHealFunction", 1*1000, cid, i, ...)
 
use
Code:
local i = 5
addEvent("yourHealFunction", 1*1000, cid, i, ...)
and in this function after healing lower "i" variable by one and add
Code:
if i > 0 then
addEvent("yourHealFunction", 1*1000, cid, i, ...)

Thanks, but where do I add this to.. CreatureScripts?
 
To your healing spell in spells folder. I thought you know the basics, if you don't there are plenty of tutorials on the forum. Learn it all, then comeback here :D
 
To your healing spell in spells folder. I thought you know the basics, if you don't there are plenty of tutorials on the forum. Learn it all, then comeback here :D

Yeah I know the basics haha just it's a new thing for me haha.. So like this?
Code:
local i = 5
addEvent("Exura Tempo Sio", 1*1000, cid, i, ...)
if i > 0 then
addEvent("yourHealFunction", 1*1000, cid, i, ...)
end

local combat = createCombatObject()
local getPlayerLevel
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

function onGetFormulaValues(cid, level, maglevel)
   min = level*2.75 +maglevel*5.75
   max = level*3 +maglevel*6

   return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
 
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

function onGetFormulaValues(cid, level, maglevel)
   min = level*2.75 +maglevel*5.75
   max = level*3 +maglevel*6

   return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function healMe(i, parameters)
if i > 0 and isPlayer(parameters.cid) then
    doCombat(parameters.cid, parameters.combat, parameters.var)
end
i = i-1
addEvent("healMe", 1*1000, i, parameters)
end

function onCastSpell(cid, var)
local i = 4
local parameters = {cid = cid, var = var, combat = combat}
healMe(i, parameters)
end
I could make a mistake, I coudn't test it because I'm using TFS 1.0 now.
 
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

function onGetFormulaValues(cid, level, maglevel)
   min = level*2.75 +maglevel*5.75
   max = level*3 +maglevel*6

   return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function healMe(i, parameters)
if i > 0 and isPlayer(parameters.cid) then
    doCombat(parameters.cid, parameters.combat, parameters.var)
end
i = i-1
addEvent("healMe", 1*1000, i, parameters)
end

function onCastSpell(cid, var)
local i = 4
local parameters = {cid = cid, var = var, combat = combat}
healMe(i, parameters)
end
I could make a mistake, I coudn't test it because I'm using TFS 1.0 now.

Okay no problem. It's so annoying because I am studying this at Uni at the end of this academic year, and so the only experience I have in this is what I've gathered working on my server, which is next to nothing :( I really want to make an awesome server, but I rely too much on people making scripts for me and I don't want to rely on people.

Anyway, I tried that script and every time I say the spell I get this error on my client:
Code:
[27/02/2015 16:49:09] [Error - Spell Interface]
[27/02/2015 16:49:09] data/spells/scripts/healing/tempo heal friend.lua:onCastSpell
[27/02/2015 16:49:09] Description:
[27/02/2015 16:49:09] (luaAddEvent) Callback parameter should be a function.
 
change this:
Code:
addEvent("healMe", 1*1000, i, parameters)
to this:
Code:
addEvent(healMe, 1*1000, i, parameters)

It works now :D Thank you so much man, much appreciated.

EDITED: Everything works fine bro, but when I cast the spell it doesn't come up and there is no cool-down on it. Basically it's like a rune you can spam atm if you get what I mean xD
 
Last edited:
Back
Top