Jump to content
  • 0

callshop npc quest


Question

Posted (edited)

Hello, i was searching a lot about callshop func, I tried to put this on work but it refuses the reward all the time
 

-    shop    quest_shop    139,501:-1
-    script    shop_conf#01    -1,{

OnInit:
    setarray $Q_item1[0],5518;
    setarray $Q_custo1[0],0;

        npcshopdelitem "quest_shop",501;
        if(getarraysize($Q_item1) >= 1) {
            npcshopitem "quest_shop",$Q_item1[0],$Q_custo1[0];
            for (set .@i,1; .@i < getarraysize($Q_item1); set .@i,.@i+1) {
                npcshopadditem "quest_shop",$V_item1[.@i],$V_custo1[.@i];    
            }
        }
    end;
}

prontera,155,170,4    script    Quests    57,{

mes "[ ^0000ffQuests^000000 ]";
mes "Olá, eu sou a responsável por todas as quests do SEURO, para fazer ou ver os itens necessários para uma quest, basta você selecionar o item que deseja e clicar na opção comprar, o numero em verde proximo ao nome dos itens, indica a quantidade daquele item disponível em seu armazém..";
close2;
npcshopattach "quest_shop",1;
callshop "quest_shop",1;
end;

OnBuyItem:

    for(set .@i,0; .@i < getarraysize(@bought_nameid); set .@i,.@i+1) {
        set @cost,callfunc("Q_bonuscusto1",@bought_nameid[.@i]);
        if (@bought_nameid[.@i]== 5518) {
            set @item1,countitem(7539);
            set @item2,countitem(7063);
            set @item3,countitem(982);
            mes "[ ^0000ffQuests^000000 ]";
            mes "Para fazer este item serão necessários:";
            mes "Moeda Poring - (^00ff00"+@item1+"^000000/10)";
            mes "Pena Macia - (^00ff00"+@item2+"^000000/100)";
            mes "Tintura branca - (^00ff00"+@item3+"^000000/2)";
            next;
            mes "[ ^0000ffQuests^000000 ]";
            mes "Você possui todos os itens?";
            if(select("Sim, prossiga com a quest.:Não, vou consegui-los.")==2)next;mes "[ ^0000ffQuests^000000 ]"; mes "Vá em busca dos itens e volte aqui quando consegui-los."; close;
            if((countitem(7539)== 10) || (countitem(7063)==100) || (countitem(982)==2)){
                next;
                mes "Muito bem, aqui está seu item.";
                delitem 7539,10;
                delitem 7063,100;
                delitem 982,2;
                getitem @boughtnameid[.@i],1;
                end;
            }else{
                next;
                mes "[ ^0000ffQuests^000000 ]";
                mes "Me desculpe, mas você não possui todos os itens"; close;
            }      
        }
        deletearray @bought_nameid[0],getarraysize(@bought_nameid);
        deletearray @bought_quantity[0],getarraysize(@bought_quantity);
        end;
}
}
function    script    Q_bonuscusto1    {
    for(set .@i,0; .@i < getarraysize($Q_item1); set .@i,.@i+1) {
        if($Q_item1[.@i] == getarg(0)) {
            return $Q_custo1[.@i];
        }
    }
return;
}




 

Edited by Akkarin
Please use codeboxes in future.

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

I don't knwo what you want to do however

npcshopadditem "quest_shop",$V_item1[.@i],$V_custo1[.@i];  // $V_item1[.@i] and $V_custo1[.@i] undefined
//* all assertions shoud be true -> use the logical operator AND
//* the amount of item should be >=
if((countitem(7539)== 10) || (countitem(7063)==100) || (countitem(982)==2)){

 

Edited by Capuche

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...