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

Request AttackSpeed TFS 0.2.14 9.60

EvilSkillz

Back
Joined
Jul 12, 2012
Messages
1,811
Solutions
2
Reaction score
390
Location
Egypt - Cairo
Guys I request attackSpeed feature for 0.2.14 and 0.2.15
when I used attribute attackspeed I got error :(
please help me I need to request it
 
no brother no attribute of attackspeed in item.cpp
and look at my player.cpp in Attack function
Code:
void Player::doAttacking(uint32_t interval)
{
 if(lastAttack == 0)
 lastAttack = OTSYS_TIME() - getAttackSpeed() - 1;
 if(hasCondition(CONDITION_PACIFIED))
 return;
 if((OTSYS_TIME() - lastAttack) >= getAttackSpeed())
 {
 Item* tool = getWeapon();
 const Weapon* weapon = g_weapons->getWeapon(tool);
 bool result = false;
 if(weapon)
 {
 if(!weapon->interruptSwing())
 result = weapon->useWeapon(this, tool, attackedCreature);
 else if(!canDoAction())
 {
 uint32_t delay = getNextActionTime();
 SchedulerTask* task = createSchedulerTask(delay, boost::bind(&Game::checkCreatureAttack,
 &g_game, getID()));
 setNextActionTask(task);
 }
 else if(!hasCondition(CONDITION_EXHAUST_COMBAT) || !weapon->hasExhaustion())
 result = weapon->useWeapon(this, tool, attackedCreature);
 }
 else
 result = Weapon::useFist(this, attackedCreature);
 if(result)
 lastAttack = OTSYS_TIME();
 }
}

and my attribute in items.cpp
Code:
else if(tmpStrValue == "armor")
 {
 if(readXMLInteger(itemAttributesNode, "value", intValue))
 it.armor = intValue;
 }
 else if(tmpStrValue == "defense")
 {
 if(readXMLInteger(itemAttributesNode, "value", intValue))
 it.defense = intValue;
 }
 else if(tmpStrValue == "extradef")
 {
 if(readXMLInteger(itemAttributesNode, "value", intValue))
 it.extraDefense = intValue;
 }
 else if(tmpStrValue == "attack")
 {
 if(readXMLInteger(itemAttributesNode, "value", intValue))
 it.attack = intValue;
 }
 
Back
Top