Jump to content
  • 0

NPC does not send the globalmessage to the players


technick

Question


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  25
  • Reputation:   0
  • Joined:  08/18/17
  • Last Seen:  

I do not know what's happening but npc does not send the globalmessage to the players online.

**no error appears on the console**

script:

 

Spoiler

 

prontera,164,173,3    script    Ticket de Promoção    562,{

    mes "^0000FF*Você vê uma fenda no canto da Máquina de Promoções e logo";
    mes "acima um botão próximo a uma";
    mes "alavanca*^000000";
    next;
    mes "^FF1493[BlinkN PowerBank]^000000";
    mes "Acho que é aqui que eu coloco";
    mes "aquele ^008800Ticket de Promoção^000000...";
    next;
    mes "^FF1493[BlinkN PowerBank]^000000";
    mes "Antes de inserir um ticket veja o que você";
    mes "poderá obter nessa Máquina:";
    next;
    mes "^FF1493[BlinkN PowerBank]^000000";
    for (.@i = 0; .@i < getarraysize(.item); .@i++) {
        mes .qnt[.@i]+"x "+getitemname(.item[.@i])+"";
    }
    next;
    mes "^FF1493[BlinkN PowerBank]^000000";
    mes "Você gostaria de trocar agora?";
    next;
    if(select("[Inserir um Ticket]:[Cancelar]") == 2) {
        mes "^FF1493[BlinkN PowerBank]^000000";
        mes "Quando quiser trocar um";
        mes "^008800Ticket de Promoção^000000, basta vir e falar comigo.";
        mes "Estarei aqui por pouco tempo.";
        mes "Até mais!";
        close;
    }
    mes "^FF1493[BlinkN PowerBank]^000000";
    if(countitem(7608) >= 1) {
        mes "^0000FF*Você insere o Ticket de Promoção na fenda da Máquina e";
        mes "observa enquanto ela puxa o Ticket automáticamente*^000000";
        next;
        mes "^FF1493[BlinkN PowerBank]^000000";
        mes "Legal!!! Isso vai ser bastante útil.";
        delitem 7608,1;
        for(.@i = 0; .@i < getarraysize(.item); .@i++) {
            if(rand(1, 10000) <= .chance[.@i]) {
                if(.item[.@i] == .GlobalMessage) {
                        }
                getitem .item[.@i],.qnt[.@i];
                set .@recompensa,1;
                close;
            }

        }
        if(!.@recompensa) {
            .@i = rand(getarraysize(.item));
            if(.item[.@i] == .GlobalMessage || .item[.@i] == .GlobalMessage2) {
                    }
            getitem .item[.@i], .qnt[.@i];
        }
        close;
        
    } else {
        mes "Hmmm, voce precisa ter um ^008800Ticket de Promoção^000000";
        mes "para receber um dos itens...";
        close;
    }

    OnInit:

        // Array dos itens, quantidade e chance.
        // Chance 1 = 0.01
        setarray .item[0],  6665, 12412, 12915, 12903, 12904, 12908, 12905, 12906, 12907, 12912, 12375,  13858,  13588, 12210, 12709, 12710, 13718, 13750, 13756, 13714, 13711, 7608; 
        setarray .qnt[0],    1,     1,     1,      1,    1,    1,     1,     1,    1,       1,      1,     1,     5,      1,      1,     1,    20,     5,     1,     1,     1,     1;
        setarray .chance[0], 4,     1,     1,      1,    1,    1,     1,     1,    1,       1,      1,     1,     1,      3,     3,      3,    3,     5,      5,    10,    10,    1000;

        // Envia uma mensagem global para todos online quando ganhar item com a id
        .GlobalMessage = 7608;
        
}

 

Edited by technick
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Not sure what the script does, but maybe you're missing an announce to actually make an global message.

In this part: add announce

Quote

if(!.@recompensa) {
            .@i = rand(getarraysize(.item));
            if(.item[.@i] == .GlobalMessage || .item[.@i] == .GlobalMessage2) {
                    }
            getitem .item[.@i], .qnt[.@i];
        }

Best after the getitem part

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  25
  • Reputation:   0
  • Joined:  08/18/17
  • Last Seen:  

On 10/27/2017 at 9:49 PM, llchrisll said:

Not sure what the script does, but maybe you're missing an announce to actually make an global message.

In this part: add announce

Best after the getitem part

It sends a rare drop message.

Ex: 7608 (Premium Ticket)

I'll test here, tks.

up

problem not solved ;-;

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

if(.item[.@i] == .GlobalMessage || .item[.@i] == .GlobalMessage2) {
	announce "YOUR MESSAGE HERE",bc_all;
}
getitem .item[.@i], .qnt[.@i];

as mentioned by @llchrisll, your script doesnt have the announce part.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...