Tente assim:
uint32_t Player::getAttackSpeed() const
{
int32_t weaponAttackSpeed = 0;
int32_t minimumAttackSpeed = 500;
return ((weapon && weapon->getAttackSpeed() != 0) ? weapon->getAttackSpeed() : (vocation->getAttackSpeed() - getPlayer()->getExtraAttackSpeed() / std::max((size_t)1, getWeapons().size())));
// FORMULA
int32_t attackSpeed = vocation->getAttackSpeed() - (getSkill(SKILL_CLUB, SKILL_LEVEL) * 20) - weaponAttackSpeed;
// CHECA A VELOCIDADE MÍNIMA
if (attackSpeed && attackSpeed < minimumAttackSpeed)
return minimumAttackSpeed;
return attackSpeed;
}
Só não sei se iria funcionar 100% então tu vai ter que testar...
Na verdade acho que nem vai funcionar kkk






info
Grupo: Campones
Registrado: 11/09/15
Posts: 48
Reputação: +2
Eai galera.
Então, achei um código super útil aqui no fórum, mas ele é pra TFS 0.3.6 e eu fui compilar no TFS 0.4 e deu erro, então gostaria de que alguém me ajudasse a adaptar ele. O código é do henriqueberro e aqui está o tópico dele: link
Mas pra facilitar aqui está o código:
em player.cpp, procure a função:
e substituía ela toda por:
uint32_t Player::getAttackSpeed() { int32_t weaponAttackSpeed = 0; int32_t minimumAttackSpeed = 500; Item* weapon = getWeapon(); if(weapon && weapon->getAttackSpeed() != 0) weaponAttackSpeed = floor ((int)weapon->getAttackSpeed()); // FORMULA int32_t attackSpeed = vocation->getAttackSpeed() - (getSkill(SKILL_CLUB, SKILL_LEVEL) * 20) - weaponAttackSpeed; // CHECA A VELOCIDADE MÍNIMA if (attackSpeed && attackSpeed < minimumAttackSpeed) return minimumAttackSpeed; return attackSpeed; }No tópico diz que se adicionarmos a tag <attribute key="attackspeed" value="X"/> em algum item, o mesmo vai adicionar mais velocidade ao ataque, se eu colocar essa tag e um anel vai funcionar? Igual a tag "increaseMagicPercent"?
Editado Março 23 por Clarym