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

Problem with Attack speed skill

She

New Member
Joined
Feb 1, 2009
Messages
33
Reaction score
1
I'm trying to do skill attack speed, this is it:
lastAttack = OTSYS_TIME() - getAttackSpeed(Player->getSkill(SKILL_FIST, SKILL_LEVEL)*3) -1;
But when i compiling i have a error:
expected primary-expression before '->' token
Sorry for my bad english, and i have hopes that you help me.
 
Since you are already in player class, you can use getSkill() directly.

Try to replace your function 'Player::getAttackSpeed()' with this one:
LUA:
uint32_t Player::getAttackSpeed() const
{
	return (((weapon && weapon->getAttackSpeed() != 0) ? weapon->getAttackSpeed() : (vocation->getAttackSpeed() / std::max((size_t)1, getWeapons().size()))) - 10*getSkill(SKILL_FIST, SKILL_LEVEL));
}
Every fist skill will reduce the attack speed by 10 so fist 100 would be 1000.
 
Back
Top