Hmmm...
In TFS you can not set walk interval to and below 1000 milisecons because I believe it is related to onThink function in npc.cpp. It's quite bugged because of this fact as you can only set the NPC speed tobe greater than 1000. It also results in movin slower. If you set walkInterval to let's say 5000, the speed of your character will not only be 5000 miliseconds but also wait 5000 before making next step.
You would have to set your own "if" instruction to execute "addEventWalk" below 1 second in void Npc:
nThink and then in bool Npc::getNextStep to execute every 2 second, so it means in real 1 seconds as onThink executed walkEvent and getNextStep executed walking after 1 seconds. So it looks like 1 second.
I no longer use TFS but I would try something like this:
C++:
change to:
bool Npc::getNextStep(Direction& dir, uint32_t& flags)
{
if (Creature::getNextStep(dir, flags)) {
return true;
}
if (walkTicks == 0) {
return false;
}
if (focusCreature != 0) {
return false;
}
int time_passed = getTimeSinceLastMove();
if (time_passed >= 2000) // + step duration?
{
return getRandomStep(dir);
}
//return getRandomStep(dir);
}
and change to:
C++:
void Npc::onThink(uint32_t interval)
{
Creature::onThink(interval);
if (npcEventHandler) {
npcEventHandler->onThink();
}
int time_passed = getTimeSinceLastMove();
if (!isIdle && time_passed < 1000) // or step duration?
{
addEventWalk();
}
}
Let me know if it works I havent got time now to test it. I am on my phone on holid
omg man now is like tibiantis thanks man i love you!!!!!!!!!!!!!!!!!
/edit its bugged ;[
Could you guys share the working code pls?