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

FORMULA_LEVELMAGIC and other formulas.

Hermes

dziwki kola gramy w lola
Joined
Nov 17, 2007
Messages
1,867
Reaction score
14
Location
Poland
Hello.

I am trying to get how these formulas are working. I mean something like this:
Code:
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 6.5, 6.5, 5.5, 7.5)
the part in source concerned with this:
Code:
case FORMULA_LEVELMAGIC:
{
	min = (int32_t)((player->getLevel() / minl + player->getMagicLevel() * minm) * 1. * mina + minb);
	max = (int32_t)((player->getLevel() / maxl + player->getMagicLevel() * maxm) * 1. * maxa + maxb);
	if(minc && std::abs(min) < std::abs(minc))
		min = minc;
	if(maxc && std::abs(max) < std::abs(maxc))
		max = maxc;
	player->increaseCombatValues(min, max, params.useCharges, true);
	return true;
......
there are four values. I think those are mina, minb, maxa, maxb and eventually minc, maxc. But what's the real order? Why are there two value for min and max damage :f.
Any ideas?

@edit
setAttackFormula from functions.lua
Code:
function setAttackFormula(combat, type, minl, maxl, minm, maxm, min, max)
	local min, max = min or 0, max or 0
	return setCombatFormula(combat, type, -1, 0, -1, 0, minl, maxl, minm, maxm, -min, -max)
end

Best regards,
Hermes
 
Last edited:
Check function setAttackFormula in 050-function.lua, because it changes the order for the function in sources, setCombatFormula.
 
Back
Top