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

How to implement this old and forgotten mechanic (or bug)?

RubberDucky

New Member
Joined
Apr 3, 2023
Messages
3
Reaction score
0
Hello everybody. I have been visiting this forum for years as a simple visitor until today that I have decided to encourage myself to make an account.

Anyone knows which source code file and which lines need to be modified to replicate this old and forgotten mechanic (or bug)?

The info about this bug is in this post: Tibiantis - reversed old Tibia project - discussion thread (https://otland.net/threads/tibiantis-reversed-old-tibia-project-discussion-thread.267116/page-13)

The demonstrations of how work this funny mechanic is here:

https://otland.net/proxy.php?image=https%3A%2F%2Fi.imgur.com%2FQx62vEs.gif&hash=d66432dbffa3c3e31c3afb8c4da3a02d
https://otland.net/proxy.php?image=https%3A%2F%2Fi.imgur.com%2FohJ1OAL.gif&hash=b2f1a22f4122593ba646bc0a7f87dc59

I am not here to debate whether this mechanic is good or bad. I would just like to be able to implement it in my project since I personally find it a very interesting mechanic that could give a lot of play to PvP. Of course I'm also aware of some future problems it could cause but that's something I'll deal with later personally.


Thank you and kind regards,
 
I'd start from here Game::playerMoveCreature

To get rid of these checks and replace with simplified logic (just a POC code - there are probably some edge cases):

C++:
Tile* fromTile = map.getTile(movingCreaturePos);
if (Position::getDistanceZ(movingCreaturePos, toPos) > 0 &&
    (fromTile->getHeight() < 3 || toTile->hasFlag(TILESTATE_IMMOVABLEBLOCKSOLID))
    ) {
    player->sendCancelMessage(RETURNVALUE_DESTINATIONOUTOFREACH);
    return;
}

if ((Position::getDistanceX(movingCreaturePos, toPos) > movingCreature->getThrowRange()) ||
    (Position::getDistanceY(movingCreaturePos, toPos) > movingCreature->getThrowRange()) ||
    (Position::getDistanceZ(movingCreaturePos, toPos) > movingCreature->getThrowRange())
    ) {
    player->sendCancelMessage(RETURNVALUE_DESTINATIONOUTOFREACH);
    return;
}
 

Attachments

Thank you very much for the answers and for the information. I'm going to try to see if any effect arises, if so I'll comment here :)
 
Back
Top