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

Spell Explain on spell code

Captain Orhotek

New Member
Joined
May 20, 2009
Messages
118
Reaction score
1
I have been editing my spells but they seem a little strong I did not know an exact amount to add so I got code from another spell but I do not understand what each number means.
Code:
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -0.5, -50, -0.5, -50)

Anyone mind explaining please?
 
I just checked the source code. I think this is the formula:

Code:
max = (player->getLevel() * 2 + player->getMagicLevel() * 3) * 1. * mina + minb)
Code:
min = ((player->getLevel() * 2 + player->getMagicLevel() * 3) * 1. * maxa + maxb)
Code:
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.3 (mina), -30(minb), -1.8(maxa), 0(maxb))

Weird, don't see why they would have the max values in the min code, just take the highest amount there as the max :p.

I'm not 100% but it seems right to me.

I think the -30 means 30 hitpoints more added to the damage.
 
Last edited:
So what is the maxa and maxb. I am asking because In my spell I have ten different things going on within the spell and each is set to do its dmg by a variation of my first code...but I messed with it some and no luck on changing its dmg.
 
I think its like that:
first two values are for min damage and its magic power multiplier and modifier(how much more or less it should hit) and the third and fourth values are for max dmg value, working the same.

If I am right it should be sth like ((((lvl-20)*2)+(mlvl*3))*multiplier)+modifier (if the final value is higher than 0 spell will heal target)
I am not sure about the magic power formula, it is only a bit simplified formula from wiki, no idea what formula is used in otservs
 
Back
Top