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

Lua Attack speed doesn't work

krycha511

New Member
Joined
Dec 24, 2015
Messages
19
Reaction score
0
Hello, I have this server

In creature.h I have this:
Code:
#define EVENT_CREATURECOUNT 1
#define EVENT_CREATURE_THINK_INTERVAL 100
In player.cpp:
Code:
uint32_t Player::getAttackSpeed()
{
    Item* weapon = getWeapon();
    int32_t attackSpeedzik;
    if(weapon && weapon->getAttackSpeed() != 0)
        attackSpeedzik = vocation->getAttackSpeed() - (getSkill(SKILL_FIST, SKILL_LEVEL) * 20) - weapon->getAttackSpeed();
    else
        attackSpeedzik = vocation->getAttackSpeed() - (getSkill(SKILL_FIST, SKILL_LEVEL) * 20);

    if(attackSpeedzik > 0)
        return (uint32_t) attackSpeedzik;
    else
        return 1;
}

And attack speed still doesn't work.
What is wrong? When I add attack speed I see no diffrence.
 
Code:
 uint32_t Player::getAttackSpeed()
{
        uint32_t attackSpeed = vocation->getAttackSpeed();
        uint32_t skilll = getSkill(SKILL_FIST, SKILL_LEVEL);
        Item* weapon = getWeapon();

        if(skilll > 150)
                        skilll = 150;

        if(weapon && weapon->getAttackSpeed() != 0)
                        attackSpeed = weapon->getAttackSpeed();

        return attackSpeed - (skilll * 10);
}

Try this maybe it will work :c
 
It's not attackspeed script fault, but all code player.cpp is wrong. I think that this server has problems with skills. Can someone download this server and try to find problem in player.cpp?
 
Back
Top