Jump to content
  • 0

[ Ajuda ] Script NPC


Shenna

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   0
  • Joined:  11/12/17
  • Last Seen:  

-    script    Pontos    MvP    -1,{
OnNPCKillEvent:
if(killedrid== 1059 || killedrid== 1157 || killedrid== 1087 || killedrid== 1785 || killedrid== 1150 || killedrid== 1038 || killedrid== 1251 || killedrid== 1159 || killedrid== 1492 || killedrid== 1046 || killedrid== 1312 || killedrid== 1272 || killedrid== 1389 || killedrid== 1630 || killedrid== 1190 ||
killedrid== 1112 || killedrid== 1147 || killedrid== 1086){
set PontoMvp,PontoMvp+1;
dispbottom "Parabens "+strcharinfo(0)+", Sua recompensa por derrotar esse montros e 1 Ponto MvP! Agora voce possui "+PontoMvp+" pontos.";
}

if(killedrid== 1929 || killedrid== 1779 || killedrid== 1708 ||killedrid== 1734 || killedrid== 1685 || killedrid== 1719 || killedrid== 1623 || killedrid== 1658){
set PontoMvp,PontoMvp+5;
dispbottom "Parabens "+strcharinfo(0)+", Sua recompensa por derrotar esse montros e 5 Pontos MvP! Agora voce possui "+PontoMvp+" pontos.";
}

if(killedrid== 1871 || killedrid== 1583 || killedrid== 1751 || killedrid== 1768 || killedrid== 1832 || killedrid== 1874 || killedrid== 1917 || killedrid== 1647 || killedrid== 1649 || killedrid== 1650 || killedrid== 1651 || killedrid== 1648 || killedrid== 1646){
set PontoMvp,PontoMvp+10;
dispbottom "Parabens "+strcharinfo(0)+", Sua recompensa por derrotar esse montros e 10 Pontos MvP! Agora voce possui "+PontoMvp+" pontos.";
}

if(killedrid== 1956){
set PontoMvp,PontoMvp+15;
dispbottom "Parabens "+strcharinfo(0)+", Sua recompensa por derrotar esse montros e 15 Pontos MvP! Agora voce possui "+PontoMvp+" pontos.";
}
end;
}


-    shop    MVSHOP1    -1,512:-1
-    shop    MVSHOP2    -1,512:-1

prontera ,167,188,3    script    Pontos    MVP    587;{
prontera ,167,188,3    script    Pontos    MvP    Pontos    MVP ;{
mes "[^FF0000Loja MvP^000000]";
mes "•MVP e a abreviação para Most Valuable Player, que significa Jogador de Maior Valor.";
mes "•É uma definição que não se limita apenas à Ragnarök Online.";
next;
mes "[^FF0000Loja_MvP^000000]";
mes "•A dificuldade de um MVP está pelo seu HP, dano e Experiência altíssimos.";
mes "•Eles são do tipo Chefe, ou seja, possuem certas prioridades que um monstro comum não possui.";
next;
mes "[^FF0000Loja_MvP^000000]";
mes "•Os MVPs são livres para todos os jogadores: qualquer um poderá atacar um MVP sem estar infringindo a regra de Kill Steal.";
mes "•Entretanto, se houver abuso e habilidade, os infratores deverão ser denunciados.";
next;
mes "[^FF0000Loja_MvP^000000]";
mes "Deseja trocar seus pontos MvP por itens?";
switch(select("[^339966+^000000] Sim.:[^FF0000+^000000] Não."))
{
case 1:
next;
    mes "[^FF0000Loja MvP^000000]";
    mes "^FF0000Escolha a categoria de itens que lhe interessa:^000000";
    set @s, select("Utilidades:Hats");
    message strcharinfo(0),"Esta loja só aceita Pontos MvP.";
    dispbottom "Você tem "+PontoMvp+" Pontos MvP.";
    callshop "MVSHOP"+@s,1;
    npcshopattach "MVSHOP"+@s;
    end;
case 2:
close;
}

OnBuyItem:
mes "[^FF0000Loja MvP^000000]";
if (PontoMvp==0){mes "Você não possui Pontos Mvp"; close;}
if (PontoMvp>=1){
    set .@i,0;
    while (.@i < getarraysize(@bought_nameid)) {
        set .@j, 0;
        while (.@j < getarraysize(getd(".Shop"+@s))) {
            if(getd(".Shop"+@s+"["+.@j+"]") == @bought_nameid[.@i]) {
                set @itemcost, (getd(".Shop"+@s+"["+(.@j+1)+"]") * @bought_quantity[.@i]);
                set @totalcost, @totalcost + @itemcost;
                break; }
            set .@j, .@j+2; }
        set .@i, .@i+1; }
    if (@totalcost > PontoMvp) dispbottom "Você não tem o suficiente de Pontos MvP."; 
    else {
        set .@i,0;
        while (.@i < getarraysize(@bought_nameid)) {
            getitem @bought_nameid[.@i], @bought_quantity[.@i];
            
            dispbottom "Você comprou "+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+".";

            set .@i, .@i+1; }
        set PontoMvp,PontoMvp-@totalcost;
        mes "Seu total de Pontos MvP agora e "+PontoMvp+" .";}
    set @totalcost, 0;
    deletearray @bought_nameid[0], 128;
    deletearray @bought_quantity[0], 128;
close;
    end;
}

OnInit:
    setarray .Currency[1],507;
    setarray .Shop1[0],12210,1,12208,1,12103,5;
    setarray .Shop2[0],5518,300,5374,300,2202,100;

    set .@i,1;
    while (.@i <= getarraysize(.Currency)) {
        set .@j,0;
while (.@j < getarraysize(getd(".Shop"+.@i))) {
            npcshopdelitem "MVSHOP"+.@i,512;
            npcshopadditem "MVSHOP"+.@i, getd(".Shop"+.@i+"["+.@j+"]"), getd(".Shop"+.@i+"["+(.@j+1)+"]");
            set .@j, .@j+2; }
        set .@i, .@i+1; }
    end;

}

 

Está acusando o seguinte :

[Debug]: mapindex_name2id: Map "prontera " not found in index list! 
[Error]: npc_parsesrcfile: Unknown map 'prontera ' in file 'MVP Point.txt', line '30'. Skipping line... 
[Error]: Missing 1 right curlys in file 'MVP Point.txt', line '109'. 

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  545
  • Reputation:   220
  • Joined:  03/01/13
  • Last Seen:  

It may be helpful to post the script so users can download it or link us to the file on pastebin or github. As it stands it is difficult to discern where lines 30 and 109 are. I also encourage you to use the script tool when posting in the future.

prontera ,167,188,3    script    Pontos    MVP    587;{
prontera ,167,188,3    script    Pontos    MvP    Pontos    MVP ;{
mes "[^FF0000Loja MvP^000000]";
mes "•MVP e a abreviação para Most Valuable Player, que significa Jogador de Maior Valor.";
mes "•É uma definição que não se limita apenas à Ragnarök Online.";
next;
mes "[^FF0000Loja_MvP^000000]";
mes "•A dificuldade de um MVP está pelo seu HP, dano e Experiência altíssimos.";
mes "•Eles são do tipo Chefe, ou seja, possuem certas prioridades que um monstro comum não possui.";
next;
mes "[^FF0000Loja_MvP^000000]";
mes "•Os MVPs são livres para todos os jogadores: qualquer um poderá atacar um MVP sem estar infringindo a regra de Kill Steal.";
mes "•Entretanto, se houver abuso e habilidade, os infratores deverão ser denunciados.";
next;
mes "[^FF0000Loja_MvP^000000]";
mes "Deseja trocar seus pontos MvP por itens?";
switch(select("[^339966+^000000] Sim.:[^FF0000+^000000] Não."))
{

^ In this excerpt you define two NPCs but you put a space between prontera and the comma. I'm not sure if this was an issue from copying this into notepadd++ but you need to make proper use of the tab key. You've also defined two NPCs on the same coordinates. This will cause issues. The 2nd NPC 'Pontos MvP Pontos MVP' has no sprite. If you are intending to use an invisible sprite, try ID 111. I wonder if you are trying too make a duplicate NPC here. If so read over this wiki article.

EDIT: This example is corrected. I removed the space after prontera, gave the 2nd NPC a unique ID and replaced the semicolons with commas before your open bracket.

prontera,167,188,3	script	Pontos MVP	587,{
}
prontera,167,188,3	script	Pontos#MvP	587,{
}

 

Regards,
~Azura Skyy

Edited by Azura Skyy
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   0
  • Joined:  11/12/17
  • Last Seen:  

Ok , sorry and thanks for the help . 

Now i has a new error in line 110

[Error]: Missing 1 right curlys in file 'MVP Point.txt', line '110'. 
Edited by Shenna
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  545
  • Reputation:   220
  • Joined:  03/01/13
  • Last Seen:  

3 minutes ago, Shenna said:

Ok , sorry and thanks for the help . 

Now i has a new error in line 110


[Error]: Missing 1 right curlys in file 'MVP Point.txt', line '110'. 

Please post what you have or I can't begin to tell you whats wrong since it was updated.

Regards,
~Azura Skyy

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   0
  • Joined:  11/12/17
  • Last Seen:  

https://pastebin.com/nyQPrjF2

@Azura Skyy

 

[Error]: script error in file 'MVP Point.txt' line 27 column 3 
    parse_line: expect command, missing function name or calling undeclared function 
    24: { 
    25: 
    26: 
*   27:                 shop    MVSHOP1 -1,512:-1 
        ~~~~~~~~~~~~~~~~^ 
    28:                 shop    MVSHOP2 -1,512:-1 
    29: end; 
    30: 
Edited by Shenna
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  545
  • Reputation:   220
  • Joined:  03/01/13
  • Last Seen:  

9 hours ago, Shenna said:

https://pastebin.com/nyQPrjF2

@Azura Skyy

 


[Error]: script error in file 'MVP Point.txt' line 27 column 3 
    parse_line: expect command, missing function name or calling undeclared function 
    24: { 
    25: 
    26: 
*   27:                 shop    MVSHOP1 -1,512:-1 
        ~~~~~~~~~~~~~~~~^ 
    28:                 shop    MVSHOP2 -1,512:-1 
    29: end; 
    30: 

You should check out npc/merchants/shops as a reference. You can denote shops in two ways. The first is to create a static NPC at a set location like you see in that txt file (Example 1). The other option is to create a shop that can be called using the callshop function (Example 2).

  • Example 1
alberta_in,175,97,4	shop	Weapon Dealer#alb2	82,1146:-1,1245:-1
  • Example 2
payon,166,106,6	script	Merchant	101,{
	callshop "FruitShop",1;
}
-	shop	MVSHOP1	-1,512:-1


Hope this helps,
~Azura Skyy

Edited by Azura Skyy
  • Love 1
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...