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

Help! TFS 1.5 the power of spells!

teka123

Active Member
Joined
Nov 9, 2009
Messages
87
Reaction score
49
Location
Poland
Hi! I have a question for someone if someone could write me briefly and help me, what he is responsible for and how to change the parameters. I mean the power of spells. I want to change so that the strength depends on the level, not on the skill or magic lvl. And that it gradually grows with everyone.
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLICE)

function onGetFormulaValues(player, level, magicLevel)​

local min = (level / 5) + (magicLevel * 1.4) + 8​

local max = (level / 5) + (magicLevel * 2.2) + 14​

return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
return combat:execute(creature, variant)
end

I have thickened what I consider the most important, or maybe it is not? What to change in the ruler so that the strength of the spell is counted from the level?
And what do I have to change to calculate more or less the value for a given level?

Thank you very much in advance!​
 
Hi! I have a question for someone if someone could write me briefly and help me, what he is responsible for and how to change the parameters. I mean the power of spells. I want to change so that the strength depends on the level, not on the skill or magic lvl. And that it gradually grows with everyone.


I have thickened what I consider the most important, or maybe it is not? What to change in the ruler so that the strength of the spell is counted from the level?
And what do I have to change to calculate more or less the value for a given level?

Thank you very much in advance!​
It's just a simple math equation.

If you substitute it out
Lua:
local min = (level / 5) + (magicLevel * 1.4) + 8
local max = (level / 5) + (magicLevel * 2.2) + 14
Imagine your level is 117, with magic level 74, it would look like this
Lua:
local min = (117 / 5) + (74 * 1.4) + 8
local max = (117 / 5) + (74 * 2.2) + 14
Conversely, if you wanted it to be based around your level only..
Lua:
local min = level * 2
local max = level * 3
 
Just so you know, tfs multiply this value by other random values in combat system, if you just want to deal x ammount of damage not matter what you can use doTargetCombathealth or doAreaCombatHealth in your spells
 
Back
Top