• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Weapon damage, where to find formula?

andu

Sold 649 scripts, 25 maps and 9 events!
Joined
Aug 7, 2009
Messages
978
Solutions
17
Reaction score
373
GitHub
olrios
Twitch
jamagowy
Found sth like this:
Code:
case COMBAT_FORMULA_SKILL: {
    Item* tool = player->getWeapon();
    const Weapon* weapon = g_weapons->getWeapon(tool);
    if (weapon) {
        damage.primary.value = normal_random(
        static_cast<int32_t>(minb),
        static_cast<int32_t>(weapon->getWeaponDamage(player, target, tool, true) * maxa + maxb)
    );
   
   
   
...

But, what is the value of getWeaponDamage? Where I can find it?
 
Solution
Not sure what are you asking for but the formula comes from the methods below (in weapons.cpp):
  • WeaponDistance::getWeaponDamage
  • WeaponMelee::getWeaponDamage
  • WeaponWand::getWeaponDamage
The weapon damage formula is composed of other methods and values mixed with each other somehow.
To find more, check Player::getAttackFactor (player.cpp), Weapons::getMaxWeaponDamage (weapons.cpp), Vocation::getMeleeBaseDamage (vocation.cpp).
Not sure what are you asking for but the formula comes from the methods below (in weapons.cpp):
  • WeaponDistance::getWeaponDamage
  • WeaponMelee::getWeaponDamage
  • WeaponWand::getWeaponDamage
The weapon damage formula is composed of other methods and values mixed with each other somehow.
To find more, check Player::getAttackFactor (player.cpp), Weapons::getMaxWeaponDamage (weapons.cpp), Vocation::getMeleeBaseDamage (vocation.cpp).
 
Solution

Similar threads

Back
Top