Advertisement
akbare

item in inventory to something item

Jan 29th, 2024
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. prontera,155,181,5 script Sample#exchange 4_F_KAFRA1,{
  2.  
  3. mes "Exchange these item?";
  4. for ( .@i = 0; .@i < .item_size; .@i++ ) {
  5. mes " > "+ getitemname( .item[.@i] );
  6. }
  7. if ( select( "Exchange","Cancel" ) == 1 ) {
  8. for ( .@i = 0; .@i < .item_size; .@i++ ) {
  9. .@count = countitem( .item[.@i] );
  10. if ( .@count ) {
  11. delitem .item[.@i],.@count;
  12. .@total += .@count;
  13. }
  14. }
  15. getitem .reward, .@total;
  16. mes "Exchanged "+.@total+"x items to "+.@total+"x "+getitemname( .reward );
  17. }
  18. close;
  19.  
  20. OnInit:
  21. .reward = 909;
  22. setarray .item,512,506,507,508,509;
  23. .item_size = getarraysize( .item );
  24. end;
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement