Jump to content

[C++]Chat Global


Luffy
 Share

Recommended Posts

 

Chat Global (com opção de activação/desactivação no ficheiro CONFIG)

1º game/input_p2p.cpp

 

Procuram por

#include "threeway_war.h"

e colam isto em baixo

extern bool global_chat;

Hidden Content

    Give reaction to this post to see the hidden content.

A seguir procuram por

struct FuncShout

e substituem este função

if (!d->GetCharacter() || (d->GetCharacter()->GetGMLevel() == GM_PLAYER && d->GetEmpire() != m_bEmpire))
            return;

por esta

 

if(global_chat)
		{
			if (!d->GetCharacter())
				return;
		}
		else 
		{
			if (!d->GetCharacter() || (d->GetCharacter()->GetGMLevel() == GM_PLAYER && d->GetEmpire() != m_bEmpire))
				return;
		}

Hidden Content

    Give reaction to this post to see the hidden content.

 

2º game/input_main.cpp

 

Procuram por

ch->SetLastShoutPulse(thecore_heart->pulse);

e adicionem isto

 

if(global_chat)
		{
			char buf[256];
			char chatbuf_global[CHAT_MAX_LEN + 1];
			const BYTE char_empire = ch->GetEmpire();
			if (ch->GetGMLevel() != GM_PLAYER)
			{
				strlcpy(buf, LC_TEXT("Staff"), sizeof(buf));
				std::string staff_color = "|cFFFFC700|H|h[";
				staff_color += buf;
				staff_color += "]|cFFA7FFD4|H|h";
				sprintf(chatbuf_global, "%s %s", staff_color.c_str(), chatbuf);
			}
			else if(char_empire == 1)
			{
				strlcpy(buf, LC_TEXT("Shinsoo"), sizeof(buf));
				std::string kingdom_red = "|cFFff0000|H|h[";
				kingdom_red += buf;
				kingdom_red += "]|cFFA7FFD4|H|h";
				sprintf(chatbuf_global, "%s %s", kingdom_red.c_str(), chatbuf);
			} 
			else if (char_empire == 2) 
			{
				strlcpy(buf, LC_TEXT("Chunjo"), sizeof(buf));
				std::string kingdom_yel = "|cFFFFFF00|H|h[";
				kingdom_yel += buf;
				kingdom_yel += "]|cFFA7FFD4|H|h";
				sprintf(chatbuf_global, "%s %s", kingdom_yel.c_str(), chatbuf);
			} 
			else if (char_empire == 3) 
			{
				strlcpy(buf, LC_TEXT("Jinno"), sizeof(buf));
				std::string kingdom_blue = "|cFF0080FF|H|h[";
				kingdom_blue += buf;
				kingdom_blue += "]|cFFA7FFD4|H|h";
				sprintf(chatbuf_global, "%s %s", kingdom_blue.c_str(), chatbuf);
			}

			TPacketGGShout p;

			p.bHeader = HEADER_GG_SHOUT;
			p.bEmpire = char_empire;
			strlcpy(p.szText, chatbuf_global, sizeof(p.szText));

			P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout));

			SendShout(chatbuf_global, ch->GetEmpire());

			return (iExtraLen);
		}

 

Hidden Content

    Give reaction to this post to see the hidden content.

3º game/config.cpp

 

Procuram por
int gPlayerMaxLevel = 99;

e adicionam isto em baixo

 

bool global_chat = false;

Hidden Content

    Give reaction to this post to see the hidden content.

A seguir procuram por

 

TOKEN("max_level")
		{
			str_to_number(gPlayerMaxLevel, value_string);

			gPlayerMaxLevel = MINMAX(1, gPlayerMaxLevel, PLAYER_MAX_LEVEL_CONST);

			fprintf(stderr, "PLAYER_MAX_LEVEL: %d\n", gPlayerMaxLevel);
		}

e adicionam isto em baixo

 

TOKEN("global_chat")
		{
			int flag = 0;

			str_to_number(flag, value_string);

			if (1 == flag)
			{
				global_chat = true;
				fprintf(stderr, "GLOBAL_CHAT: %i\n", flag);
			}
		}

 

Hidden Content

    Give reaction to this post to see the hidden content.

 

4º game/config.h

 

Procuram por
extern int gPlayerMaxLevel;

e adicionam isto em baixo

 

extern bool global_chat;

Hidden Content

    Give reaction to this post to see the hidden content.

 

5º .../share/locale/???/

Adicionam isto no final do ficheiro locale_string.txt
"Staff";
"Staff/ou o que vocês quiserem";

"Jinno";
"Jinno/ou o que vocês quiserem";

"Chunjo";
"Chunjo/ou o que vocês quiserem";

"Shinsoo";
"Shinsoo/ou o que vocês quiserem";

Hidden Content

    Give reaction to this post to see the hidden content.

Ficheiros CONFIG

 

Adicionam isto nos ficheiros CONFIG
GLOBAL_CHAT: 1/0

1 = Chat Global Activado

0 = Chat Global Desactivado

Fonte: 

Hidden Content

    Give reaction to this post to see the hidden content.

Créditos: Tyler Durden

Tópico: Eu

 

Edited by Luffy
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...