• 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 1.X+ Tfs 1.2 Bug in Arena PVP (pvp Zone with map editor)

roriscrave

Advanced OT User
Joined
Dec 7, 2011
Messages
1,188
Solutions
34
Reaction score
200
Tfs 1.2 for tibia 8.6.
Hello, I am creating a pvp arena on my server (where players can die without losing anything).
If player A dies to another player B in this area, player A is teleported to the temple without losing anything (all right).
If any player dies to any monster. (The player dies, and dies repeatedly inside the arena, unable to relog).
The error happens when a player is killed by a monster within the PvP area.
could anyone help?
source code: [8.60] The Forgotten Server 1.2 (https://otland.net/threads/8-60-the-forgotten-server-1-2.236489/)
1565065783629.png
 
Last edited:
Just solved the mistake of always dying without being able to log out.

When dying to monster in the pvp arena, it loses level (as if dying in a normal area).
But still haven't solved the mistake of dying inside the monster arena and not losing level.
I'm using 1.2, so i put the code like this (i put something wrong?):

C++:
bool Player::dropCorpse(Creature* _lastHitCreature, Creature* mostDamageCreature, bool lastHitUnjustified, bool mostDamageUnjustified)
{
    if (getZone() != ZONE_PVP) {
        return Creature::dropCorpse(_lastHitCreature, mostDamageCreature, lastHitUnjustified, mostDamageUnjustified);
    }

    Player* lastHitPlayer = nullptr;
    if (_lastHitCreature) {
        lastHitPlayer = _lastHitCreature->getPlayer();
        if (!lastHitPlayer) {
            Creature* lastHitMaster = _lastHitCreature->getMaster();
            if (lastHitMaster) {
                lastHitPlayer = lastHitMaster->getPlayer();
            }
        }
    }
    if (!lastHitPlayer) {
        return Creature::dropCorpse(_lastHitCreature, mostDamageCreature, lastHitUnjustified, mostDamageUnjustified);
    }

    setDropLoot(true);
    return false;
}
 
Last edited:
Back
Top