Im trying to make that on my own, the only part that I 'copied' was the getd area.
And I posted the wrong script(Yay...).
prontera,142,170,5 script Quests 965,{
function Add;
callshop "qshop",1;
npcshopattach "qshop";
end;
OnInit:
// Não mexa em nada acima disso
// Add(Reward ID,Reward Amount,Required ID,Required Amount,{,...});
Add(535,1,536,1);
npcshopdelitem "qshop",537;
end;
OnBuyItem:
if(getarraysize(@bought_nameid) > 1) {
mes "Por favor escolha só um item.";
close;
}
mes strnpcinfo(1);
mes "Quest: "+getd(".q_"+@bought_nameid+"[1]")+"x "+getitemname(getd(".q_"+@bought_nameid+"[0]"));
mes "Requerimentos:";
for(set .@i,2; .@i < getarraysize(getd(".q_"+@bought_nameid+"")); set .@i,.@i + 2) {
mes ""+getd(".q_"+@bought_nameid+"["+(.@i+2)+"]")+"x "+getitemname(getd(".q_"+@bought_nameid+"["+(.@i+1)+"]"))+"";
if(.@i%8 == 0) next;
}
close;
function Add {
if(getargcount()%2) { message "Zawe","Something went wrong. Theres is something wrong with the Code."; return; }
for(set .@i,0; .@i < getargcount(); set .@i,.@i + 1) {
if(.@i%2 == 0) {
if(getitemname(getarg(.@i)) == "null") { message "Zawe","Something went wrong. One of the Items ID do not exist."; return; }
}
}
for(set .@i,0; .@i < getargcount(); set .@i,.@i + 1) {
setarray .@j[.@i],getarg(.@i);
message "Zawe",getarg(.@i);
}
copyarray getd(".q_"+getarg(0)+"[0]"),.@j[0],getarraysize(.@j);
npcshopadditem "qshop",getarg(0),1;
return;
}
}
- shop qshop -1,537:-1