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

Move Pokemon tfs 1.3

Huntre

Member
Joined
Mar 22, 2011
Messages
70
Solutions
1
Reaction score
8
Good afternoon.

I thought of making an order for pokemon but I have a bug someone has an idea how to solve.

Problem: how much of the order in 1 sqm does it go straight but how much and farther it teleports.

0b587004b6fcaccfb2a683bebce78f9b.gif

c++
C++:
int LuaScriptInterface::luaGamePlayerMovePokemon(lua_State* L)
{
    // Game.playerMovePokemon(pokemon, toPosition)
    Creature* pokemon = getCreature(L, 1);
    if (pokemon->getMonster()) {
        const Position& position = getPosition(L, 2);

        Tile* toTile = g_game.map.getTile(position);
        g_game.internalMoveCreature(*pokemon, *toTile, FLAG_NOLIMIT);
    }

    return 1;
}

lua

Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)

    local poke = player:getSummons()[1]
    Game.playerMovePokemon(poke, toPosition)
   
    return true
end
 
sorted out by Xtibia PoRaI

C++:
int LuaScriptInterface::luaGamePlayerMovePokemon(lua_State* L)
{
    // Game.playerMovePokemon(pokemon, toPosition)
    Creature* pokemon = getCreature(L, 1);
        const Position& position = getPosition(L, 2);

    if (pokemon->getMonster()) {
                std::forward_list<Direction> dirList;
                if(pokemon->getPathTo(position, dirList, 0, 0, true, true))
                      pokemon->startAutoWalk(dirList);
    }

    return 1;
}
 
Back
Top