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

How to use setCombatFormula

igorbr

New Member
Joined
Jan 9, 2008
Messages
34
Reaction score
0
I want to learn how to use setCombatFormula function.

setCombatFormula(combat, type, mina, minb, maxa, maxb)

thanks for some help!
 
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, mina, minb, maxa, maxb)

minDamage = (Level + Magic Level * 4) * mina + minb
maxDamage = (Level + Magic Level * 4) * maxa + maxb

-------------------------------------------------------------
setCombatFormula(combat, COMBAT_FORMULA_SKILL, mina, minb, maxa, maxb)

minDamage = minb
maxDamage = Normal Weapon Damage * maxa + maxb

-------------------------------------------------------------
setCombatFormula(combat, COMBAT_FORMULA_DAMAGE, mina, minb, maxa, maxb)

minDamage = mina
maxDamage = maxa






There you go :D
 
'Cause I think it's different from TFS 0.3.2

There I found, for example:

PHP:
case FORMULA_LEVELMAGIC:
			{
				min = (int32_t)((player->getLevel() * 2 + player->getMagicLevel() * 3) * 1. * mina + minb);
				max = (int32_t)((player->getLevel() * 2 + player->getMagicLevel() * 3) * 1. * maxa + maxb);
				return true;
			}

I don't understand this level of programming yet, but I think it's different. Can you confirm that?
 
I took it from TFS 0.3.4pl2
Code:
case FORMULA_LEVELMAGIC:
			{
				min = (int32_t)((player->getLevel() + player->getMagicLevel() * 4) * 1. * mina + minb);
				max = (int32_t)((player->getLevel() + player->getMagicLevel() * 4) * 1. * maxa + maxb);

				Vocation* vocation = player->getVocation();
				float multiplier = 1.0f;
				if(max > 0)
					multiplier = vocation->getMultiplier(MULTIPLIER_MAGICHEALING);
				else
					multiplier = vocation->getMultiplier(MULTIPLIER_MAGIC);

				min = (int32_t)(min * multiplier);
				max = (int32_t)(max * multiplier);

				return true;
			}

[forgottenserver] View of /tags/0.3.4pl2/combat.cpp
 
Back
Top