First of all: distro OTserv 0.6.3 rev 6052
Attackspeeds of lower than 1 second won't work, tried to change on vocations.xml and then found this on sources but should work since attackspeed is the one at the xml:
Am I missing something in the code above or it is set somewhere else that you can't attack faster than 1 second?
PS: Also noticed that if you move around the mob you are attacking, you will attack faster.
Thanks in advance.
Attackspeeds of lower than 1 second won't work, tried to change on vocations.xml and then found this on sources but should work since attackspeed is the one at the xml:
Code:
void Player::doAttacking(uint32_t interval)
{
if(lastAttack == 0){
// - 1 to compensate for timer resolution etc.
lastAttack = OTSYS_TIME() - getAttackSpeed() - 1;
}
// Can't attack while pacified
if(hasCondition(CONDITION_PACIFIED))
{
return;
}
if((OTSYS_TIME() - lastAttack) >= getAttackSpeed()){
Item* tool;
tool = getWeapon();
bool result = false;
const Weapon* weapon = g_weapons->getWeapon(tool);
if(weapon){
if(!weapon->interruptSwing()){
result = weapon->useWeapon(this, tool, attackedCreature);
}
else if(!canDoAction()){
uint32_t delay = getNextActionTime();
SchedulerTask* task = createSchedulerTask(0, boost::bind(&Game::checkCreatureAttack,
&g_game, getID()));
setNextActionTask(task);
}
else {
// If the player is not exhausted OR if the player's weapon
// does not have hasExhaust, use the weapon.
if(!hasCondition(CONDITION_EXHAUST_COMBAT))
{
result = weapon->useWeapon(this, tool, attackedCreature);
}
}
}
else{
result = Weapon::useFist(this, attackedCreature);
}
if(result){
lastAttack = OTSYS_TIME();
}
}
}
Am I missing something in the code above or it is set somewhere else that you can't attack faster than 1 second?
PS: Also noticed that if you move around the mob you are attacking, you will attack faster.
Thanks in advance.