• 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+ Outfit GM in Nekiro 1.5

bpm91

Intermediate OT User
Joined
May 23, 2019
Messages
928
Solutions
7
Reaction score
127
Location
Brazil
YouTube
caruniawikibr
recently I'm trying to add the clothes from gm to gm, in nekiro's tfs 1.5 version 7.72 but the source doesn't recognize type 2, I've tried to find other character sex files but I didn't find it, does anyone know how to make it work?
 
Well it's uncomented in protocolgame.cpp

C++:
/*std::vector<ProtocolOutfit> protocolOutfits;
    if (player->isAccessPlayer()) {
        static const std::string gamemasterOutfitName = "Gamemaster";
        protocolOutfits.emplace_back(gamemasterOutfitName, 75, 0);
    }
 
Well it's uncomented in protocolgame.cpp

C++:
/*std::vector<ProtocolOutfit> protocolOutfits;
    if (player->isAccessPlayer()) {
        static const std::string gamemasterOutfitName = "Gamemaster";
        protocolOutfits.emplace_back(gamemasterOutfitName, 75, 0);
    }
is not just that have been trying too, he has to change parts of the code too
Lua:
void ProtocolGame::parseSetOutfit(NetworkMessage& msg)
{
    Outfit_t newOutfit;
    newOutfit.lookType = msg.get<uint16_t>();
    newOutfit.lookHead = msg.getByte();
    newOutfit.lookBody = msg.getByte();
    newOutfit.lookLegs = msg.getByte();
    newOutfit.lookFeet = msg.getByte();
    newOutfit.lookAddons = msg.getByte();
 
    addGameTask(&Game::playerChangeOutfit, player->getID(), newOutfit);
}
this
Code:
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() == std::numeric_limits<uint8_t>::max()) { // Game client currently doesn't allow more than 255 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);
    }*/

    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);
}
to this
Code:
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);
}
have to remove mount in certain parts of the code and look somwhereelse too, don't know well where to look for everything yet
 
why bru you need some money?
no, because he was posting his files expecting somebody else to do it, all admin does the same. The thread became offtopic too,
that is why suggested that. As everybody got mad, whatever. Can not understand this forum rofl
 
Last edited:
I'm using a tfs 7.72 where many things were not according to the version I guarantee that all the things I posted on the forum as doubts, will help many people who don't speak on the forum. however the addons part is something that is not part of the version, but it is a change of my server, because I believe that having outfits with addon increases the number of things to conquer on the server.
 
Client 7.72 (talking about cip) doesn't support using outfits.xml (nor addons) and vectors, instead cip used range based outfits in that protocol (its very old).
To use outfits.xml, gamemaster outfit and others, you need to uncomment a lot of the code and fix your otclient to use new set outfit window, that also means you are giving up on using cip client, cause It wont be compatible anymore
 
I'm using a tfs 7.72 where many things were not according to the version I guarantee that all the things I posted on the forum as doubts, will help many people who don't speak on the forum. however the addons part is something that is not part of the version, but it is a change of my server, because I believe that having outfits with addon increases the number of things to conquer on the server.
change sources to 8.0. is the same just, update your spr to 8.0 since there are no majror changes, the items.otb 7.72 are almost the same, there are not too much items after item id 5090, you don't need to add them anyway, it will load with no problem.
 
Client 7.72 (talking about cip) doesn't support using outfits.xml (nor addons) and vectors, instead cip used range based outfits in that protocol (its very old).
To use outfits.xml, gamemaster outfit and others, you need to uncomment a lot of the code and fix your otclient to use new set outfit window, that also means you are giving up on using cip client, cause It wont be compatible anymore
your downgrade there are several things in here like market, addons, monts, so I wanted to release the addons only
Post automatically merged:

change sources to 8.0. is the same just, update your spr to 8.0 since there are no majror changes, the items.otb 7.72 are almost the same, there are not too much items after item id 5090, you don't need to add them anyway, it will load with no problem.
I already thought about it, but I would have to change all the sprites from 8.0, I don't even think I'll do that I'd rather pay someone to fix it than redo the entire server
 
Back
Top