yuhsing

Untitled

Apr 6th, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1.  
  2.  
  3. prontera,155,170,5 script Quests 965,{
  4. function Add;
  5. callshop "qshop",1;
  6. npcshopattach "qshop";
  7. end;
  8.  
  9. OnInit:
  10. // N?o mexa em nada acima disso
  11. // Add(Reward ID,Reward Amount,Required ID,Required Amount,{,...});
  12. Add(535,1,536,1);
  13. npcshopdelitem "qshop",537;
  14. end;
  15.  
  16. OnBuyItem:
  17. if(getarraysize(@bought_nameid) > 1) {
  18. mes "Por favor escolha só um item.";
  19. close;
  20. }
  21. mes strnpcinfo(1);
  22. mes "Quest: "+getd(".q_"+@bought_nameid+"[1]")+"x "+getitemname(getd(".q_"+@bought_nameid+"[0]"));
  23. mes "Requerimentos:";
  24. for(set .@i,2; .@i < getarraysize(getd(".q_"+@bought_nameid+"")); set .@i,.@i + 2) {
  25. mes ""+getd(".q_"+@bought_nameid+"["+(.@i+1)+"]")+"x "+getitemname(getd(".q_"+@bought_nameid+"["+(.@i)+"]"))+"";
  26. if(.@i%8 == 0) next;
  27. }
  28. close;
  29.  
  30. function Add {
  31. // if(getargcount()%2) { message "Zawe","Something went wrong. Theres is something wrong with the Code."; return; }
  32. for(set .@i,0; .@i < getargcount(); set .@i,.@i + 1) {
  33. if(.@i%2 == 0) {
  34. // if(getitemname(getarg(.@i)) == "null") { message "Zawe","Something went wrong. One of the Items ID do not exist."; return; }
  35. }
  36. }
  37. for(set .@i,0; .@i < getargcount(); set .@i,.@i + 1) {
  38. setarray .@j[.@i],getarg(.@i);
  39. // message "Zawe",getarg(.@i);
  40. }
  41. copyarray getd(".q_"+getarg(0)+"[0]"),.@j[0],getarraysize(.@j);
  42. npcshopadditem "qshop",getarg(0),1;
  43. return;
  44. }
  45. }
  46.  
  47. - shop qshop 1,535:-1
Advertisement
Add Comment
Please, Sign In to add comment