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

Feature Attack Speed, break default attackSpeed limit, FIX doesn't display hits.

Does anyone know how to convert this code to TFS 1.2? <3
creature.h
look for:
Lua:
static constexpr int32_t EVENT_CREATURE_THINK_INTERVAL
change tha value (default 500, I guess) to whatever you want. I recommend not letting below 200

player.h
look for:
Lua:
uint32_t getAttackSpeed() const
change the return to your formula.
Example:
Lua:
return (vocation->getAttackSpeed() * (1 - getSkillLevel(SKILL_FIST) * 0.00375));
In this type, the attack speed will vary according to the fist skill
 
creature.h
look for:
Lua:
static constexpr int32_t EVENT_CREATURE_THINK_INTERVAL
change tha value (default 500, I guess) to whatever you want. I recommend not letting below 200

player.h
look for:
Lua:
uint32_t getAttackSpeed() const
change the return to your formula.
Example:
Lua:
return (vocation->getAttackSpeed() * (1 - getSkillLevel(SKILL_FIST) * 0.00375));
In this type, the attack speed will vary according to the fist skill

Thanks alot mate! <3
 
Hey, I changed all vocations attackspeed to 2000 in vocation.xml then added this to player.cpp and creature.h and nothing happened :( My characters still hitting one hit per 2 sec although I made them axeskill around 150 (and other skills to rule out mistake in name) . Did I forgot about something? TFS 0.3.6 8.54


 
Last edited:
uint32_t Player::getAttackSpeed()
{
Item* weapon = getWeapon();
// nie 'attackSpeed', bo taka zmienna juz moze istniec w klasie Creature/Player
int32_t attackSpeedzik;
if(weapon && weapon->getAttackSpeed() != 0)
attackSpeedzik = vocation->getAttackSpeed() - (getSkill(SKILL_AXE, SKILL_LEVEL) * 13) - weapon->getAttackSpeed();
else
attackSpeedzik = vocation->getAttackSpeed() - (getSkill(SKILL_AXE, SKILL_LEVEL) * 13);

if(attackSpeedzik > 0)
return (uint32_t) attackSpeedzik;
else
return 1;
}


I have problem when i try to compile engine with this function above...
SS:

1614612694579.png

Someone can help me ? TFS 1.3


return (vocation->getAttackSpeed() * (1 - getSkillLevel(SKILL_FIST) * 0.00375)); <- this solved my problem
 
Last edited:
Back
Top