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

Rexanilator

New Member
Joined
Oct 3, 2009
Messages
297
Reaction score
2
I have been working for a couple of weeks adjusting and tweeking trying to come up with a balance for the main spells for each vocation. For some reason I cannot get it to adjust properly. I understand that there is a new spell formula for tfs 0.3.6 and so maybe this is part of the problem.

I am basically looking for a fair balance between the 4 vocations that will, at the same time, have the damage increase as level and skills increase.

Here are the four spells:

Knights
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_BIGEXPLOSION)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)

function onGetFormulaValues(cid, level, skill, attack, factor)
	local skillTotal, levelTotal = skill + attack * 3, level / 5
	return -(skillTotal * 1.1 + levelTotal), -(skillTotal * 3 + levelTotal)
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

Pally's
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 15, 20, 25, 30)

local area = createCombatArea(AREA_CIRCLE3X3)
setCombatArea(combat, area)

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

Druids
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 7, 7, 8, 14)

local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

Sorcerer
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 7, 7, 8, 14)

local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

I thank you in advance for your help and rep is always given for assistance.
 
Based on the way I understand your explanation - that would mean a lvl 400 Pally with 27 ml should hit a minimum of like 1300 based on the following code:

Code:
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 15, 20, 25, 30)

min = 400/15+27*25 = 1341.66666
max = 400/20+27*30 = 1410

What am I missing? Is my code correct on the paly, druid and sorc...and I just need to calculate the math on what I want min/max hits to be???

Also - is my code correct for tfs 0.3.6 for knight spells?

however the paly at this level still only hits like 300
 
Last edited:
Maybe someone can answer this question...

Is the formula actually this for tfs 0.3.6:

min = (level / minl) + (maglvl * minm)
max = (level / maxl) + (maglvl * maxm)

Or just the straight formula...

min = level / minl + maglvl * minm
max = level / maxl + maglvl * maxm


It makes a difference as to how the number is calculated.

Also - Players can hit the training monks or monsters with much higher damage than they hit the players (typically half)...I assume this is due to the equipment that players are wearing...but it seems to be about the same no matter what lvl player or equipment wearing. Anyone know about this?
 
Back
Top