• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

OTClient + outfit TFS 1.5 downgrade 8.6

Azerty

Active Member
Joined
Apr 15, 2022
Messages
335
Solutions
4
Reaction score
37
Good morning, on my server I increase the amount of effects in source and in Old Client Cipsoft, however in OTClient I am not able to change outfits. Can someone help me edit the OTClient to accept the amount of outfits from my server?
I already added the following lines in game_things, but I still can't change the outfit:

LUA:
function load()
  local version = g_game.getClientVersion()
  local things = g_settings.getNode('things')

    g_game.enableFeature(GameSpritesU32) -- HERE
    g_game.enableFeature(GameMagicEffectU16) -- HERE

  local datPath, sprPath
 
Solution
Try
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())...
Good morning, on my server I increase the amount of effects in source and in Old Client Cipsoft, however in OTClient I am not able to change outfits. Can someone help me edit the OTClient to accept the amount of outfits from my server?
I already added the following lines in game_things, but I still can't change the outfit:

LUA:
function load()
  local version = g_game.getClientVersion()
  local things = g_settings.getNode('things')

    g_game.enableFeature(GameSpritesU32) -- HERE
    g_game.enableFeature(GameMagicEffectU16) -- HERE

  local datPath, sprPath


Go to protocolgame.cpp and search for/change
Code:
if (protocolOutfits.size() == 35) { // Game client doesn't allow more than 26 outfits
To the number you want, Regards!
 

Go to protocolgame.cpp and search for/change
Code:
if (protocolOutfits.size() == 35) { // Game client doesn't allow more than 26 outfits
To the number you want, Regards!
Is this in the OTC source?? Because my TFS source is already correct, because it works with Old Client, the problem is with the OTC, I don't know how to extend the outfits problem
 
Well that was on TFS. I'm not sure about this but for OTC check in outfit.h where the #defines are and add
C++:
#define OUTFITS_MAX_NUMBER 25
Change the number to the amount of outfits you have
 
Well that was on TFS. I'm not sure about this but for OTC check in outfit.h where the #defines are and add
C++:
#define OUTFITS_MAX_NUMBER 25
Change the number to the amount of outfits you have
What I changed in the TFS source was this:
Code:
    msg.add<uint8_t>(protocolOutfits.size());
    for (const ProtocolOutfit& outfit : protocolOutfits) {
        msg.add<uint8_t>(outfit.lookType);
        msg.addString(outfit.name);
        msg.addByte(outfit.addons);
    }
To:
LUA:
    msg.add<uint16_t>(protocolOutfits.size());
    for (const ProtocolOutfit& outfit : protocolOutfits) {
        msg.add<uint16_t>(outfit.lookType);
        msg.addString(outfit.name);
        msg.addByte(outfit.addons);
    }
 
What I changed in the TFS source was this:
Code:
    msg.add<uint8_t>(protocolOutfits.size());
    for (const ProtocolOutfit& outfit : protocolOutfits) {
        msg.add<uint8_t>(outfit.lookType);
        msg.addString(outfit.name);
        msg.addByte(outfit.addons);
    }
To:
LUA:
    msg.add<uint16_t>(protocolOutfits.size());
    for (const ProtocolOutfit& outfit : protocolOutfits) {
        msg.add<uint16_t>(outfit.lookType);
        msg.addString(outfit.name);
        msg.addByte(outfit.addons);
    }
Try
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);
    }

    writeToOutputBuffer(msg);
}
 
Try
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);
    }

    writeToOutputBuffer(msg);
}

Now the problem is with the Extended Old Client. I needed to extend the OTClient Outfit uint16...
Post automatically merged:

Try
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);
    }

    writeToOutputBuffer(msg);
}
And if you do something like that...would it work?

LUA:
if (operatingSystem >= CLIENTOS_OTCLIENT_LINUX) {
msg.addByte(protocolOutfits.size());
    for (const ProtocolOutfit& outfit : protocolOutfits) {
        msg.add<uint16_t>(outfit.lookType);
        msg.addString(outfit.name);
        msg.addByte(outfit.addons);
    }
}
    writeToOutputBuffer(msg);
}
But I don't know how to do it properly. Of course, this way I did it, there is an error when compiling
Post automatically merged:

I fixed! Old client with uint16 and OTClient addByte =D

LUA:
    if (version <= CLIENT_VERSION_MIN) {
    msg.addByte(protocolOutfits.size());
    for (const ProtocolOutfit& outfit : protocolOutfits) {
        msg.add<uint16_t>(outfit.lookType);
        msg.addString(outfit.name);
        msg.addByte(outfit.addons);
    }
}
    else if (version >= CLIENT_VERSION_MAX) {
    msg.add<uint16_t>(protocolOutfits.size());
    for (const ProtocolOutfit& outfit : protocolOutfits) {
        msg.add<uint16_t>(outfit.lookType);
        msg.addString(outfit.name);
        msg.addByte(outfit.addons);
    }
    }

    writeToOutputBuffer(msg);
}
 
Last edited:
Solution
Back
Top