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

Combat_formula_levelmagic

Killerwoot

Jus Blaze.
Joined
Oct 2, 2007
Messages
69
Reaction score
3
Location
Canada
Can someone please tell me how this works, because from posts i have searched I get that..

setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -5,-5,-5,-5)

would equal to -270 damage for a level 100 with magic level 50, which is surely not the case.
 
Depends on distro

That would be outdated if he's using a newer distro


This function alters the order of parameters a bit:
Lua:
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

Lua:
setCombatFormula(combat, type, mina, minb, maxa, maxb[, minl, maxl[, minm, maxm[, minc[, maxc]]]])
[cpp]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;[/cpp]
 
Last edited:
so how does it differ explain more , i am not good in this stuff lol :p

Explain example :

mina --> multiplier for?

minb --> multiplire for ?


etc...(i get dizzy with mathmtical stuff)


and what is minc?
 
  1. mina and maxa appear to be some multipliers, and they're always -1 in aggressive spells
  2. minb and maxb is bonus damage
  3. minl/maxl and minm/maxm are level divisors and magic level multipliers, respectively

    and what is minc?
    [cpp]if(minc && std::abs(min) < std::abs(minc))
    min = minc;

    if(maxc && std::abs(max) < std::abs(maxc))
    max = maxc;[/cpp]
  4. if (final) min/max damages are lower than minc/maxc, they'll be set to minc/maxc respectively

Most spells don't use the full function (setCombatFormula) but rather setAttackFormula/setHealingFormula
elfy probably made these shorter functions to create less confusion in the spell scripts. :p
 
Last edited:
Back
Top