Advertisement
akbare

change item to other item

Jan 29th, 2024
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. prontera,150,180,4 script Exchanger 4_F_BRZ_WOMAN,{
  2.  
  3. mes .n$;
  4. mes "I can exchange your "+getitemname(.exc_id)+"s for other items.";
  5. mes "Please select from the list what you want.";
  6. mes " ";
  7. mes "Currency: "+ getitemname(.exc_id);
  8. next;
  9. for( .@m = 0; .@m < getarraysize(.item); .@m ++ )
  10. .@g_menu$ = .@g_menu$ + "- "+ getitemname(.item[.@m]) +" ("+ .cost[.@m] +") "+ ( (.item[.@m+1] != 0)?":":"");
  11. .@g = select(.@g_menu$) - 1;
  12. mes .n$;
  13. mes "You have chosen "+ getitemname(.item[.@g]) +" for the price of "+ .cost[.@g] +" "+ getitemname(.exc_id) +"s";
  14. mes "Is that correct?";
  15. next;
  16. if( select("- Yes:- No" ) - 1) close;
  17. mes .n$;
  18. if( countitem(.exc_id) < .cost[.@g] ) {
  19. mes "I'm sorry, but you don't have enough "+getitemname(.exc_id)+", please come back when you have enough.";
  20. close;
  21. }
  22. getitem .item[.@g],1;
  23. delitem .exc_id,.cost[.@g];
  24. mes "Exchange complete.";
  25. close;
  26.  
  27. OnInit:
  28. .n$ = "[ "+ strnpcinfo(0) +" ]";
  29. .exc_id = 501;
  30. setarray .item[0],603,13890,13889,618,616;
  31. setarray .cost[0],1,1,1,1,1;
  32. end;
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement