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

Help me change melee formula and distance

jackl90

Member
Joined
Jul 25, 2017
Messages
249
Reaction score
12
Hello, someone understand about this?

I'm trying change the formula melee and distance to 7.4 in tfs 1.2
someone can tell me if i did it right?

In weapons.cpp for meelee formula i just did change this line above

C++:
 return static_cast<int32_t>(std::ceil((2 * (attackValue * (attackSkill + 5.8) / 25 + (level - 1) / 10.)) / attackFactor));
to
C++:
return static_cast<int32_t>(std::ceil(attackValue * attackSkill * 0.06) / attackFactor);

but, idk where can i add distance formula.

in weapons.cpp i need add this, but where?
C++:
int32_t Weapons::getMaxDistanceWeaponDamage(uint32_t level, int32_t attackSkill, int32_t attackValue, float attackFactor)
{
 return static_cast<int32_t>(std::ceil(attackValue * attackSkill * 0.065) / attackFactor);
}

and i did change it
C++:
int32_t maxValue = static_cast<int32_t>(Weapons::getMaxWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor) * player->getVocation()->distDamageMultiplier);

to
C++:
int32_t maxValue = static_cast<int32_t>(Weapons::getMaxDistanceWeaponDamage(player->getLevel(), attackSkill, attackValue, attackFactor) * player->getVocation()->distDamageMultiplier);

and in weapons.h i need put this
C++:
static int32_t getMaxDistanceWeaponDamage(uint32_t level, int32_t attackSkill, int32_t attackValue, float attackFactor);
 

Similar threads

Back
Top