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

TFS 1.4.2 getSkillLevel / getWeaponSkill

Dercas

Active Member
Joined
Nov 15, 2008
Messages
125
Solutions
1
Reaction score
48
Hi all,

Straight to the point, in the weapons.cpp //TFS142// there's:

C++:
int32_t chance;
if (it.hitChance == 0) {
    //hit chance is based on distance to target and distance skill
    uint32_t skill = player->getSkillLevel(SKILL_DISTANCE);
    const Position& playerPos = player->getPosition();
    const Position& targetPos = target->getPosition();
    uint32_t distance = std::max<uint32_t>(Position::getDistanceX(playerPos, targetPos), Position::getDistanceY(playerPos, targetPos));


I've tried changing this
uint32_t skill = player->getSkillLevel(SKILL_DISTANCE);
To work differently, i.e.
player->getWeaponSkill //at first we get what skill is used by the weapon
player->getSkillLevel//then we get the skill level for that weapon
& then return the value for further calculations of hitchance

Tried 10 different ways and failed, each time something goes wrong (for example, when attacking with a bow we get formula from fist fighting, lol)

Could anyone please help? :D


Thank you in advance!
 
Last edited:
Back
Top