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

Compiling Player level on Channel

TibiaGameHost

Hello!
Joined
Feb 25, 2009
Messages
255
Reaction score
0
Location
Canadá
Hi people!
I have source REV 3777, and level of the player not show in Chat Channel.

Example:
17:27 Player says: test

I would like to show the level of the player.
Does anyone have any idea where to modify the source?

Thanks!
 
Yes, my option have been marked.
test.jpg


And no show level of player.
I think this is the modified source.
But I do not know where it is and how to change.
Thank you for help-me!
@EDIT
I can not change the source, because this has cast system, and is well established.
However, only have this problem.
 
protocolgame.cpp (void ProtocolGame::AddCreatureSpeak)
Code:
        if(speaker && type != SPEAK_RVR_ANSWER && !speaker->isAccountManager()
            && !speaker->hasCustomFlag(PlayerCustomFlag_HideLevel))
            msg->put<uint16_t>(speaker->getPlayerInfo(PLAYERINFO_LEVEL));
        else
            msg->put<uint16_t>(0x00);
Make sure the player group doesn't have the flag PlayerCustomFlag_HideLevel.
 
yes, have PlayerCustomFlag_HideLevel

Code:
        if(speaker && type != SPEAK_RVR_ANSWER && !speaker->isAccountManager()
            && !speaker->hasCustomFlag(PlayerCustomFlag_HideLevel) && (pg == NULL && pg != NULL && !pg->getIsCast())) //CA
            msg->put<uint16_t>(speaker->getPlayerInfo(PLAYERINFO_LEVEL));
        else
            msg->put<uint16_t>(0x00);

The only thing that changes from a normal source for this is

Code:
&& (pg == NULL && pg != NULL && !pg->getIsCast())) //CA

Looking a the code up, I thought it has something to do?

Code:
void ProtocolGame::AddCreatureSpeak(NetworkMessage_ptr msg, const Creature* creature, SpeakClasses type,
    std::string text, uint16_t channelId, uint32_t time/*= 0*/, Position* pos/* = NULL*/, ProtocolGame* pg) //CA
{
    msg->put<char>(0xAA);
    if(creature)
    {
        const Player* speaker = creature->getPlayer();
        if(speaker)
        {
            msg->put<uint32_t>(++g_chat.statement);
            g_chat.statementMap[g_chat.statement] = text;
        }
        else
            msg->put<uint32_t>(0x00);

        if(creature->getSpeakType() != SPEAK_CLASS_NONE)
            type = creature->getSpeakType();

        std::string pname;
        if(speaker && pg != NULL && pg->isCast) {//CA
            pname = pg->viewerName;
        }
        else
            pname = creature->getName();

        switch(type)
        {
            case SPEAK_CHANNEL_RA:
                msg->putString("");
                break;
            case SPEAK_RVR_ANSWER:
                msg->putString("Gamemaster");
                break;
            default:
                msg->putString(!creature->getHideName() ? pname: ""); //CA
                break;
        }

Thanks for help-me! :D
 
Back
Top