• 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 0.X [7.72] Adding outfits OTClient

potinho

Intermediate OT User
Joined
Oct 11, 2009
Messages
1,397
Solutions
17
Reaction score
148
Location
Brazil
Hello everyone, everything good?

I have a 7.72 TFS 0.X server and use OTClient as my default client. I am trying to add new outfits but they do not appear in the game and there is no error on the console, could you help me?

OUTFITS.XML
XML:
<?xml version="1.0"?>
<outfits>
    <outfit id="1">
        <list gender="0" lookType="136" name="Citizen"/>
        <list gender="1" lookType="128" name="Citizen"/>
    </outfit>

    <outfit id="2">
        <list gender="0" lookType="137" name="Hunter"/>
        <list gender="1" lookType="129" name="Hunter"/>
    </outfit>

    <outfit id="3">
        <list gender="0" lookType="138" name="Mage"/>
        <list gender="1" lookType="130" name="Mage"/>
    </outfit>

    <outfit id="4">
        <list gender="0" lookType="139" name="Knight"/>
        <list gender="1" lookType="131" name="Knight"/>
    </outfit>

    <outfit id="5">
        <list gender="0" lookType="140" name="Noblewoman"/>
        <list gender="1" lookType="132" name="Nobleman"/>
    </outfit>

    <outfit id="6">
        <list gender="0" lookType="141" name="Summoner"/>
        <list gender="1" lookType="133" name="Summoner"/>
    </outfit>

    <outfit id="7">
        <list gender="0" lookType="142" name="Warrior"/>
        <list gender="1" lookType="134" name="Warrior"/>
    </outfit>
   
        <outfit id="8">
        <list gender="0" lookType="144" name="Elf"/>
        <list gender="1" lookType="144" name="Elf"/>
    </outfit>
   
</outfits>

1618258489019.png
 
did you edit
maleOutfits = {128, 129, 130, 131, 132, 133, 134}
femaleOutfits = {136, 137, 138, 139, 140, 141, 142}

in lib? also in the engine itself need to change that 128 : xxx somewhere
 
Found it

Lua:
maleOutfits = {128, 129, 130, 131, 132, 133, 134, 144}
femaleOutfits = {136, 137, 138, 139, 140, 141, 142, 144}

But not appear in game, no errors in console
C++:
void ProtocolGame::sendOutfitWindow()

{

    NetworkMessage_ptr msg = getOutputBuffer();

    if(!msg)

        return;


    TRACK_MESSAGE(msg);

    msg->put<char>(0xC8);

    AddCreatureOutfit(msg, player, player->getDefaultOutfit(), true);


    #ifdef PROTOCOL_77

    msg->put<uint16_t>(player->sex % 2 ? 128 : 136); // outfit patch future reference

    msg->put<uint16_t>(player->isPremium() ? (player->sex % 2 ? 134 : 142) : (player->sex % 2 ? 131 : 139));


    #else

    msg->put<char>(player->sex % 2 ? 128 : 136);

    msg->put<char>(player->isPremium() ? (player->sex % 2 ? 134 : 142) : (player->sex % 2 ? 131 : 139));

    #endif


    player->hasRequestedOutfit(true);

}

thats what you looking for
protocolgame.cpp
 
C++:
void ProtocolGame::sendOutfitWindow()

{

    NetworkMessage_ptr msg = getOutputBuffer();

    if(!msg)

        return;


    TRACK_MESSAGE(msg);

    msg->put<char>(0xC8);

    AddCreatureOutfit(msg, player, player->getDefaultOutfit(), true);


    #ifdef PROTOCOL_77

    msg->put<uint16_t>(player->sex % 2 ? 128 : 136); // outfit patch future reference

    msg->put<uint16_t>(player->isPremium() ? (player->sex % 2 ? 134 : 142) : (player->sex % 2 ? 131 : 139));


    #else

    msg->put<char>(player->sex % 2 ? 128 : 136);

    msg->put<char>(player->isPremium() ? (player->sex % 2 ? 134 : 142) : (player->sex % 2 ? 131 : 139));

    #endif


    player->hasRequestedOutfit(true);

}

thats what you looking for
protocolgame.cpp
just change

C++:
void ProtocolGame::sendOutfitWindow()
{
    NetworkMessage_ptr msg = getOutputBuffer();
    if(!msg)
        return;

    TRACK_MESSAGE(msg);
    msg->put<char>(0xC8);
    AddCreatureOutfit(msg, player, player->getDefaultOutfit(), true);

    #ifdef _MULTIPLATFORM77
    msg->put<uint16_t>(player->sex % 2 ? 128 : 136);
    msg->put<uint16_t>(player->isPremium() ? (player->sex % 2 ? 134 : 142) : (player->sex % 2 ? 131 : 139));
    #else
    msg->put<char>(player->sex % 2 ? 128 : 136);
    msg->put<char>(player->isPremium() ? (player->sex % 2 ? 134 : 142) : (player->sex % 2 ? 131 : 139));
    #endif

    player->hasRequestedOutfit(true);
}

For what you told and compile?
 
no edit for yourself i recommend you increase 142 to 144 as you want and test and then test from there how you want to go about it ideally in your client you should have :

Male outfits free 1 - 4
male outfits premium 5- howmanyuhavemale
female outfits - howmanyuhavemale+1 - +4 (free outfits)
female outfits premium = +4 (free outfits) - howmanyfemale

so ideally u have to re-do .spr and dat to fit your needs
(its always good to leave some space between those outfits to have space to import later and simply edit the cpp :)
 
@potinho Try changing the outfit limit on protocolgame.cpp searching this line
C++:
if (protocolOutfits.size() == 26) { // Game client doesn't allow more than 26 outfits

This will work if you're using OTClient, it doesn't have an outfit limit. But if you run on a normal Tibia client this probably cause a debug.
You can find more information about it on this thread: OpenTibia - [various] Tibia Extended Client Library (https://otland.net/threads/various-tibia-extended-client-library.258489/page-4#post-2654280)

Regards!
 
no edit for yourself i recommend you increase 142 to 144 as you want and test and then test from there how you want to go about it ideally in your client you should have :

Male outfits free 1 - 4
male outfits premium 5- howmanyuhavemale
female outfits - howmanyuhavemale+1 - +4 (free outfits)
female outfits premium = +4 (free outfits) - howmanyfemale

so ideally u have to re-do .spr and dat to fit your needs
(its always good to leave some space between those outfits to have space to import later and simply edit the cpp :)
Have changed as you said:

C++:
void ProtocolGame::sendOutfitWindow()
{
    NetworkMessage_ptr msg = getOutputBuffer();
    if(!msg)
        return;

    TRACK_MESSAGE(msg);
    msg->put<char>(0xC8);
    AddCreatureOutfit(msg, player, player->getDefaultOutfit(), true);

    #ifdef _MULTIPLATFORM77
    msg->put<uint16_t>(player->sex % 2 ? 128 : 136);
    msg->put<uint16_t>(player->isPremium() ? (player->sex % 2 ? 134 : 144) : (player->sex % 2 ? 131 : 139));
    #else
    msg->put<char>(player->sex % 2 ? 128 : 136);
    msg->put<char>(player->isPremium() ? (player->sex % 2 ? 134 : 144) : (player->sex % 2 ? 131 : 139));
    #endif

    player->hasRequestedOutfit(true);
}

my outfit.xml

XML:
<?xml version="1.0"?>
<outfits>
    <outfit id="1">
        <list gender="0" lookType="136" name="Citizen"/>
        <list gender="1" lookType="128" name="Citizen"/>
    </outfit>

    <outfit id="2">
        <list gender="0" lookType="137" name="Hunter"/>
        <list gender="1" lookType="129" name="Hunter"/>
    </outfit>

    <outfit id="3">
        <list gender="0" lookType="138" name="Mage"/>
        <list gender="1" lookType="130" name="Mage"/>
    </outfit>

    <outfit id="4">
        <list gender="0" lookType="139" name="Knight"/>
        <list gender="1" lookType="131" name="Knight"/>
    </outfit>

    <outfit id="5">
        <list gender="0" lookType="140" name="Noblewoman"/>
        <list gender="1" lookType="132" name="Nobleman"/>
    </outfit>

    <outfit id="6">
        <list gender="0" lookType="141" name="Summoner"/>
        <list gender="1" lookType="133" name="Summoner"/>
    </outfit>

    <outfit id="7">
        <list gender="0" lookType="142" name="Warrior"/>
        <list gender="1" lookType="134" name="Warrior"/>
    </outfit>
   
        <outfit id="8">
        <list gender="0" lookType="144" name="Elf"/>
        <list gender="1" lookType="144" name="Elf"/>
    </outfit>
   
</outfits>
Post automatically merged:

my constant lua
Lua:
maleOutfits = {128, 129, 130, 131, 132, 133, 134, 144}
femaleOutfits = {136, 137, 138, 139, 140, 141, 142, 144}

and my compiled data, from my otclient

1618445527137.png


outfit no appear in game
 
Have changed as you said:

C++:
void ProtocolGame::sendOutfitWindow()
{
    NetworkMessage_ptr msg = getOutputBuffer();
    if(!msg)
        return;

    TRACK_MESSAGE(msg);
    msg->put<char>(0xC8);
    AddCreatureOutfit(msg, player, player->getDefaultOutfit(), true);

    #ifdef _MULTIPLATFORM77
    msg->put<uint16_t>(player->sex % 2 ? 128 : 136);
    msg->put<uint16_t>(player->isPremium() ? (player->sex % 2 ? 134 : 144) : (player->sex % 2 ? 131 : 139));
    #else
    msg->put<char>(player->sex % 2 ? 128 : 136);
    msg->put<char>(player->isPremium() ? (player->sex % 2 ? 134 : 144) : (player->sex % 2 ? 131 : 139));
    #endif

    player->hasRequestedOutfit(true);
}

my outfit.xml

XML:
<?xml version="1.0"?>
<outfits>
    <outfit id="1">
        <list gender="0" lookType="136" name="Citizen"/>
        <list gender="1" lookType="128" name="Citizen"/>
    </outfit>

    <outfit id="2">
        <list gender="0" lookType="137" name="Hunter"/>
        <list gender="1" lookType="129" name="Hunter"/>
    </outfit>

    <outfit id="3">
        <list gender="0" lookType="138" name="Mage"/>
        <list gender="1" lookType="130" name="Mage"/>
    </outfit>

    <outfit id="4">
        <list gender="0" lookType="139" name="Knight"/>
        <list gender="1" lookType="131" name="Knight"/>
    </outfit>

    <outfit id="5">
        <list gender="0" lookType="140" name="Noblewoman"/>
        <list gender="1" lookType="132" name="Nobleman"/>
    </outfit>

    <outfit id="6">
        <list gender="0" lookType="141" name="Summoner"/>
        <list gender="1" lookType="133" name="Summoner"/>
    </outfit>

    <outfit id="7">
        <list gender="0" lookType="142" name="Warrior"/>
        <list gender="1" lookType="134" name="Warrior"/>
    </outfit>
 
        <outfit id="8">
        <list gender="0" lookType="144" name="Elf"/>
        <list gender="1" lookType="144" name="Elf"/>
    </outfit>
 
</outfits>
Post automatically merged:

my constant lua
Lua:
maleOutfits = {128, 129, 130, 131, 132, 133, 134, 144}
femaleOutfits = {136, 137, 138, 139, 140, 141, 142, 144}

and my compiled data, from my otclient

View attachment 57694


outfit no appear in game
Updating, i put outfits in game, but addons not appear, someone can help me?
 
Last edited:
download opikejra.net client and just take my outfits with full addons :d and just offer either full addon or none if u have to also post solution.
thanks for reply. I have outfits in my server, with addons imported in .dat, but i want to create some quests to give addons, but dont know how inject addons in game, dont wanna give full addons for all

1618503199580.png
 
what they want to do is fine but they always have to leave an empty box in male and female outfit and add the outfits in a straight line.


I managed to add a list of outfits for free and another list of outfits for premium, of course, obviously by adding a new list in dat and spr using the objectbuilder of outfits and modifying the source, I can negotiate the work, but well, there I'm giving you an idea of how the job goes. thing
 
Back
Top