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

Lua REGISTER on login.lua

Kuantikum

Member
Joined
Jul 3, 2015
Messages
219
Solutions
1
Reaction score
20
Hello guys,

I have founded this codes that use the Fist fighiting skills to add attack speed bonus:

C++:
Name: Fist Fighting / Attackspeed
Type: C ++
Author: Oneshot

 

I have already seen some requests in the forum about the skill Fist Fighting, where the more you trained it, the faster you would attack in the game, and it seems that this is a feature of Tibia. As it is a very easy modification in the sources, I decided to pass it on to the guys.

By default, the interval between attacks in Tibia is 2000ms, that is, one physical attack every two seconds. I made a small modification to the sources where Fist Fighting would be inversely proportional to that interval, that is, the higher the skill value, the smaller the interval would be.

I did it in a way that a player with level 200 Fist Fighting would then have a 75% reduction in attack range, that is, one attack every half a second or two attacks per second

Take into account that it takes as a base the attackspeed of the vocation or the weapon used, that is, if your server already has the so-called "fast attack", there is no point in adding this C ++ code.

 

 

Open your player.cpp, look for this:

Player :: getAttackSpeed ()
Replace the entire function, depending on your server version:

 

0.3.6

uint32_t Player :: getAttackSpeed ()
{
    Item * weapon = getWeapon ();
    if (weapon && weapon-> getAttackSpeed ()! = 0)
        return std :: ceil (weapon-> getAttackSpeed () * (1 - (getSkill (SKILL_FIST, SKILL_LEVEL) * 0.00375)));

    return std :: ceil (vocation-> getAttackSpeed () * (1 - (getSkill (SKILL_FIST, SKILL_LEVEL) * 0.00375)));
}
0.4

uint32_t Player :: getAttackSpeed () const
{
    return std :: ceil ((((weapon && weapon-> getAttackSpeed ()! = 0)? weapon-> getAttackSpeed () * (1 - (getSkill (SKILL_FIST, SKILL_LEVEL) * 0.00375)): (vocation-> getAttackSpeed () / std :: max ((size_t) 1, getWeapons (). size ()) * (1 - (getSkill (SKILL_FIST, SKILL_LEVEL) * 0.00375)))));
}


0.3.6
Lua:
uint32_t Player::getAttackSpeed()
{
Item* weapon = getWeapon();
if(weapon && weapon->getAttackSpeed() != 0)
return std::ceil(weapon->getAttackSpeed() * (1 - (getSkill(SKILL_FIST, SKILL_LEVEL) * 0.00375)));

return std::ceil(vocation->getAttackSpeed() * (1 - (getSkill(SKILL_FIST, SKILL_LEVEL) * 0.00375)));
}

0.4
Code:
uint32_t Player::getAttackSpeed() const
{
return std::ceil(((weapon && weapon->getAttackSpeed() != 0) ? weapon->getAttackSpeed() * (1 - (getSkill(SKILL_FIST, SKILL_LEVEL) * 0.00375)) : (vocation->getAttackSpeed() / std::max((size_t)1, getWeapons().size()) * (1 - (getSkill(SKILL_FIST, SKILL_LEVEL) * 0.00375)))));
}


Is it possible to configure in TFS 1.3 version ?
can you help me?
 
Back
Top