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

GlobalEvent Teleport summon to Master [TFS 1.0]

I've hust did this by this:

Code:
void Creature::onCreatureMove(Creature* creature, const Tile* newTile, const Position& newPos, const Tile* oldTile, const Position& oldPos, bool teleport)

I have made the code before this:

Code:
if (newTile->getZone() != oldTile->getZone()) {

And that's the code:

Code:
        if (!summons.empty()) {
            for (Creature* summon : summons) {
                const Position& pos = summon->getPosition();
                if (Position::getDistanceZ(newPos, pos) > 1 || Position::getDistanceX(newPos, pos) > 7 || Position::getDistanceY(newPos, pos) > 5)
                    g_game.internalTeleport(summon, newPos, false)
               
            }
        }
 
Hey Printer, Thanks again for an amazing share.
It works great, and it solves the long problem of tibia of leaving summons behind.
Thank you again
 
Back
Top