mehah / otclient

An alternative tibia client for otserv written in C++20 and Lua, made with a modular system that uses lua scripts for ingame interface and functionality, making otclient flexible and easy to customize
Other
242 stars 177 forks source link

fix: [new-layout] Add Pvp Mode + fix: chase and fight #811

Closed kokekanon closed 1 week ago

kokekanon commented 1 week ago

test in:

theoretically functional, send the correct package.

not yet approved until someone tests it

I don't know how to testify that. I could only compare the 3.5 packet vs main repo packet

bfdgdf

image

image

fix: https://github.com/mehah/otclient/issues/794 https://github.com/opentibiabr/canary/issues/2736

ezgif-3-439606a248

TFS 13.10

void ProtocolGame::parseFightModes(NetworkMessage& msg)
{
    uint8_t rawFightMode = msg.getByte();  // 1 - offensive, 2 - balanced, 3 - defensive
    uint8_t rawChaseMode = msg.getByte();  // 0 - stand while fighting, 1 - chase opponent
    uint8_t rawSecureMode = msg.getByte(); // 0 - can't attack unmarked, 1 - can attack unmarked
    uint8_t rawPvpMode = msg.getByte(); // pvp mode introduced in 10.0

    fightMode_t fightMode;
    if (rawFightMode == 1) {
        fightMode = FIGHTMODE_ATTACK;
    } else if (rawFightMode == 2) {
        fightMode = FIGHTMODE_BALANCED;
    } else {
        fightMode = FIGHTMODE_DEFENSE;
    }

    std::cout << "/////////////////////////////////////// " << std::endl;
    std::cout << "FightMode: " << static_cast<int>(fightMode) << std::endl;
    std::cout << "ChaseMode: " << static_cast<int>(rawChaseMode) << std::endl;
    std::cout << "SecureMode: " << static_cast<int>(rawSecureMode) << std::endl;
    std::cout << "PvpMode: " << static_cast<int>(rawPvpMode) << std::endl;
    std::cout << "/////////////////////////////////////// " << std::endl;
Nottinghster commented 1 week ago

Did you tested with minimized inventory ? Also, when minimized, you can check/select DontChase and ChaseOpponent at the same time, this is wrong... Unfortunately, I can't test right now, because I'm on my job

kokekanon commented 1 week ago

vvv

Nottinghster commented 1 week ago

@luanluciano93 @majestyotbr can you test ?

majestyotbr commented 1 week ago

Tested, it's working with Canary.