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

TFS 0.X REV3777 [Fir3Element] Can't walk when use potions/spells only with hotkey.

rexgandi

Member
Joined
Oct 22, 2011
Messages
189
Reaction score
9
Hello,
I use TFS 0.4 REV3777 (actually tested 1.4 downgrade but i have many problems)
When i walk and use potions/ runes with mouse all its okay, but when I use hotkey my player stop and use potions,runes etc.

I change Player.cpp , and exbetweenaction - but not work ...
 
Try changing game.cpp

C++:
bool Game::playerUseItemEx(uint32_t playerId, const Position& fromPos, int16_t fromStackpos, uint16_t fromSpriteId,
    const Position& toPos, int16_t toStackpos, uint16_t toSpriteId, bool isHotkey)

line 2528-2539 change
C++:
std::list<Direction> listDir;
            if(getPathToEx(player, walkToPos, listDir, 0, 1, true, true, 10))
            {
                Dispatcher::getInstance().addTask(createTask(boost::bind(&Game::playerAutoWalk,
                    this, player->getID(), listDir)));

                SchedulerTask* task = createSchedulerTask(400, boost::bind(&Game::playerUseItemEx, this,
                    playerId, itemPos, itemStackpos, fromSpriteId, toPos, toStackpos, toSpriteId, isHotkey));

                player->setNextWalkActionTask(task);
                return true;
            }

to
C++:
std::list<Direction> listDir;
            if(getPathToEx(player, walkToPos, listDir, 0, 1, true, true, 10))
            {
                if (listDir.size() > 1) {
                    Dispatcher::getInstance().addTask(createTask(boost::bind(&Game::playerAutoWalk,
                        this, player->getID(), listDir)));

                    SchedulerTask* task = createSchedulerTask(400, boost::bind(&Game::playerUseItemEx, this,
                        playerId, itemPos, itemStackpos, fromSpriteId, toPos, toStackpos, toSpriteId, isHotkey));

                    player->setNextWalkActionTask(task);
                    return true;
                }
            }

You might need to play with
C++:
if (listDir.size() > 1) {

It might need to be 0 or 2 or w/e just mess with it and see.
Post automatically merged:

Ahh nvm. That is only if the item is too far away.
 
Last edited:
Did you manage to solve the problem? I don't want to use the OT Client.

+1, would love this issue addressed
It's both server and client sided. You can remove the calls to player->stopWalk() when using items, but the CipSoft client itself will also do it's part in making sure that your character stops. The only way to get it fully working on the CipSoft client is to patch the client exe and remove the player->stopWalk() calls in the engine.
 
It's both server and client sided. You can remove the calls to player->stopWalk() when using items, but the CipSoft client itself will also do it's part in making sure that your character stops. The only way to get it fully working on the CipSoft client is to patch the client exe and remove the player->stopWalk() calls in the engine.

Hello, I already tried to remove these "player->stopWalk()" codes from the sources, but without success. I removed all codes, inclusive.

The problem seems to be with Cip's client. I've followed several tutorials, but without success.

I also tried removing all the "setNextActionTask(NULL);" from sources, but no result.

A modification was also made to the following code: "else if((!weapon->hasExhaustion() || !hasCondition(CONDITION_EXHAUST, EXHAUST_COMBAT)) && weapon->useWeapon(this, tool, attackedCreature))"

For: "if(!_weapon->hasExhaustion() && _weapon->useWeapon(this, item, attackedCreature))"

I do not know what else to do.
Post automatically merged:

Try changing game.cpp

C++:
bool Game::playerUseItemEx(uint32_t playerId, const Position& fromPos, int16_t fromStackpos, uint16_t fromSpriteId,
    const Position& toPos, int16_t toStackpos, uint16_t toSpriteId, bool isHotkey)

line 2528-2539 change
C++:
std::list<Direction> listDir;
            if(getPathToEx(player, walkToPos, listDir, 0, 1, true, true, 10))
            {
                Dispatcher::getInstance().addTask(createTask(boost::bind(&Game::playerAutoWalk,
                    this, player->getID(), listDir)));

                SchedulerTask* task = createSchedulerTask(400, boost::bind(&Game::playerUseItemEx, this,
                    playerId, itemPos, itemStackpos, fromSpriteId, toPos, toStackpos, toSpriteId, isHotkey));

                player->setNextWalkActionTask(task);
                return true;
            }

to
C++:
std::list<Direction> listDir;
            if(getPathToEx(player, walkToPos, listDir, 0, 1, true, true, 10))
            {
                if (listDir.size() > 1) {
                    Dispatcher::getInstance().addTask(createTask(boost::bind(&Game::playerAutoWalk,
                        this, player->getID(), listDir)));

                    SchedulerTask* task = createSchedulerTask(400, boost::bind(&Game::playerUseItemEx, this,
                        playerId, itemPos, itemStackpos, fromSpriteId, toPos, toStackpos, toSpriteId, isHotkey));

                    player->setNextWalkActionTask(task);
                    return true;
                }
            }

You might need to play with
C++:
if (listDir.size() > 1) {

It might need to be 0 or 2 or w/e just mess with it and see.
Post automatically merged:

Ahh nvm. That is only if the item is too far away.

No results. The problem seems to be in Cip's client, because with OTClient this problem doesn't occur, however I prefer the old client.
 
Last edited:
Hello, I already tried to remove these "player->stopWalk()" codes from the sources, but without success. I removed all codes, inclusive.

The problem seems to be with Cip's client. I've followed several tutorials, but without success.

I also tried removing all the "setNextActionTask(NULL);" from sources, but no result.

A modification was also made to the following code: "else if((!weapon->hasExhaustion() || !hasCondition(CONDITION_EXHAUST, EXHAUST_COMBAT)) && weapon->useWeapon(this, tool, attackedCreature))"

For: "if(!_weapon->hasExhaustion() && _weapon->useWeapon(this, item, attackedCreature))"

I do not know what else to do.
Post automatically merged:



No results. The problem seems to be in Cip's client, because with OTClient this problem doesn't occur, however I prefer the old client.
If you actually read my reply then you'd know that it's the CipSoft client doing it, I wrote exactly that, and told you what is required in order to make it work as desired.
 
If you actually read my reply then you'd know that it's the CipSoft client doing it, I wrote exactly that, and told you what is required in order to make it work as desired.

I decided to opt for OTC V8.

The reason I wanted to use the old client, was Elf Bot.

I know OTC has bot too, but it doesn't compare to Elf.
 
Back
Top