• 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.5 Downgrade Nekiro / Outfits.xml

Forkz

Well-Known Member
Joined
Jun 29, 2020
Messages
360
Solutions
1
Reaction score
76
Hi otlanders,

Source: GitHub - nekiro/TFS-1.5-Downgrades at 7.72 (https://github.com/nekiro/TFS-1.5-Downgrades/tree/7.72)

I'm using nekiro downgrade in version 7.72, and I would like to activate the outfit.xml to use with OTclient. In version 7.72 there was no outfit.xml it was directly in the source.
Can someone help me?

protocolgame.cpp

C++:
    switch (player->getSex()) {
        case PLAYERSEX_FEMALE: {
            msg.add<uint16_t>(136);
            if (player->isPremium()) {
                msg.add<uint16_t>(142);
            } else {
                msg.add<uint16_t>(139);
            }

            break;
        }

        case PLAYERSEX_MALE: {
            msg.add<uint16_t>(128);
            if (player->isPremium()) {
                msg.add<uint16_t>(134);
            } else {
                msg.add<uint16_t>(131);
            }

            break;
        }

        default: {
            msg.add<uint16_t>(128);
            msg.add<uint16_t>(134);
        }
    }

    writeToOutputBuffer(msg);
}
 
Solution
Change function ProtocolGame::sendOutfitWindow for this.

C++:
void ProtocolGame::sendOutfitWindow()
{
    const auto& outfits = Outfits::getInstance().getOutfits(player->getSex());
    if (outfits.size() == 0) {
        return;
    }

    NetworkMessage msg;
    msg.addByte(0xC8);

    Outfit_t currentOutfit = player->getDefaultOutfit();
    if (currentOutfit.lookType == 0) {
        Outfit_t newOutfit;
        newOutfit.lookType = outfits.front().lookType;
        currentOutfit = newOutfit;
    }

    /*Mount* currentMount = g_game.mounts.getMountByID(player->getCurrentMount());
    if (currentMount) {
        currentOutfit.lookMount = currentMount->clientId;
    }*/

    AddOutfit(msg, currentOutfit);

    std::vector<ProtocolOutfit>...
Change function ProtocolGame::sendOutfitWindow for this.

C++:
void ProtocolGame::sendOutfitWindow()
{
    const auto& outfits = Outfits::getInstance().getOutfits(player->getSex());
    if (outfits.size() == 0) {
        return;
    }

    NetworkMessage msg;
    msg.addByte(0xC8);

    Outfit_t currentOutfit = player->getDefaultOutfit();
    if (currentOutfit.lookType == 0) {
        Outfit_t newOutfit;
        newOutfit.lookType = outfits.front().lookType;
        currentOutfit = newOutfit;
    }

    /*Mount* currentMount = g_game.mounts.getMountByID(player->getCurrentMount());
    if (currentMount) {
        currentOutfit.lookMount = currentMount->clientId;
    }*/

    AddOutfit(msg, currentOutfit);

    std::vector<ProtocolOutfit> protocolOutfits;
    if (player->isAccessPlayer()) {
        static const std::string gamemasterOutfitName = "Gamemaster";
        protocolOutfits.emplace_back(gamemasterOutfitName, 75, 0);
    }

    protocolOutfits.reserve(outfits.size());
    for (const Outfit& outfit : outfits) {
        uint8_t addons;
        if (!player->getOutfitAddons(outfit, addons)) {
            continue;
        }

        protocolOutfits.emplace_back(outfit.name, outfit.lookType, addons);
        if (protocolOutfits.size() == 50) { // Game client currently doesn't allow more than 50 outfits
            break;
        }
    }

    msg.addByte(protocolOutfits.size());
    for (const ProtocolOutfit& outfit : protocolOutfits) {
        msg.add<uint16_t>(outfit.lookType);
        msg.addString(outfit.name);
        msg.addByte(outfit.addons);
    }

    /*
    std::vector<const Mount*> mounts;
    for (const Mount& mount : g_game.mounts.getMounts()) {
        if (player->hasMount(&mount)) {
            mounts.push_back(&mount);
        }
    }

    msg.addByte(mounts.size());
    for (const Mount* mount : mounts) {
        msg.add<uint16_t>(mount->clientId);
        msg.addString(mount->name);
    }*/
    }

    writeToOutputBuffer(msg);
}

If you are using OTCv8 you can enable
Lua:
g_game.enableFeature(GameNewOutfitProtocol)

Also i strongly advise you to checkout the OTAcademy discord server
Join the OTAcademy Discord Server! (https://discord.gg/2QP68Udp)
 
Solution
Hello i have problem after compile.
Change function ProtocolGame::sendOutfitWindow for this.

C++:
void ProtocolGame::sendOutfitWindow()
{
    const auto& outfits = Outfits::getInstance().getOutfits(player->getSex());
    if (outfits.size() == 0) {
        return;
    }

    NetworkMessage msg;
    msg.addByte(0xC8);

    Outfit_t currentOutfit = player->getDefaultOutfit();
    if (currentOutfit.lookType == 0) {
        Outfit_t newOutfit;
        newOutfit.lookType = outfits.front().lookType;
        currentOutfit = newOutfit;
    }

    /*Mount* currentMount = g_game.mounts.getMountByID(player->getCurrentMount());
    if (currentMount) {
        currentOutfit.lookMount = currentMount->clientId;
    }*/

    AddOutfit(msg, currentOutfit);

    std::vector<ProtocolOutfit> protocolOutfits;
    if (player->isAccessPlayer()) {
        static const std::string gamemasterOutfitName = "Gamemaster";
        protocolOutfits.emplace_back(gamemasterOutfitName, 75, 0);
    }

    protocolOutfits.reserve(outfits.size());
    for (const Outfit& outfit : outfits) {
        uint8_t addons;
        if (!player->getOutfitAddons(outfit, addons)) {
            continue;
        }

        protocolOutfits.emplace_back(outfit.name, outfit.lookType, addons);
        if (protocolOutfits.size() == 50) { // Game client currently doesn't allow more than 50 outfits
            break;
        }
    }

    msg.addByte(protocolOutfits.size());
    for (const ProtocolOutfit& outfit : protocolOutfits) {
        msg.add<uint16_t>(outfit.lookType);
        msg.addString(outfit.name);
        msg.addByte(outfit.addons);
    }

    /*
    std::vector<const Mount*> mounts;
    for (const Mount& mount : g_game.mounts.getMounts()) {
        if (player->hasMount(&mount)) {
            mounts.push_back(&mount);
        }
    }

    msg.addByte(mounts.size());
    for (const Mount* mount : mounts) {
        msg.add<uint16_t>(mount->clientId);
        msg.addString(mount->name);
    }*/
    }

    writeToOutputBuffer(msg);
}

If you are using OTCv8 you can enable
Lua:
g_game.enableFeature(GameNewOutfitProtocol)

Also i strongly advise you to checkout the OTAcademy discord server
Join the OTAcademy Discord Server! (https://discord.gg/2QP68Udp)
Hello brother, i have problem after compile.
Lua:
[  2%] Building CXX object CMakeFiles/tfs.dir/src/protocolgame.cpp.o
/home/xxx/src/protocolgame.cpp:2927:24: error: expected constructor, destructor, or type conversion before ‘(’ token
 2927 |     writeToOutputBuffer(msg);
      |                        ^
/home/xxx/src/protocolgame.cpp:2928:1: error: expected declaration before ‘}’ token
 2928 | }
      | ^
make[2]: *** [CMakeFiles/tfs.dir/build.make:909: CMakeFiles/tfs.dir/src/protocolgame.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:102: CMakeFiles/tfs.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Can you help me?

I used your code.
Lua:
void ProtocolGame::sendOutfitWindow()
{
    const auto& outfits = Outfits::getInstance().getOutfits(player->getSex());
    if (outfits.size() == 0) {
        return;
    }

    NetworkMessage msg;
    msg.addByte(0xC8);

    Outfit_t currentOutfit = player->getDefaultOutfit();
    if (currentOutfit.lookType == 0) {
        Outfit_t newOutfit;
        newOutfit.lookType = outfits.front().lookType;
        currentOutfit = newOutfit;
    }

    /*Mount* currentMount = g_game.mounts.getMountByID(player->getCurrentMount());
    if (currentMount) {
        currentOutfit.lookMount = currentMount->clientId;
    }*/

    AddOutfit(msg, currentOutfit);

    std::vector<ProtocolOutfit> protocolOutfits;
    if (player->isAccessPlayer()) {
        static const std::string gamemasterOutfitName = "Gamemaster";
        protocolOutfits.emplace_back(gamemasterOutfitName, 75, 0);
    }

    protocolOutfits.reserve(outfits.size());
    for (const Outfit& outfit : outfits) {
        uint8_t addons;
        if (!player->getOutfitAddons(outfit, addons)) {
            continue;
        }

        protocolOutfits.emplace_back(outfit.name, outfit.lookType, addons);
        if (protocolOutfits.size() == 50) { // Game client currently doesn't allow more than 50 outfits
            break;
        }
    }

    msg.addByte(protocolOutfits.size());
    for (const ProtocolOutfit& outfit : protocolOutfits) {
        msg.add<uint16_t>(outfit.lookType);
        msg.addString(outfit.name);
        msg.addByte(outfit.addons);
    }

    /*
    std::vector<const Mount*> mounts;
    for (const Mount& mount : g_game.mounts.getMounts()) {
        if (player->hasMount(&mount)) {
            mounts.push_back(&mount);
        }
    }

    msg.addByte(mounts.size());
    for (const Mount* mount : mounts) {
        msg.add<uint16_t>(mount->clientId);
        msg.addString(mount->name);
    }*/
    }


    writeToOutputBuffer(msg);
}


2927 - writeToOutputBuffer(msg);
2928 - }

if i make some changes i have clean outfit list :D
 
Hello i have problem after compile.

Hello brother, i have problem after compile.
Lua:
[  2%] Building CXX object CMakeFiles/tfs.dir/src/protocolgame.cpp.o
/home/xxx/src/protocolgame.cpp:2927:24: error: expected constructor, destructor, or type conversion before ‘(’ token
 2927 |     writeToOutputBuffer(msg);
      |                        ^
/home/xxx/src/protocolgame.cpp:2928:1: error: expected declaration before ‘}’ token
 2928 | }
      | ^
make[2]: *** [CMakeFiles/tfs.dir/build.make:909: CMakeFiles/tfs.dir/src/protocolgame.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:102: CMakeFiles/tfs.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Can you help me?

I used your code.
Lua:
void ProtocolGame::sendOutfitWindow()
{
    const auto& outfits = Outfits::getInstance().getOutfits(player->getSex());
    if (outfits.size() == 0) {
        return;
    }

    NetworkMessage msg;
    msg.addByte(0xC8);

    Outfit_t currentOutfit = player->getDefaultOutfit();
    if (currentOutfit.lookType == 0) {
        Outfit_t newOutfit;
        newOutfit.lookType = outfits.front().lookType;
        currentOutfit = newOutfit;
    }

    /*Mount* currentMount = g_game.mounts.getMountByID(player->getCurrentMount());
    if (currentMount) {
        currentOutfit.lookMount = currentMount->clientId;
    }*/

    AddOutfit(msg, currentOutfit);

    std::vector<ProtocolOutfit> protocolOutfits;
    if (player->isAccessPlayer()) {
        static const std::string gamemasterOutfitName = "Gamemaster";
        protocolOutfits.emplace_back(gamemasterOutfitName, 75, 0);
    }

    protocolOutfits.reserve(outfits.size());
    for (const Outfit& outfit : outfits) {
        uint8_t addons;
        if (!player->getOutfitAddons(outfit, addons)) {
            continue;
        }

        protocolOutfits.emplace_back(outfit.name, outfit.lookType, addons);
        if (protocolOutfits.size() == 50) { // Game client currently doesn't allow more than 50 outfits
            break;
        }
    }

    msg.addByte(protocolOutfits.size());
    for (const ProtocolOutfit& outfit : protocolOutfits) {
        msg.add<uint16_t>(outfit.lookType);
        msg.addString(outfit.name);
        msg.addByte(outfit.addons);
    }

    /*
    std::vector<const Mount*> mounts;
    for (const Mount& mount : g_game.mounts.getMounts()) {
        if (player->hasMount(&mount)) {
            mounts.push_back(&mount);
        }
    }

    msg.addByte(mounts.size());
    for (const Mount* mount : mounts) {
        msg.add<uint16_t>(mount->clientId);
        msg.addString(mount->name);
    }*/
    }


    writeToOutputBuffer(msg);
}


2927 - writeToOutputBuffer(msg);
2928 - }

if i make some changes i have clean outfit list :D
C++:
void ProtocolGame::sendOutfitWindow()
{
    const auto& outfits = Outfits::getInstance().getOutfits(player->getSex());
    if (outfits.size() == 0) {
        return;
    }

    NetworkMessage msg;
    msg.addByte(0xC8);

    Outfit_t currentOutfit = player->getDefaultOutfit();
    if (currentOutfit.lookType == 0) {
        Outfit_t newOutfit;
        newOutfit.lookType = outfits.front().lookType;
        currentOutfit = newOutfit;
    }

    /*Mount* currentMount = g_game.mounts.getMountByID(player->getCurrentMount());
    if (currentMount) {
        currentOutfit.lookMount = currentMount->clientId;
    }*/

    AddOutfit(msg, currentOutfit);

    std::vector<ProtocolOutfit> protocolOutfits;
    if (player->isAccessPlayer()) {
        static const std::string gamemasterOutfitName = "Gamemaster";
        protocolOutfits.emplace_back(gamemasterOutfitName, 75, 0);
    }

    protocolOutfits.reserve(outfits.size());
    for (const Outfit& outfit : outfits) {
        uint8_t addons;
        if (!player->getOutfitAddons(outfit, addons)) {
            continue;
        }

        protocolOutfits.emplace_back(outfit.name, outfit.lookType, addons);
        if (protocolOutfits.size() == 50) { // Game client doesn't allow more than 50 outfits
            break;
        }
    }

    msg.addByte(protocolOutfits.size());
    for (const ProtocolOutfit& outfit : protocolOutfits) {
        msg.add<uint16_t>(outfit.lookType);
        msg.addString(outfit.name);
        msg.addByte(outfit.addons);
    }

    /*
    std::vector<const Mount*> mounts;
    for (const Mount& mount : g_game.mounts.getMounts()) {
        if (player->hasMount(&mount)) {
            mounts.push_back(&mount);
        }
    }

    msg.addByte(mounts.size());
    for (const Mount* mount : mounts) {
        msg.add<uint16_t>(mount->clientId);
        msg.addString(mount->name);
    }*/

    writeToOutputBuffer(msg);
}
 
Hello i have problem after compile.

Hello brother, i have problem after compile.
Lua:
[  2%] Building CXX object CMakeFiles/tfs.dir/src/protocolgame.cpp.o
/home/xxx/src/protocolgame.cpp:2927:24: error: expected constructor, destructor, or type conversion before ‘(’ token
 2927 |     writeToOutputBuffer(msg);
      |                        ^
/home/xxx/src/protocolgame.cpp:2928:1: error: expected declaration before ‘}’ token
 2928 | }
      | ^
make[2]: *** [CMakeFiles/tfs.dir/build.make:909: CMakeFiles/tfs.dir/src/protocolgame.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:102: CMakeFiles/tfs.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Can you help me?

I used your code.
Lua:
void ProtocolGame::sendOutfitWindow()
{
    const auto& outfits = Outfits::getInstance().getOutfits(player->getSex());
    if (outfits.size() == 0) {
        return;
    }

    NetworkMessage msg;
    msg.addByte(0xC8);

    Outfit_t currentOutfit = player->getDefaultOutfit();
    if (currentOutfit.lookType == 0) {
        Outfit_t newOutfit;
        newOutfit.lookType = outfits.front().lookType;
        currentOutfit = newOutfit;
    }

    /*Mount* currentMount = g_game.mounts.getMountByID(player->getCurrentMount());
    if (currentMount) {
        currentOutfit.lookMount = currentMount->clientId;
    }*/

    AddOutfit(msg, currentOutfit);

    std::vector<ProtocolOutfit> protocolOutfits;
    if (player->isAccessPlayer()) {
        static const std::string gamemasterOutfitName = "Gamemaster";
        protocolOutfits.emplace_back(gamemasterOutfitName, 75, 0);
    }

    protocolOutfits.reserve(outfits.size());
    for (const Outfit& outfit : outfits) {
        uint8_t addons;
        if (!player->getOutfitAddons(outfit, addons)) {
            continue;
        }

        protocolOutfits.emplace_back(outfit.name, outfit.lookType, addons);
        if (protocolOutfits.size() == 50) { // Game client currently doesn't allow more than 50 outfits
            break;
        }
    }

    msg.addByte(protocolOutfits.size());
    for (const ProtocolOutfit& outfit : protocolOutfits) {
        msg.add<uint16_t>(outfit.lookType);
        msg.addString(outfit.name);
        msg.addByte(outfit.addons);
    }

    /*
    std::vector<const Mount*> mounts;
    for (const Mount& mount : g_game.mounts.getMounts()) {
        if (player->hasMount(&mount)) {
            mounts.push_back(&mount);
        }
    }

    msg.addByte(mounts.size());
    for (const Mount* mount : mounts) {
        msg.add<uint16_t>(mount->clientId);
        msg.addString(mount->name);
    }*/
    }


    writeToOutputBuffer(msg);
}


2927 - writeToOutputBuffer(msg);
2928 - }

if i make some changes i have clean outfit list :D
Wrong copy paste
 
Thank you boys! Working perfect, im blind ninja
Post automatically merged:

#update

1665670853001.png

1665670959190.png

1665670982261.png

i got no errors in console when i compile, what i doing bad?

C++:
void ProtocolGame::sendOutfitWindow()
{
    const auto& outfits = Outfits::getInstance().getOutfits(player->getSex());
    if (outfits.size() == 0) {
        return;
    }

    NetworkMessage msg;
    msg.addByte(0xC8);

    Outfit_t currentOutfit = player->getDefaultOutfit();
    if (currentOutfit.lookType == 0) {
        Outfit_t newOutfit;
        newOutfit.lookType = outfits.front().lookType;
        currentOutfit = newOutfit;
    }

    /*Mount* currentMount = g_game.mounts.getMountByID(player->getCurrentMount());
    if (currentMount) {
        currentOutfit.lookMount = currentMount->clientId;
    }*/

    AddOutfit(msg, currentOutfit);

    std::vector<ProtocolOutfit> protocolOutfits;
    if (player->isAccessPlayer()) {
        static const std::string gamemasterOutfitName = "Gamemaster";
        protocolOutfits.emplace_back(gamemasterOutfitName, 75, 0);
    }

    protocolOutfits.reserve(outfits.size());
    for (const Outfit& outfit : outfits) {
        uint8_t addons;
        if (!player->getOutfitAddons(outfit, addons)) {
            continue;
        }

        protocolOutfits.emplace_back(outfit.name, outfit.lookType, addons);
        if (protocolOutfits.size() == 50) { // Game client doesn't allow more than 50 outfits
            break;
        }
    }

    msg.addByte(protocolOutfits.size());
    for (const ProtocolOutfit& outfit : protocolOutfits) {
        msg.add<uint16_t>(outfit.lookType);
        msg.addString(outfit.name);
        msg.addByte(outfit.addons);
    }

    /*
    std::vector<const Mount*> mounts;
    for (const Mount& mount : g_game.mounts.getMounts()) {
        if (player->hasMount(&mount)) {
            mounts.push_back(&mount);
        }
    }

    msg.addByte(mounts.size());
    for (const Mount* mount : mounts) {
        msg.add<uint16_t>(mount->clientId);
        msg.addString(mount->name);
    }*/

    writeToOutputBuffer(msg);
}

@Mr Guy @Forkz sorry im noob
 
Last edited:
Thank you boys! Working perfect, im blind ninja
Post automatically merged:

#update

View attachment 71143

View attachment 71144

View attachment 71145

i got no errors in console when i compile, what i doing bad?

C++:
void ProtocolGame::sendOutfitWindow()
{
    const auto& outfits = Outfits::getInstance().getOutfits(player->getSex());
    if (outfits.size() == 0) {
        return;
    }

    NetworkMessage msg;
    msg.addByte(0xC8);

    Outfit_t currentOutfit = player->getDefaultOutfit();
    if (currentOutfit.lookType == 0) {
        Outfit_t newOutfit;
        newOutfit.lookType = outfits.front().lookType;
        currentOutfit = newOutfit;
    }

    /*Mount* currentMount = g_game.mounts.getMountByID(player->getCurrentMount());
    if (currentMount) {
        currentOutfit.lookMount = currentMount->clientId;
    }*/

    AddOutfit(msg, currentOutfit);

    std::vector<ProtocolOutfit> protocolOutfits;
    if (player->isAccessPlayer()) {
        static const std::string gamemasterOutfitName = "Gamemaster";
        protocolOutfits.emplace_back(gamemasterOutfitName, 75, 0);
    }

    protocolOutfits.reserve(outfits.size());
    for (const Outfit& outfit : outfits) {
        uint8_t addons;
        if (!player->getOutfitAddons(outfit, addons)) {
            continue;
        }

        protocolOutfits.emplace_back(outfit.name, outfit.lookType, addons);
        if (protocolOutfits.size() == 50) { // Game client doesn't allow more than 50 outfits
            break;
        }
    }

    msg.addByte(protocolOutfits.size());
    for (const ProtocolOutfit& outfit : protocolOutfits) {
        msg.add<uint16_t>(outfit.lookType);
        msg.addString(outfit.name);
        msg.addByte(outfit.addons);
    }

    /*
    std::vector<const Mount*> mounts;
    for (const Mount& mount : g_game.mounts.getMounts()) {
        if (player->hasMount(&mount)) {
            mounts.push_back(&mount);
        }
    }

    msg.addByte(mounts.size());
    for (const Mount* mount : mounts) {
        msg.add<uint16_t>(mount->clientId);
        msg.addString(mount->name);
    }*/

    writeToOutputBuffer(msg);
}

@Mr Guy @Forkz sorry im noob
Add feature OTclient
otclientv8-master\modules\game_features
Lua:
g_game.enableFeature(GameNewOutfitProtocol)
 
Back
Top