In game procotolcpp you got method for outfit window. I put comments for better understanding
C++:
void ProtocolGame::sendOutfitWindow()
{
NetworkMessage_ptr msg = getOutputBuffer();
if (msg){
msg->AddByte(0xC8); //code for client to open outfit window
AddCreatureOutfit(msg, player, player->getDefaultOutfit()); //your current outfit as first showin outfit in window
switch (player->getSex()) {
case PLAYERSEX_FEMALE: //for female players
msg->AddU16(136); //first female outfit
if (player->isPremium())
msg->AddU16(142); //last female outfit if player got premium (+3 premium outfits)
else
msg->AddU16(139); //last female outfit if players is facc
break;
case PLAYERSEX_MALE: //same for males
msg->AddU16(128);
if (player->isPremium())
msg->AddU16(134);
else
msg->AddU16(131);
break;
case 2:
msg->AddU16(160); // GM outfit? idk whats on sex=2
msg->AddU16(160);
break;
default: //male facc outfits as default, but should never gets here
msg->AddU16(128);
msg->AddU16(134);
}
}
}
So for example, male facc players can select one from 128-131 outfits ids (128,129,130,131) and for example PACC player female can select 136-142 ids (136,137,138,139,140,141,142).
Keep in mind that those outfits ranges needs to be continuous in older clients. So you can
not set male outfits 128,129,130,131 and 100. It needs to be close each other, because in the end you send the packet with the range between which client will allow player to choose the outfit.
So if you would like to add for example new male outfit you need:
arrange in tibia.dat outfits
where currently:
Male outfits: 128,129,130,131,132,133,134
Female outs: 136,137,138,139,140,141,142
you got two free spaces after male (135,136), lucky you can add 2 more male outfits there (and on 143,144 corresponding female outfits). But if you would want to add more outfits you would need to move all the female outfits further and register it in sources
for example if you want to add 5 new outfits for every sex:
Male outfits: 128,129,130,131,132,133,134,
135,136,137,138,139
Female outfits: 140,141,142,143,144,145,146,
147,148,149,150,151
In object builder (tibia.dat edit):
Leave normal male outfits 128,129,130,131,132,133,134 and on ids
135,136,137,138,139, you can put your new outfits
then on ids:
140,141,142,143,144,145,146 put female outfits and on
147,148,149,150,151, you can put new female outfits
Then in protocolgame.cpp method:
C++:
void ProtocolGame::sendOutfitWindow()
{
NetworkMessage_ptr msg = getOutputBuffer();
if (msg){
msg->AddByte(0xC8); //code for client to open outfit window
AddCreatureOutfit(msg, player, player->getDefaultOutfit()); //your current outfit as first showin outfit in window
switch (player->getSex()) {
case PLAYERSEX_FEMALE: //for female players
msg->AddU16(140); //first female outfit
if (player->isPremium())
msg->AddU16(151); // New 5 outfits only for pacc
else
msg->AddU16(145); // old outfits for facc
break;
case PLAYERSEX_MALE: //same for males
msg->AddU16(128);
if (player->isPremium())
msg->AddU16(139); // New 5 outfits only for pacc
else
msg->AddU16(134); // old outfits for facc
break;
case 2:
msg->AddU16(160); // GM outfit? idk whats on sex=2
msg->AddU16(160);
break;
default: //male facc outfits as default, but should never gets here
msg->AddU16(128);
msg->AddU16(134);
}
}
}
I think thats the only method for older clients. It sucks that outfits needs to be declared in ranges, but I haven't found any cooler way to select some weird outfit ids to the outfit window. Theres also possiblity to make unique outfit window function for certain outfit called from lua level, but its still not very handy.