Hi I have a problem with taking the attack speed dependent on the skill fist.
Server is Devland 8.0
You need to rewrite a piece player.ccp:
uint32_t Player::getAttackSpeed()
{
return vocation->getAttackSpeed();
}
void Player:nAttacking(uint32_t interval)
{
if(attackTicks < getAttackSpeed()){
attackTicks += interval;
}
Creature:nAttacking(interval);
}
void Player::doAttacking(uint32_t interval)
{
if(getAttackSpeed() <= attackTicks){
bool result = false;
Item* tool = getWeapon();
const Weapon* weapon = g_weapons->getWeapon(tool);
if(weapon && weapon->checkLastAction(this, 100)){
attackTicks = 0;
result = weapon->useWeapon(this, tool, attackedCreature);
}
else{
attackTicks = 0;
result = Weapon::useFist(this, attackedCreature);
}
if(!result){
//make next instant
attackTicks = getAttackSpeed();
}
}
}
If someone knew how to do this in advance thanks.
Vvafel
Server is Devland 8.0
You need to rewrite a piece player.ccp:
uint32_t Player::getAttackSpeed()
{
return vocation->getAttackSpeed();
}
void Player:nAttacking(uint32_t interval)
{
if(attackTicks < getAttackSpeed()){
attackTicks += interval;
}
Creature:nAttacking(interval);
}
void Player::doAttacking(uint32_t interval)
{
if(getAttackSpeed() <= attackTicks){
bool result = false;
Item* tool = getWeapon();
const Weapon* weapon = g_weapons->getWeapon(tool);
if(weapon && weapon->checkLastAction(this, 100)){
attackTicks = 0;
result = weapon->useWeapon(this, tool, attackedCreature);
}
else{
attackTicks = 0;
result = Weapon::useFist(this, attackedCreature);
}
if(!result){
//make next instant
attackTicks = getAttackSpeed();
}
}
}
If someone knew how to do this in advance thanks.
Vvafel