• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Tfs 0.4 0.4.6 & Otx Fast Attack by 2 Steps (Actualizado)

adric21

Well-Known Member
Joined
Apr 26, 2016
Messages
299
Solutions
1
Reaction score
90
Find inPlayer.cpp:
Code:
uint32_t Player::getAttackSpeed() const

Later change this fuction by:
Code:
uint32_t Player::getAttackSpeed() const
{
    int32_t SpeedAttack;
    SpeedAttack = vocation->getAttackSpeed() - (getSkill(SKILL_FIST, SKILL_LEVEL) * 10);

    if (SpeedAttack < 500) {
        return 500;
    } else {
        return (uint32_t) SpeedAttack;
    }
}
 
I will add this code for 0.3.6 too:
Here we go
Code:
uint32_t Player::getAttackSpeed()
{
    int32_t SpeedAttack;
    SpeedAttack = vocation->getAttackSpeed() - (getSkill(SKILL_SWORD, SKILL_LEVEL) * 10);

    if (SpeedAttack < 500) {
        return 500;
    } else {
        return (uint32_t) SpeedAttack;
    }
}
 
Hello refresh. Does have someone to OTX 2.16 based on 0.3.7 ? best regards

Fast attack based on skill fist.

When I compile occurs : skill fist.webp

post player.cpp:
playher cpp.webp
I see maybe somethink with this sign ---> "{"
 
Last edited:
Hello refresh. Does have someone to OTX 2.16 based on 0.3.7 ? best regards

Fast attack based on skill fist.

When I compile occurs : View attachment 95928

post player.cpp:
View attachment 95929
I see maybe somethink with this sign ---> "{"

You probably removed the function that was there.

I am unsure what function was that, I cannot seem to find that code part in sources.

If you post link to your sources, maybe I can help.
 
You should replace whole function (all between { and })

Function means the whole function header + body (what's inside), and not just the header as you did ;)

So replace:
Code:
uint32_t Player::getAttackSpeed() const
{
    int32_t modifiers = 0;
    if(outfitAttributes)
    {
        Outfit outfit;
        if(Outfits::getInstance()->getOutfit(defaultOutfit.lookType, outfit))
        {
            if(outfit.attackSpeed == -1)
                return 0;

            modifiers += outfit.attackSpeed;
        }
    }

    Item* _weapon = weapon;
    if(!weapon || weapon->getWeaponType() == WEAPON_AMMO)
        _weapon = const_cast<Player*>(this)->getWeapon(true);

    return (((_weapon && _weapon->getAttackSpeed() != 0) ? _weapon->getAttackSpeed() : (vocation->getAttackSpeed() / std::max((size_t)1, getWeapons().size()))) + modifiers);
}

With this:
Code:
uint32_t Player::getAttackSpeed()
{
    int32_t SpeedAttack;
    SpeedAttack = vocation->getAttackSpeed() - (getSkill(SKILL_SWORD, SKILL_LEVEL) * 10);

    if (SpeedAttack < 500) {
        return 500;
    } else {
        return (uint32_t) SpeedAttack;
    }
}
 
First post works:
LUA:
uint32_t Player::getAttackSpeed() const
{
    int32_t SpeedAttack;
    SpeedAttack = vocation->getAttackSpeed() - (getSkill(SKILL_FIST, SKILL_LEVEL) * 10);

    if (SpeedAttack < 500) {
        return 500;
    } else {
        return (uint32_t) SpeedAttack;
    }
}

thanks
I felt something like that. It's about the whole function. Slaw very thanks best regards ;p thankx rep



PS: Do I have to set attackspeed in vocation.xml to 1000? Now have 520
 
Last edited:
Back
Top