Nukayool Posted August 19, 2016 at 03:44 AM Share Posted August 19, 2016 at 03:44 AM Boas Pessoal,Não vou conseguir explicar muito bem mas vou deixar aqui uma ideia do que é. Vou disponibilizar o ficheiro para poderem fazer comparações. Para quem quer aplicar o chat de reinos na source poderá fazer da seguinte maneira: Ficheiro do char input_main.cpp if (pinfo->type == CHAT_TYPE_SHOUT) { const int SHOUT_LIMIT_LEVEL = g_iUseLocale ? 15 : 3; 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[3] = {"|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]; snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s", kingdoms[ch->GetEmpire()-1], chatbuf); 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); cumpz input_main.rar Link to comment
Magician Posted November 14, 2016 at 05:21 PM Share Posted November 14, 2016 at 05:21 PM a usares este poderia dar um "bug", que é quando o char fala não aparece o nome dele snprintf(chatbuf_global, sizeof(chatbuf_global), "%s %s", kingdoms[ch->GetEmpire()-1], chatbuf); terias de por o nome tmb assim snprintf(chatbuf_global, sizeof(chatbuf_global), "%s [%s] %s", kingdoms[ch->GetEmpire()-1],ch->GetName(), chatbuf); cumps Link to comment
FlorinMarian Posted June 21, 2017 at 12:42 PM Share Posted June 21, 2017 at 12:42 PM This isn't real a fix, it's normal to be chat for every kingdom. Thanks anyway, useful. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now