- Joined
- Jul 25, 2007
- Messages
- 382
- Reaction score
- 38
Don't understand the spell damage formulas, I posted them from combat.cpp.
I thought this was max = wep_damage * max_a + max_b, through testing that is clearly not the case at all. I think it factors in player skill level too? I don't know, there isn't any documentation on this anywhere that I can find and it's kind of important if you plan to change spell damages. Can anyone properly explain the formula?
Don't understand why theirs negative values for min in spells etc, just as confused.
COMBAT_FORMULA_SKILL
Code:
Item* tool = player->getWeapon();
const Weapon* weapon = g_weapons->getWeapon(tool);
min = (int32_t)minb;
if(weapon)
{
max = (int32_t)(weapon->getWeaponDamage(player, target, tool, true) * maxa + maxb);
if(params.useCharges && tool->hasCharges())
{
int32_t newCharge = std::max<int32_t>(0, tool->getCharges() - 1);
g_game.transformItem(tool, tool->getID(), newCharge);
}
}
I thought this was max = wep_damage * max_a + max_b, through testing that is clearly not the case at all. I think it factors in player skill level too? I don't know, there isn't any documentation on this anywhere that I can find and it's kind of important if you plan to change spell damages. Can anyone properly explain the formula?
COMBAT_FORMULA_LEVELMAGIC
Code:
max = (int32_t)((player->getLevel() * 2 + player->getMagicLevel() * 3) * 1. * mina + minb);
min = (int32_t)((player->getLevel() * 2 + player->getMagicLevel() * 3) * 1. * maxa + maxb);
Don't understand why theirs negative values for min in spells etc, just as confused.
Last edited: