• 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!

C++ Adding new outfits in Outfitwindow from different ranges in 7.72 client

pasiak12

Well-Known Member
Joined
Jun 7, 2009
Messages
260
Solutions
13
Reaction score
70
Hi!

I am working on OTX based on 1.x version

I would like to add some outfits to the game.

The Outfit window, from protocolgame.cpp
C++:
void ProtocolGame::sendOutfitWindow()
{
    NetworkMessage msg;
    msg.addByte(0xC8);
    AddOutfit(msg, player->getCurrentOutfit());
#ifdef _MULTIPLATFORM77
    msg.add<uint16_t>(219); //first looktype = 219
    msg.add<uint16_t>(221); //all looktype from 219 to 221 avaiable
#else
    //its for another version, not using this
    //msg.addByte(player->getSex() % 2 ? 128 : 136); //from 128 or 136 to 134/131 or 142/139 depends on sex and prem
    //msg.addByte(player->isPremium() ? (player->getSex() % 2 ? 134 : 142) : (player->getSex() % 2 ? 131 : 139));
#endif
    player->hasRequestedOutfit(true);
    writeToOutputBuffer(msg);
}

It allows me to select an one outfit from range 219-221 looktype values.
So I can pick up looktypes:
219
220
221
(For all sexes, no matter if premmy or not)

But I would like to also add some premium outfits (It would be just greater range for premium accounts)
and some outfits obtainable from quests.

And theres the problem.
For example
219-221 are free outsfits

222 is from quest1
223 is from quest2

Let's say player has done only quest2.

Is it possible in 7.72 client to let him choose only:
219-221 and 223? (222 should be disabled since players hasnt done the quest1)
 
Last edited:
Easiest way for this would be installing the outfit.xml support from the newest versions if you're using otc, if not, you can use a lot of ranges based on the OP request
 
I use otclient one time to request players outfits using opcodes then send a table from server to client

{Id, OutfitName}

and then i use outfit module to recieve the outfits table and show them on outfit Windows, that one solution 😁

U must serialize and unserialize the table sent
 
Last edited:
My downgrade for 7.72 has the support for outfits.xml, so you can check it.
why it does not support now?, how can i change it in order to get it working as it were in tfs 1.3 so i will be able to add outfits without modifyng the ranges all the time
Lua:
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);
}
 
Back
Top