Advertisement
Meerooy

orochimakoto

Sep 5th, 2013
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. - shop costume_shop -1,501:-1
  2.  
  3. prontera.gat,156,185,5 script Capt. Krauser 561,{
  4.  
  5. mes "^0000ff[Capt. Krauser]^000000";
  6. mes "Ahoy mate! Do ye have spare costumes";
  7. mes "that ye wanna get rid 'o?";
  8. next;
  9. set .@s, select( "No! Goood bye.", "Trade-in Costumes", "More information" );
  10. if( .@s == 1 ) {
  11. mes "^0000ff[Capt. Krauser]^000000";
  12. mes "Okay 'ave a nice day.";
  13. }
  14. if( .@s == 3 ) {
  15. mes "^0000ff[Capt. Krauser]^000000";
  16. mes "I needs more clothes fer me mates fer our adventures in th' sea, so I be buyin' some fer these ^00ff00Pirate Doubloons^000000 that we 'ave!";
  17. next;
  18. mes "^0000ff[Capt. Krauser]^000000";
  19. mes "These loots might come in handy fer ye someday too mate!";
  20. }
  21.  
  22. getinventorylist;
  23. .@calc = 1024|2048|4096|8192;// to lazy to calculate
  24. for( set .@i, 0; .@i < @inventorylist_count; set .@i, .@i + 1 )
  25. if( !@inventorylist_expire[.@i] ) {
  26. if ( getiteminfo( @inventorylist_id[.@i],5 ) & .@calc ) {
  27. for( set .@j, 0; .@j < @inventorylist_amount[.@i]; set .@j, .@j + 1 ) {
  28. set .@list_id[ .@size_shop ], @inventorylist_id[.@i];
  29. set .@size_shop, .@size_shop + 1;
  30. }
  31. }
  32. }
  33.  
  34. if( !.@size_shop ) {
  35. mes "^0000ff[Capt. Krauser]^000000";
  36. mes "Shiver me timbers! I don't see any costumes on yer booty mate!";
  37. } else {
  38. mes "^0000ff[Capt. Krauser]^000000";
  39. mes "Okay, here's a list o' th' costumes in yer loot.";
  40. next;
  41. npcshopitem "costume_shop",501,-1;
  42. for( set .@i, 0; .@i < .@size_shop; set .@i, .@i + 1 )
  43. npcshopadditem "costume_shop",.@list_id[.@i],0;
  44. npcshopdelitem "costume_shop",501;
  45. callshop "costume_shop", 1;
  46. npcshopattach "costume_shop";
  47. }
  48. end;
  49.  
  50. OnBuyItem:
  51. if( !checkweight2( .reward_ID,.reward_amount ) ) {
  52. message strcharinfo(0),"You need additional weight capacity to complete this trade.";
  53. close;
  54. }
  55. set .@count, getarraysize( @bought_nameid );
  56. for( set .@i, 0; .@i < .size_count; set .@i, .@i + 1 ) {// don't check the weight..
  57. set .@check, .reward_amount[.@i] * .@count;
  58. if( .@check > 30000 ) {
  59. message strcharinfo(0),"You can't purchase that many "+ getitemname( .reward_ID[.@i] ) +".";
  60. end;
  61. }
  62. set .@gain$, .@gain$ + ( getstrlen( .@gain$ ) ? ", " : "" ) + .@check +" "+ getitemname( .reward_ID[.@i] );
  63. }
  64. mes "Sell the costume for "+ .@gain$ +"?";
  65. next;
  66. if( select( "Yes, I sell", "No" ) -1 ) end;
  67.  
  68. for( set .@i, 0; .@i < .@count; set .@i, .@i + 1 )
  69. if ( countitem( @bought_nameid[.@i] ) < @bought_quantity[.@i] ) {
  70. mes "Have you lost one item?";
  71. close;
  72. }
  73. for( set .@i, 0; .@i < .@count; set .@i, .@i + 1 )
  74. delitem @bought_nameid[.@i], @bought_quantity[.@i];
  75. for( set .@i, 0; .@i < .size_count; set .@i, .@i + 1 )
  76. getitem .reward_ID[.@i], .reward_amount[.@i] * .@count;
  77. mes "Nice doin' business wit' ye!";
  78. close;
  79.  
  80. OnInit:
  81. setarray .reward_ID, 7875; // item ID gained - you can add more ID <item ID>, <item ID>,...
  82. setarray .reward_amount, 1; // item count gained - ( count of the item /element of array of .reward_ID )
  83. set .size_count, getarraysize( .reward_amount );
  84. end;
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement