Hello!
I wonder if there is anyone who could help me with the healing spells. I am using TFS 0.2.9 and they don't work as they should.
This is how MY script looks like:
I have also tried the normal one:
The thing is when I choose "COMBAT_HEALING" it steals hp instead of healing and when I choose "COMBAT_PHYSICALDAMAGE" it heals full hp, no matter what I set as min/max.
Any idea how I can fix this?
Thanks in advance!
I wonder if there is anyone who could help me with the healing spells. I am using TFS 0.2.9 and they don't work as they should.
This is how MY script looks like:
PHP:
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)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
function onGetFormulaValues(cid, level, maglevel)
local voc = getPlayerVocation(cid)
local level = getPlayerLevel(cid)
local maglevel = getPlayerMagLevel(cid)
if voc == 10 or voc == 21 then
min = (level * 2 + maglevel * 3) * 0.3015
max = (level * 2 + maglevel * 3) * 0.522
if min < 23 then
min = 23
end
elseif voc == 20 then
min = (level * 2 + maglevel * 3) * 0.402
max = (level * 2 + maglevel * 3) * 0.696
if min < 30 then
min = 30
end
elseif voc == 26 then
min = (level * 2 + maglevel * 3) * .670
max = (level * 2 + maglevel * 3) * 1.16
if min < 50 then
min = 50
end
else
min = (level * 2 + maglevel * 3) * .335
max = (level * 2 + maglevel * 3) * .58
if min < 25 then
min = 25
end
end
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
I have also tried the normal one:
PHP:
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)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0.08, 0, 0.33, 0)
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
The thing is when I choose "COMBAT_HEALING" it steals hp instead of healing and when I choose "COMBAT_PHYSICALDAMAGE" it heals full hp, no matter what I set as min/max.
Any idea how I can fix this?
Thanks in advance!