otclient icon indicating copy to clipboard operation
otclient copied to clipboard

Attack cancel (fast attacking monster after kill)

Open Ghorre opened this issue 14 years ago • 2 comments

When attacking next creature while the previous one is dying (death delay) you might be able to make one hit and then the "red square" disappears - attack gets cancelled.

Steps to reproduce (kinda hard to catch - might take a few attempts):

  1. Attack monster no1.
  2. While monster no1 is dying (no HP but still standing) attack monster no2.
  3. When the monster no1 drops on the ground your attack on monster no2 gets cancelled.

Ghorre avatar Aug 21 '12 15:08 Ghorre

That's a well know server side only bug, all otservs ignore the attack sequential number in parseAttack,

Taken from TFS source code:

void ProtocolGame::parseAttack(NetworkMessage& msg)
{
    uint32_t creatureId = msg.get<uint32_t>();
    msg.get<uint32_t>(); //?
    msg.get<uint32_t>(); //?

    addGameTask(&Game::playerSetAttackedCreature, player->getID(), creatureId);
}

The first "??" byte represents the attack seq, used to cancel attacks.

void ProtocolGame::sendCancelTarget()
{
    NetworkMessage_ptr msg = getOutputBuffer();
    if(!msg)
        return;

    TRACK_MESSAGE(msg);
    msg->put<char>(0xA3);
    msg->put<uint32_t>(0); //? creatureId?
}

The "unknown" byte must be the same value received in parseAttack, but TFS doesn't implement that. That bug doesn't exist while playing real tibia with otclient.

edubart avatar Aug 21 '12 15:08 edubart

I see. I'll double check next time - sorry I bothered You.

Ghorre avatar Aug 21 '12 16:08 Ghorre