eTony 104 Posted September 5, 2014 Share Posted September 5, 2014 (edited) M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Hello, global chat + color empire with chat is by Denis. thx. 1) Enable global chat Open input_p2p.cpp Search : Quote if (!d->GetCharacter() || (d->GetCharacter()->GetGMLevel() == GM_PLAYER && d->GetEmpire() != m_bEmpire)) Replace with it: Quote if (!d->GetCharacter()) If you use novaline, search: Quote // ADDED GLOBAL SHOUT OPTION if (!d->GetCharacter()) return; if(!g_bGlobalShoutEnable && (d->GetCharacter()->GetGMLevel() == GM_PLAYER && d->GetEmpire() != m_bEmpire)) return; And replace with it: Quote if (!d->GetCharacter()) return; 2) Add chat functions Open input_main.cpp Search: Quote if (pinfo->type == CHAT_TYPE_SHOUT) { const int SHOUT_LIMIT_LEVEL = 15; if (ch->GetLevel() < SHOUT_LIMIT_LEVEL) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("외치기는 레벨 %d 이상만 사용 가능 합니다."), SHOUT_LIMIT_LEVEL); return (iExtraLen); } if (thecore_heart->pulse - (int) ch->GetLastShoutPulse() < passes_per_sec * 15) return (iExtraLen); ch->SetLastShoutPulse(thecore_heart->pulse); TPacketGGShout p; p.bHeader = HEADER_GG_SHOUT; p.bEmpire = ch->GetEmpire(); strlcpy(p.szText, chatbuf, sizeof(p.szText)); P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout)); SendShout(chatbuf, ch->GetEmpire()); return (iExtraLen); } Replace with it: Quote if (pinfo->type == CHAT_TYPE_SHOUT) { const int SHOUT_LIMIT_LEVEL = 15; if (ch->GetLevel() < SHOUT_LIMIT_LEVEL) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("외치기는 레벨 %d 이상만 사용 가능 합니다."), SHOUT_LIMIT_LEVEL); return (iExtraLen); } if (thecore_heart->pulse - (int) ch->GetLastShoutPulse() < passes_per_sec * 15) return (iExtraLen); ch->SetLastShoutPulse(thecore_heart->pulse); const char* kingdoms[4] = {"|cFF47DA00|H|h[GameMaster]|cFFA7FFD4|H|h","|cFFff0000|H|h[shinsoo]|cFFA7FFD4|H|h","|cFFFFFF00|H|h[Chunjo]|cFFA7FFD4|H|h","|cFF0080FF|H|h[Jinno]|cFFA7FFD4|H|h"}; char chatbuf_global[CHAT_MAX_LEN + 1]; int my_level = ch->GetLevel(); if (gSpecialShout == 1) { if (ch->GetGMLevel() != GM_PLAYER) { if (MasterGhostChat == 1) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",kingdoms[0], buf); } else { if ((MasterColorEmpire == 1) and (MasterLevelChat == 0)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s : %s",ch->GetName(), kingdoms[ch->GetEmpire()], buf); } else if ((MasterColorEmpire == 1) and (MasterLevelChat == 1)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s [%d] : %s",ch->GetName(), kingdoms[ch->GetEmpire()], my_level, buf); } else if ((MasterColorEmpire == 0) and (MasterLevelChat == 1)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s [%d] : %s",ch->GetName(), my_level, buf); } else { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",ch->GetName(), buf); } } } else { if ((PlayerColorEmpire == 1) and (PlayerLevelChat == 0)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s : %s",ch->GetName(), kingdoms[ch->GetEmpire()], buf); } else if ((PlayerColorEmpire == 1) and (PlayerLevelChat == 1)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s [%d] : %s",ch->GetName(), kingdoms[ch->GetEmpire()], my_level, buf); } else if ((PlayerColorEmpire == 0) and (PlayerLevelChat == 1)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s [%d] : %s",ch->GetName(), my_level, buf); } else { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",ch->GetName(), buf); } } } else { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",ch->GetName(), buf); } TPacketGGShout p; p.bHeader = HEADER_GG_SHOUT; p.bEmpire = ch->GetEmpire(); strlcpy(p.szText, chatbuf_global, sizeof(p.szText)); P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout)); SendShout(chatbuf_global, ch->GetEmpire()); return (iExtraLen); } 3) Add config function Open config.cpp Search: Quote int gShutdownEnable = 0; Add after: Quote int gSpecialShout = 0; int MasterGhostChat = 0; int MasterColorEmpire = 0; int MasterLevelChat = 0; int PlayerColorEmpire = 0; int PlayerLevelChat = 0; Next search: Quote TOKEN("empire_whisper") { bool b_value = 0; str_to_number(b_value, value_string); g_bEmpireWhisper = !!b_value; continue; } Add after: Quote TOKEN("special_shout") { str_to_number(gSpecialShout, value_string); continue; } TOKEN("gm_ghost_shout") { str_to_number(MasterGhostChat, value_string); continue; } TOKEN("gm_empire_shout") { str_to_number(MasterColorEmpire, value_string); continue; } TOKEN("gm_level_shout") { str_to_number(MasterLevelChat, value_string); continue; } TOKEN("player_empire_shout") { str_to_number(PlayerColorEmpire, value_string); continue; } TOKEN("player_level_shout") { str_to_number(PlayerLevelChat, value_string); continue; } Now open config.h Search: Quote extern int gPlayerMaxLevel; And add before: Quote extern int gSpecialShout; extern int MasterGhostChat; extern int MasterColorEmpire; extern int MasterLevelChat; extern int PlayerColorEmpire; extern int PlayerLevelChat; 4) Game CONFIG Open your CONFIG game and add: Quote special_shout: 1 gm_ghost_shout: 1 gm_empire_shout: 1 gm_level_shout: 1 player_empire_shout: 1 player_level_shout: 1 = Quote special_shout - (0/1 Enable special chat functions) - default 0 gm_ghost_shout - (0/1 Enable GM Ghost chat [GM chat is only [GameMaster] : text]) - default 0 gm_empire_shout - (0/1 Enable GM empire with chat - only if gm_ghost_shout = 0) - default 0 gm_level_shout - (0/1 Enable GM level with chat - only if gm_ghost_shout = 0) - default 0 player_empire_shout - (0/1 Enable empire with player chat) - default 0 player_level_shout - (0/1 Enable level with player chat) - default 0 That's all, sorry for my bad english Thx : Denis, Domco Edited August 26, 2022 by Metin2 Dev Core X - External 2 Internal 45 3 2 1 1 2 1 10 3 44 Link to comment Share on other sites More sharing options...
Premium Galet 509 Posted September 5, 2014 Premium Share Posted September 5, 2014 Such nice questfunctions Edit : Wtf am I sayin' ? Such nice chat funcitons. Link to comment Share on other sites More sharing options...
Premium TAUMP 831 Posted September 5, 2014 Premium Share Posted September 5, 2014 Nice eTony Link to comment Share on other sites More sharing options...
eddR 9 Posted September 16, 2014 Share Posted September 16, 2014 I don't have int gShutdownEnable = 0; in my config.cpp im using mainline , is this for novaline only ? 1 Link to comment Share on other sites More sharing options...
Night 366 Posted September 16, 2014 Share Posted September 16, 2014 I don't have int gShutdownEnable = 0; in my config.cpp im using mainline , is this for novaline only ? o.O this killed some devs you know x.x there isnt a brunch only function (maybe some function were not defined or some variable but not a function that use only basic ymir function) good luck for eTony nice work and could you use the code function Link to comment Share on other sites More sharing options...
eddR 9 Posted September 16, 2014 Share Posted September 16, 2014 I don't have int gShutdownEnable = 0; in my config.cpp im using mainline , is this for novaline only ? o.O this killed some devs you know x.x there isnt a brunch only function (maybe some function were not defined or some variable but not a function that use only basic ymir function) good luck for eTony nice work and could you use the code function I meant that this release its for novaline only , its obvious you can do it on mainline. Link to comment Share on other sites More sharing options...
Night 366 Posted September 16, 2014 Share Posted September 16, 2014 I don't have int gShutdownEnable = 0; in my config.cpp im using mainline , is this for novaline only ? o.O this killed some devs you know x.x there isnt a brunch only function (maybe some function were not defined or some variable but not a function that use only basic ymir function) good luck for eTony nice work and could you use the code function I meant that this release its for novaline only , its obvious you can do it on mainline. nvm then my head is afk but ... nvm Link to comment Share on other sites More sharing options...
eddR 9 Posted September 17, 2014 Share Posted September 17, 2014 (edited) #solved working fine thanks for this realease bro ! Edited August 18, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
RatCatcher 77 Posted September 26, 2014 Share Posted September 26, 2014 For novaline only? O rly? You can use it where you want if you are not a dumbass. 1 Enough is enough Link to comment Share on other sites More sharing options...
alex911 2 Posted November 22, 2014 Share Posted November 22, 2014 he works on the mainline_released too,i tested and it's work Link to comment Share on other sites More sharing options...
alex911 2 Posted November 23, 2014 Share Posted November 23, 2014 (edited) he works on the mainline_released too,i tested and it's work Edited August 18, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Damixxx0101 6 Posted December 14, 2014 Share Posted December 14, 2014 not work for me in mainline error input main file : ( Link to comment Share on other sites More sharing options...
Damixxx0101 6 Posted January 8, 2015 Share Posted January 8, 2015 Thanks Bro for this : ) Link to comment Share on other sites More sharing options...
guy12 1 Posted January 11, 2015 Share Posted January 11, 2015 Any1 know what i must to do hyperlink to massage on nickname chat click? Link to comment Share on other sites More sharing options...
chollinex 0 Posted February 13, 2015 Share Posted February 13, 2015 Any1 know what i must to do hyperlink to massage on nickname chat click? .py in client Link to comment Share on other sites More sharing options...
ThePooter 4 Posted March 13, 2015 Share Posted March 13, 2015 (edited) Hello, global chat + color empire with chat is by Denis. thx. 1) Enable global chat Open input_p2p.cpp Search : if (!d->GetCharacter() || (d->GetCharacter()->GetGMLevel() == GM_PLAYER && d->GetEmpire() != m_bEmpire)) Replace with it: if (!d->GetCharacter()) If you use novaline, search: // ADDED GLOBAL SHOUT OPTION if (!d->GetCharacter()) return; if(!g_bGlobalShoutEnable && (d->GetCharacter()->GetGMLevel() == GM_PLAYER && d->GetEmpire() != m_bEmpire)) return; And replace with it: if (!d->GetCharacter()) return; 2) Add chat functions Open input_main.cpp Search: if (pinfo->type == CHAT_TYPE_SHOUT) { const int SHOUT_LIMIT_LEVEL = 15; if (ch->GetLevel() < SHOUT_LIMIT_LEVEL) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("외치기는 레벨 %d 이상만 사용 가능 합니다."), SHOUT_LIMIT_LEVEL); return (iExtraLen); } if (thecore_heart->pulse - (int) ch->GetLastShoutPulse() < passes_per_sec * 15) return (iExtraLen); ch->SetLastShoutPulse(thecore_heart->pulse); TPacketGGShout p; p.bHeader = HEADER_GG_SHOUT; p.bEmpire = ch->GetEmpire(); strlcpy(p.szText, chatbuf, sizeof(p.szText)); P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout)); SendShout(chatbuf, ch->GetEmpire()); return (iExtraLen); } Replace with it: if (pinfo->type == CHAT_TYPE_SHOUT) { const int SHOUT_LIMIT_LEVEL = 15; if (ch->GetLevel() < SHOUT_LIMIT_LEVEL) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("외치기는 레벨 %d 이상만 사용 가능 합니다."), SHOUT_LIMIT_LEVEL); return (iExtraLen); } if (thecore_heart->pulse - (int) ch->GetLastShoutPulse() < passes_per_sec * 15) return (iExtraLen); ch->SetLastShoutPulse(thecore_heart->pulse); const char* kingdoms[4] = {"|cFF47DA00|H|h[GameMaster]|cFFA7FFD4|H|h","|cFFff0000|H|h[shinsoo]|cFFA7FFD4|H|h","|cFFFFFF00|H|h[Chunjo]|cFFA7FFD4|H|h","|cFF0080FF|H|h[Jinno]|cFFA7FFD4|H|h"}; char chatbuf_global[CHAT_MAX_LEN + 1]; int my_level = ch->GetLevel(); if (gSpecialShout == 1) { if (ch->GetGMLevel() != GM_PLAYER) { if (MasterGhostChat == 1) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",kingdoms[0], buf); } else { if ((MasterColorEmpire == 1) and (MasterLevelChat == 0)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s : %s",ch->GetName(), kingdoms[ch->GetEmpire()], buf); } else if ((MasterColorEmpire == 1) and (MasterLevelChat == 1)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s [%d] : %s",ch->GetName(), kingdoms[ch->GetEmpire()], my_level, buf); } else if ((MasterColorEmpire == 0) and (MasterLevelChat == 1)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s [%d] : %s",ch->GetName(), my_level, buf); } else { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",ch->GetName(), buf); } } } else { if ((PlayerColorEmpire == 1) and (PlayerLevelChat == 0)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s : %s",ch->GetName(), kingdoms[ch->GetEmpire()], buf); } else if ((PlayerColorEmpire == 1) and (PlayerLevelChat == 1)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s [%d] : %s",ch->GetName(), kingdoms[ch->GetEmpire()], my_level, buf); } else if ((PlayerColorEmpire == 0) and (PlayerLevelChat == 1)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s [%d] : %s",ch->GetName(), my_level, buf); } else { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",ch->GetName(), buf); } } } else { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",ch->GetName(), buf); } TPacketGGShout p; p.bHeader = HEADER_GG_SHOUT; p.bEmpire = ch->GetEmpire(); strlcpy(p.szText, chatbuf_global, sizeof(p.szText)); P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout)); SendShout(chatbuf_global, ch->GetEmpire()); return (iExtraLen); } 3) Add config function Open config.cpp Search: int gShutdownEnable = 0; Add after: int gSpecialShout = 0; int MasterGhostChat = 0; int MasterColorEmpire = 0; int MasterLevelChat = 0; int PlayerColorEmpire = 0; int PlayerLevelChat = 0; Next search: TOKEN("empire_whisper") { bool b_value = 0; str_to_number(b_value, value_string); g_bEmpireWhisper = !!b_value; continue; } Add after: TOKEN("special_shout") { str_to_number(gSpecialShout, value_string); continue; } TOKEN("gm_ghost_shout") { str_to_number(MasterGhostChat, value_string); continue; } TOKEN("gm_empire_shout") { str_to_number(MasterColorEmpire, value_string); continue; } TOKEN("gm_level_shout") { str_to_number(MasterLevelChat, value_string); continue; } TOKEN("player_empire_shout") { str_to_number(PlayerColorEmpire, value_string); continue; } TOKEN("player_level_shout") { str_to_number(PlayerLevelChat, value_string); continue; } Now open config.h Search: extern int gPlayerMaxLevel; And add before: extern int gSpecialShout; extern int MasterGhostChat; extern int MasterColorEmpire; extern int MasterLevelChat; extern int PlayerColorEmpire; extern int PlayerLevelChat; 4) Game CONFIG Open your CONFIG game and add: special_shout: 1 gm_ghost_shout: 1 gm_empire_shout: 1 gm_level_shout: 1 player_empire_shout: 1 player_level_shout: 1 = special_shout - (0/1 Enable special chat functions) - default 0 gm_ghost_shout - (0/1 Enable GM Ghost chat [GM chat is only [GameMaster] : text]) - default 0 gm_empire_shout - (0/1 Enable GM empire with chat - only if gm_ghost_shout = 0) - default 0 gm_level_shout - (0/1 Enable GM level with chat - only if gm_ghost_shout = 0) - default 0 player_empire_shout - (0/1 Enable empire with player chat) - default 0 player_level_shout - (0/1 Enable level with player chat) - default 0 That's all, sorry for my bad english :-) Thx : Denis, Domco thank you Edited August 26, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
Starky 2 Posted March 19, 2015 Share Posted March 19, 2015 (edited) Hello, global chat + color empire with chat is by Denis. thx. 1) Enable global chat Open input_p2p.cpp Search : if (!d->GetCharacter() || (d->GetCharacter()->GetGMLevel() == GM_PLAYER && d->GetEmpire() != m_bEmpire)) Replace with it: if (!d->GetCharacter()) If you use novaline, search: // ADDED GLOBAL SHOUT OPTION if (!d->GetCharacter()) return; if(!g_bGlobalShoutEnable && (d->GetCharacter()->GetGMLevel() == GM_PLAYER && d->GetEmpire() != m_bEmpire)) return; And replace with it: if (!d->GetCharacter()) return; 2) Add chat functions Open input_main.cpp Search: if (pinfo->type == CHAT_TYPE_SHOUT) { const int SHOUT_LIMIT_LEVEL = 15; if (ch->GetLevel() < SHOUT_LIMIT_LEVEL) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("외치기는 레벨 %d 이상만 사용 가능 합니다."), SHOUT_LIMIT_LEVEL); return (iExtraLen); } if (thecore_heart->pulse - (int) ch->GetLastShoutPulse() < passes_per_sec * 15) return (iExtraLen); ch->SetLastShoutPulse(thecore_heart->pulse); TPacketGGShout p; p.bHeader = HEADER_GG_SHOUT; p.bEmpire = ch->GetEmpire(); strlcpy(p.szText, chatbuf, sizeof(p.szText)); P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout)); SendShout(chatbuf, ch->GetEmpire()); return (iExtraLen); } Replace with it: if (pinfo->type == CHAT_TYPE_SHOUT) { const int SHOUT_LIMIT_LEVEL = 15; if (ch->GetLevel() < SHOUT_LIMIT_LEVEL) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("외치기는 레벨 %d 이상만 사용 가능 합니다."), SHOUT_LIMIT_LEVEL); return (iExtraLen); } if (thecore_heart->pulse - (int) ch->GetLastShoutPulse() < passes_per_sec * 15) return (iExtraLen); ch->SetLastShoutPulse(thecore_heart->pulse); const char* kingdoms[4] = {"|cFF47DA00|H|h[GameMaster]|cFFA7FFD4|H|h","|cFFff0000|H|h[shinsoo]|cFFA7FFD4|H|h","|cFFFFFF00|H|h[Chunjo]|cFFA7FFD4|H|h","|cFF0080FF|H|h[Jinno]|cFFA7FFD4|H|h"}; char chatbuf_global[CHAT_MAX_LEN + 1]; int my_level = ch->GetLevel(); if (gSpecialShout == 1) { if (ch->GetGMLevel() != GM_PLAYER) { if (MasterGhostChat == 1) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",kingdoms[0], buf); } else { if ((MasterColorEmpire == 1) and (MasterLevelChat == 0)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s : %s",ch->GetName(), kingdoms[ch->GetEmpire()], buf); } else if ((MasterColorEmpire == 1) and (MasterLevelChat == 1)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s [%d] : %s",ch->GetName(), kingdoms[ch->GetEmpire()], my_level, buf); } else if ((MasterColorEmpire == 0) and (MasterLevelChat == 1)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s [%d] : %s",ch->GetName(), my_level, buf); } else { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",ch->GetName(), buf); } } } else { if ((PlayerColorEmpire == 1) and (PlayerLevelChat == 0)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s : %s",ch->GetName(), kingdoms[ch->GetEmpire()], buf); } else if ((PlayerColorEmpire == 1) and (PlayerLevelChat == 1)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s [%d] : %s",ch->GetName(), kingdoms[ch->GetEmpire()], my_level, buf); } else if ((PlayerColorEmpire == 0) and (PlayerLevelChat == 1)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s [%d] : %s",ch->GetName(), my_level, buf); } else { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",ch->GetName(), buf); } } } else { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",ch->GetName(), buf); } TPacketGGShout p; p.bHeader = HEADER_GG_SHOUT; p.bEmpire = ch->GetEmpire(); strlcpy(p.szText, chatbuf_global, sizeof(p.szText)); P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout)); SendShout(chatbuf_global, ch->GetEmpire()); return (iExtraLen); } 3) Add config function Open config.cpp Search: int gShutdownEnable = 0; Add after: int gSpecialShout = 0; int MasterGhostChat = 0; int MasterColorEmpire = 0; int MasterLevelChat = 0; int PlayerColorEmpire = 0; int PlayerLevelChat = 0; Next search: TOKEN("empire_whisper") { bool b_value = 0; str_to_number(b_value, value_string); g_bEmpireWhisper = !!b_value; continue; } Add after: TOKEN("special_shout") { str_to_number(gSpecialShout, value_string); continue; } TOKEN("gm_ghost_shout") { str_to_number(MasterGhostChat, value_string); continue; } TOKEN("gm_empire_shout") { str_to_number(MasterColorEmpire, value_string); continue; } TOKEN("gm_level_shout") { str_to_number(MasterLevelChat, value_string); continue; } TOKEN("player_empire_shout") { str_to_number(PlayerColorEmpire, value_string); continue; } TOKEN("player_level_shout") { str_to_number(PlayerLevelChat, value_string); continue; } Now open config.h Search: extern int gPlayerMaxLevel; And add before: extern int gSpecialShout; extern int MasterGhostChat; extern int MasterColorEmpire; extern int MasterLevelChat; extern int PlayerColorEmpire; extern int PlayerLevelChat; 4) Game CONFIG Open your CONFIG game and add: special_shout: 1 gm_ghost_shout: 1 gm_empire_shout: 1 gm_level_shout: 1 player_empire_shout: 1 player_level_shout: 1 = special_shout - (0/1 Enable special chat functions) - default 0 gm_ghost_shout - (0/1 Enable GM Ghost chat [GM chat is only [GameMaster] : text]) - default 0 gm_empire_shout - (0/1 Enable GM empire with chat - only if gm_ghost_shout = 0) - default 0 gm_level_shout - (0/1 Enable GM level with chat - only if gm_ghost_shout = 0) - default 0 player_empire_shout - (0/1 Enable empire with player chat) - default 0 player_level_shout - (0/1 Enable level with player chat) - default 0 That's all, sorry for my bad english :-) Thx : Denis, Domco thank you np... :-) Edited August 26, 2022 by Metin2 Dev Core X - External 2 Internal 1 1 Link to comment Share on other sites More sharing options...
ThePooter 4 Posted March 20, 2015 Share Posted March 20, 2015 (edited) Hello, global chat + color empire with chat is by Denis. thx. 1) Enable global chat Open input_p2p.cpp Search : if (!d->GetCharacter() || (d->GetCharacter()->GetGMLevel() == GM_PLAYER && d->GetEmpire() != m_bEmpire)) Replace with it: if (!d->GetCharacter()) If you use novaline, search: // ADDED GLOBAL SHOUT OPTION if (!d->GetCharacter()) return; if(!g_bGlobalShoutEnable && (d->GetCharacter()->GetGMLevel() == GM_PLAYER && d->GetEmpire() != m_bEmpire)) return; And replace with it: if (!d->GetCharacter()) return; 2) Add chat functions Open input_main.cpp Search: if (pinfo->type == CHAT_TYPE_SHOUT) { const int SHOUT_LIMIT_LEVEL = 15; if (ch->GetLevel() < SHOUT_LIMIT_LEVEL) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("외치기는 레벨 %d 이상만 사용 가능 합니다."), SHOUT_LIMIT_LEVEL); return (iExtraLen); } if (thecore_heart->pulse - (int) ch->GetLastShoutPulse() < passes_per_sec * 15) return (iExtraLen); ch->SetLastShoutPulse(thecore_heart->pulse); TPacketGGShout p; p.bHeader = HEADER_GG_SHOUT; p.bEmpire = ch->GetEmpire(); strlcpy(p.szText, chatbuf, sizeof(p.szText)); P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout)); SendShout(chatbuf, ch->GetEmpire()); return (iExtraLen); } Replace with it: if (pinfo->type == CHAT_TYPE_SHOUT) { const int SHOUT_LIMIT_LEVEL = 15; if (ch->GetLevel() < SHOUT_LIMIT_LEVEL) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("외치기는 레벨 %d 이상만 사용 가능 합니다."), SHOUT_LIMIT_LEVEL); return (iExtraLen); } if (thecore_heart->pulse - (int) ch->GetLastShoutPulse() < passes_per_sec * 15) return (iExtraLen); ch->SetLastShoutPulse(thecore_heart->pulse); const char* kingdoms[4] = {"|cFF47DA00|H|h[GameMaster]|cFFA7FFD4|H|h","|cFFff0000|H|h[shinsoo]|cFFA7FFD4|H|h","|cFFFFFF00|H|h[Chunjo]|cFFA7FFD4|H|h","|cFF0080FF|H|h[Jinno]|cFFA7FFD4|H|h"}; char chatbuf_global[CHAT_MAX_LEN + 1]; int my_level = ch->GetLevel(); if (gSpecialShout == 1) { if (ch->GetGMLevel() != GM_PLAYER) { if (MasterGhostChat == 1) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",kingdoms[0], buf); } else { if ((MasterColorEmpire == 1) and (MasterLevelChat == 0)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s : %s",ch->GetName(), kingdoms[ch->GetEmpire()], buf); } else if ((MasterColorEmpire == 1) and (MasterLevelChat == 1)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s [%d] : %s",ch->GetName(), kingdoms[ch->GetEmpire()], my_level, buf); } else if ((MasterColorEmpire == 0) and (MasterLevelChat == 1)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s [%d] : %s",ch->GetName(), my_level, buf); } else { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",ch->GetName(), buf); } } } else { if ((PlayerColorEmpire == 1) and (PlayerLevelChat == 0)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s : %s",ch->GetName(), kingdoms[ch->GetEmpire()], buf); } else if ((PlayerColorEmpire == 1) and (PlayerLevelChat == 1)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s [%d] : %s",ch->GetName(), kingdoms[ch->GetEmpire()], my_level, buf); } else if ((PlayerColorEmpire == 0) and (PlayerLevelChat == 1)) { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s [%d] : %s",ch->GetName(), my_level, buf); } else { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",ch->GetName(), buf); } } } else { int len_global = snprintf(chatbuf_global, sizeof(chatbuf_global), "%s : %s",ch->GetName(), buf); } TPacketGGShout p; p.bHeader = HEADER_GG_SHOUT; p.bEmpire = ch->GetEmpire(); strlcpy(p.szText, chatbuf_global, sizeof(p.szText)); P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout)); SendShout(chatbuf_global, ch->GetEmpire()); return (iExtraLen); } 3) Add config function Open config.cpp Search: int gShutdownEnable = 0; Add after: int gSpecialShout = 0; int MasterGhostChat = 0; int MasterColorEmpire = 0; int MasterLevelChat = 0; int PlayerColorEmpire = 0; int PlayerLevelChat = 0; Next search: TOKEN("empire_whisper") { bool b_value = 0; str_to_number(b_value, value_string); g_bEmpireWhisper = !!b_value; continue; } Add after: TOKEN("special_shout") { str_to_number(gSpecialShout, value_string); continue; } TOKEN("gm_ghost_shout") { str_to_number(MasterGhostChat, value_string); continue; } TOKEN("gm_empire_shout") { str_to_number(MasterColorEmpire, value_string); continue; } TOKEN("gm_level_shout") { str_to_number(MasterLevelChat, value_string); continue; } TOKEN("player_empire_shout") { str_to_number(PlayerColorEmpire, value_string); continue; } TOKEN("player_level_shout") { str_to_number(PlayerLevelChat, value_string); continue; } Now open config.h Search: extern int gPlayerMaxLevel; And add before: extern int gSpecialShout; extern int MasterGhostChat; extern int MasterColorEmpire; extern int MasterLevelChat; extern int PlayerColorEmpire; extern int PlayerLevelChat; 4) Game CONFIG Open your CONFIG game and add: special_shout: 1 gm_ghost_shout: 1 gm_empire_shout: 1 gm_level_shout: 1 player_empire_shout: 1 player_level_shout: 1 = special_shout - (0/1 Enable special chat functions) - default 0 gm_ghost_shout - (0/1 Enable GM Ghost chat [GM chat is only [GameMaster] : text]) - default 0 gm_empire_shout - (0/1 Enable GM empire with chat - only if gm_ghost_shout = 0) - default 0 gm_level_shout - (0/1 Enable GM level with chat - only if gm_ghost_shout = 0) - default 0 player_empire_shout - (0/1 Enable empire with player chat) - default 0 player_level_shout - (0/1 Enable level with player chat) - default 0 That's all, sorry for my bad english :-) Thx : Denis, Domco thank you np... :-) it's gonna be like that ? Edited August 26, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Morphe 158 Posted March 26, 2015 Share Posted March 26, 2015 With this is more fine if (pinfo->type == CHAT_TYPE_SHOUT) { const int SHOUT_LIMIT_LEVEL = 15; if (ch->GetLevel() < SHOUT_LIMIT_LEVEL) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("외치기는 레벨 %d 이상만 사용 가능 합니다."), SHOUT_LIMIT_LEVEL); return (iExtraLen); } if (thecore_heart->pulse - (int) ch->GetLastShoutPulse() < passes_per_sec * 15) return (iExtraLen); ch->SetLastShoutPulse(thecore_heart->pulse); const char* kingdoms[4] = {"|cFF47DA00|H|h[GameMaster]|cFFA7FFD4|H|h","|cFFff0000|H|h[Shinsoo]|cFFA7FFD4|H|h","|cFFFFFF00|H|h[Chunjo]|cFFA7FFD4|H|h","|cFF0080FF|H|h[Jinno]|cFFA7FFD4|H|h"}; int my_level = ch->GetLevel(); if (gSpecialShout) { if (ch->GetGMLevel() != GM_PLAYER) { if (MasterGhostChat) { len_global = snprintf(chatbuf, sizeof(chatbuf), "%s : %s",kingdoms[0], buf); } else { if ((MasterColorEmpire) && (!MasterLevelChat)) { len_global = snprintf(chatbuf, sizeof(chatbuf), "%s %s : %s",ch->GetName(), kingdoms[ch->GetEmpire()], buf); } else if ((MasterColorEmpire) && (MasterLevelChat)) { len_global = snprintf(chatbuf, sizeof(chatbuf), "%s %s [%d] : %s",ch->GetName(), kingdoms[ch->GetEmpire()], my_level, buf); } else if ((!MasterColorEmpire) && (MasterLevelChat)) { len_global = snprintf(chatbuf, sizeof(chatbuf), "%s [%d] : %s",ch->GetName(), my_level, buf); } else { len_global = snprintf(chatbuf, sizeof(chatbuf), "%s : %s",ch->GetName(), buf); } } } else { if ((PlayerColorEmpire) && (!PlayerLevelChat)) { len_global = snprintf(chatbuf, sizeof(chatbuf), "%s %s : %s",ch->GetName(), kingdoms[ch->GetEmpire()], buf); } else if ((PlayerColorEmpire) && (PlayerLevelChat)) { len_global = snprintf(chatbuf, sizeof(chatbuf), "%s %s [%d] : %s",ch->GetName(), kingdoms[ch->GetEmpire()], my_level, buf); } else if ((!PlayerColorEmpire) && (PlayerLevelChat)) { len_global = snprintf(chatbuf, sizeof(chatbuf), "%s [%d] : %s",ch->GetName(), my_level, buf); } else { len_global = snprintf(chatbuf, sizeof(chatbuf), "%s : %s", ch->GetName(), buf); } } } else { len_global = snprintf(chatbuf, sizeof(chatbuf), "%s : %s", ch->GetName(), buf); } TPacketGGShout p; p.bHeader = HEADER_GG_SHOUT; p.bEmpire = ch->GetEmpire(); strlcpy(p.szText, chatbuf, sizeof(p.szText)); P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShout)); SendShout(chatbuf, ch->GetEmpire()); return (iExtraLen); } P.S.: Change int with bool. Link to comment Share on other sites More sharing options...
thespeedy 20 Posted July 18, 2015 Share Posted July 18, 2015 howto for mainline? Link to comment Share on other sites More sharing options...
Audiq 7 Posted February 19, 2022 Share Posted February 19, 2022 (edited) Hi i have a problem with input_main please help me 1. This is the hidden content, please Sign In or Sign Up Input_main.cpp 2. This is the hidden content, please Sign In or Sign Up GAME ERROR LOG Edited February 19, 2022 by Audiq 5 1 1 2 Link to comment Share on other sites More sharing options...
Audiq 7 Posted February 20, 2022 Share Posted February 20, 2022 Help mi... Link to comment Share on other sites More sharing options...
Premium WeedHex 635 Posted January 15, 2023 Premium Share Posted January 15, 2023 Why you guys fucking quote 1KM of message just to say a word!!! Link to comment Share on other sites More sharing options...
Recommended Posts