Ir para conteúdo

[Loot Channel] -- Tutorial como adicionar Loot Channel

Featured Replies

Postado

monsters.cpp: In member function ‘void MonsterType::dropLoot(Container*)’:
monsters.cpp:212:9: error: suggest explicit braces to avoid ambiguous ‘else’ [-Werror=parentheses]
  else if(message == LOOTMSG_PLAYER || message == LOOTMSG_BOTH)
 

[progress=green]50[/progress]

 

  • 1 month later...
  • Respostas 15
  • Visualizações 7.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Posted Images

Postado
Em 19/08/2020 em 12:01, diarmaint disse:

@Mathias Kenfi

TFS 0.4 8.60

Funcionou mas a cor das palavras ficam em amarelo, igual da fala.

image.thumb.png.85abd468b65dc4de5a0137642261a386.png

aonde mudo a cor da letra? gostaria que falasse em laranja ou verde.

 

 

Edit---

o chanel não estava abrindo, adicionei no login.lua

doPlayerOpenChannel(cid, 11)

 

e como eu não quis que os players falassem no channel eu mudei para

<channel id="11" name="Loot" logged="yes" active="0" muted="999" conditionMessage="Não pode falar aqui!."/>

 

 

 

 

 

e conseguiu mudar a cor no channel? o meu tá com a mesma coisa

  • 2 years later...
Postado
Em 13/11/2024 em 18:09, Rodrigo94 disse:

Eu adicionei no tfs 0.4 e funcionou tudo certo, só que nao manda pro player os dizeres do Loot na tela só direto no loot channel.. esse script só funciona assim? tem alguma maneira de voltar a escrita como se fosse broadcast no meio da tela ?

 

1082753392_Capturadetela2024-11-13181052.thumb.png.0f14c1944ee40e768fad825c5e56d450.png

eu estava com mesmo problema, foda e que a galera descobre como resolver o problema mas nao passa adiante.

em monsters.cpp

altera toda essa parte que inicia com:

std::stringstream ss;
std::string nick;

substitui tudo por:
 

std::stringstream ss;
std::string nick;
ss << "Loot of " << nameDescription << ": " << corpse->getContentDescription() << ".";

int lootChannelId = g_config.getNumber(ConfigManager::LOOT_CHANNEL);

if (owner->getParty() && message > LOOTMSG_PLAYER) {
    // Envia mensagem para a party
    owner->getParty()->broadcastPartyLoot((MessageClasses)MSG_CHANNEL, ss.str());
} else {
    // Verificar se o canal de loot existe
    ChatChannel* lootChannel = g_chat.getChannel(owner, lootChannelId);
    if (!lootChannel) {
        // Caso o canal de loot não exista, enviar diretamente ao jogador
        owner->sendTextMessage((MessageClasses)g_config.getNumber(ConfigManager::LOOT_MESSAGE_TYPE), ss.str());
    } else {
        // Verificar se o jogador está no canal de loot
        if (!lootChannel->hasUser(owner)) {
            // Jogador não está no canal, enviar diretamente ao jogador
            owner->sendTextMessage((MessageClasses)g_config.getNumber(ConfigManager::LOOT_MESSAGE_TYPE), ss.str());
        } else {
            // Jogador está no canal de loot, enviar mensagem para o canal
            owner->sendChannelMessage("", ss.str(), (MessageClasses)MSG_CHANNEL, lootChannelId);
        }
    }
}
 

Editado por ubnt22 (veja o histórico de edições)

Postado
Em 21/11/2024 em 10:03, ubnt22 disse:

eu estava com mesmo problema, foda e que a galera descobre como resolver o problema mas nao passa adiante.

em monsters.cpp

altera toda essa parte que inicia com:

std::stringstream ss;
std::string nick;

substitui tudo por:
 

std::stringstream ss;
std::string nick;
ss << "Loot of " << nameDescription << ": " << corpse->getContentDescription() << ".";

int lootChannelId = g_config.getNumber(ConfigManager::LOOT_CHANNEL);

if (owner->getParty() && message > LOOTMSG_PLAYER) {
    // Envia mensagem para a party
    owner->getParty()->broadcastPartyLoot((MessageClasses)MSG_CHANNEL, ss.str());
} else {
    // Verificar se o canal de loot existe
    ChatChannel* lootChannel = g_chat.getChannel(owner, lootChannelId);
    if (!lootChannel) {
        // Caso o canal de loot não exista, enviar diretamente ao jogador
        owner->sendTextMessage((MessageClasses)g_config.getNumber(ConfigManager::LOOT_MESSAGE_TYPE), ss.str());
    } else {
        // Verificar se o jogador está no canal de loot
        if (!lootChannel->hasUser(owner)) {
            // Jogador não está no canal, enviar diretamente ao jogador
            owner->sendTextMessage((MessageClasses)g_config.getNumber(ConfigManager::LOOT_MESSAGE_TYPE), ss.str());
        } else {
            // Jogador está no canal de loot, enviar mensagem para o canal
            owner->sendChannelMessage("", ss.str(), (MessageClasses)MSG_CHANNEL, lootChannelId);
        }
    }
}
 

 

 

Pelo que analisei o codigo nao é pro meu TFS da erro de MSG_CHANNEL

Não deu certo, tive erros ao compilar:

 

1>  monsters.cpp
1>..\monsters.cpp(137): error C2065: 'MSG_CHANNEL' : undeclared identifier
1>..\monsters.cpp(140): error C2065: 'ChatChannel' : undeclared identifier
1>..\monsters.cpp(140): error C2065: 'lootChannel' : undeclared identifier
1>..\monsters.cpp(140): error C2065: 'g_chat' : undeclared identifier
1>..\monsters.cpp(140): error C2228: left of '.getChannel' must have class/struct/union
1>          type is ''unknown-type''
1>..\monsters.cpp(141): error C2065: 'lootChannel' : undeclared identifier
1>..\monsters.cpp(146): error C2065: 'lootChannel' : undeclared identifier
1>..\monsters.cpp(146): error C2227: left of '->hasUser' must point to class/struct/union/generic type
1>          type is ''unknown-type''
1>..\monsters.cpp(151): error C2065: 'MSG_CHANNEL' : undeclared identifier
1>..\monsters.cpp(157): error C2601: 'MonsterType::createLoot' : local function definitions are illegal
1>          ..\monsters.cpp(95): this line contains a '{' which has not yet been matched
1>..\monsters.cpp(190): error C2601: 'MonsterType::createChildLoot' : local function definitions are illegal
1>          ..\monsters.cpp(95): this line contains a '{' which has not yet been matched
1>..\monsters.cpp(216): error C2601: 'Monsters::loadFromXml' : local function definitions are illegal
1>          ..\monsters.cpp(95): this line contains a '{' which has not yet been matched
1>..\monsters.cpp(267): error C2601: 'Monsters::getDamageCondition' : local function definitions are illegal
1>          ..\monsters.cpp(95): this line contains a '{' which has not yet been matched
1>..\monsters.cpp(282): error C2601: 'Monsters::deserializeSpell' : local function definitions are illegal
1>          ..\monsters.cpp(95): this line contains a '{' which has not yet been matched
1>..\monsters.cpp(887): error C2601: 'Monsters::loadMonster' : local function definitions are illegal
1>          ..\monsters.cpp(95): this line contains a '{' which has not yet been matched
1>..\monsters.cpp(1486): error C2601: 'Monsters::loadLoot' : local function definitions are illegal
1>          ..\monsters.cpp(95): this line contains a '{' which has not yet been matched
1>..\monsters.cpp(1546): error C2601: 'Monsters::loadChildLoot' : local function definitions are illegal
1>          ..\monsters.cpp(95): this line contains a '{' which has not yet been matched
1>..\monsters.cpp(1580): error C2601: 'Monsters::getMonsterType' : local function definitions are illegal
1>          ..\monsters.cpp(95): this line contains a '{' which has not yet been matched
1>..\monsters.cpp(1589): error C2601: 'Monsters::getMonsterType' : local function definitions are illegal

 

Editado por Rodrigo94 (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo