Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1.  
  2. /*
  3. make sure you loaded the "extra_function.txt" before use this NPC.
  4. */
  5.  
  6. - shop card_merge_shop -1,909:100
  7.  
  8. prontera,155,175,5 script Card Recycle#card 563,{
  9. do{
  10. mes "Pick an option";
  11. mes " ";
  12. .@option = select( "merge "+.card_count+" card","information" );
  13. if( .@option == 1 ){
  14. if( Zeny < .zeny_cost ){
  15. mes "You need ^FF0000"+.zeny_cost+" zeny^000000 per merge.";
  16. close;
  17. }
  18. if( npcshopattach( .shop_npc_name$ ) ){
  19. deletearray @sold_nameid;
  20. mes "Put ^FF0000 "+.card_count+" x Different Card^000000 into the window.";
  21. callshop .shop_npc_name$,2;
  22. end;
  23. }
  24.  
  25. }
  26. else{
  27. mes "You need to give ";
  28. mes " ^FF0000"+.card_count+" Monster Card + "+.zeny_cost+" Zeny^000000";
  29. mes "to get a New Card each time.";
  30. next;
  31. }
  32.  
  33. }while( .@option == 2 );
  34. close;
  35.  
  36. OnSellItem:
  37. .@sold_size = getarraysize( @sold_nameid );
  38. if( .@sold_size == .card_count ){
  39. mes "^0055FF[Card Checking]^000000";
  40. for( .@i = 0; .@i < .@sold_size; .@i++ ){
  41. if( compare( .forbidden_card$,"|"+@sold_nameid[.@i]+"|" ) ){
  42. mes " ~ "+getitemname( @sold_nameid[.@i] )+"^000000 cant be used.";
  43. close;
  44. }
  45. .@item_type[.@i] = getiteminfo( @sold_nameid[.@i],2 );
  46. .@not_valid = ( .@item_type[.@i] != IT_CARD || @sold_nameid[.@i] < .card_id_range[0] || @sold_nameid[.@i] > .card_id_range[1] );
  47. mes " ~ "+getitemname( @sold_nameid[.@i] )+"^000000 is "+( ( .@not_valid )?"^FF0000NOT":"a" )+" Card^000000.";
  48. if( .@not_valid ) .@failed++;
  49. }
  50. if( !.@failed ){
  51. mes " ";
  52. mes "Confirm to exchange these "+.card_count+" Cards into a NEW Card ??";
  53. next;
  54. if( select( "YES","No" ) == 1 ){
  55. Zeny -= .zeny_cost;
  56. for( .@i = 0; .@i < .@sold_size; .@i++ )
  57. delitem @sold_nameid[.@i],1;
  58.  
  59. mes "Rolling a new card.....";
  60. for( .@i = 0; .@i < 25 ; .@i++ ){
  61. if( .@i == 20 )
  62. mes "^777777-- stopping --^000000";
  63. cutin card_illust( rand( .card_id_range[0],.card_id_range[1] ) ),4;
  64. sleep2 ( .@i * 25 + 100 );
  65. }
  66.  
  67. do{
  68. .@new_card = rand( .card_id_range[0],.card_id_range[1] );
  69. }while( compare( .forbidden_card$,"|"+.@new_card+"|" ) );
  70.  
  71. cutin card_illust( .@new_card ),4;
  72. mes " ";
  73. mes "Gained a New Card: ";
  74. mes " ~ ^0055FF"+getitemname( .@new_card )+"^000000";
  75. getitem .@new_card,1;
  76. }
  77. }
  78.  
  79. }
  80. else{
  81. mes "Make sure you input ^FF0000 "+.card_count+" Different Card^000000.";
  82. }
  83. close2;
  84. cutin "",255;
  85. end;
  86.  
  87. OnInit:
  88. // how many card requried to change to 1 New card
  89. .card_count = 2;
  90.  
  91. // zeny required for this process.
  92. .zeny_cost = 10000;
  93.  
  94. // list of card that cant be used to exchange/get.
  95. .forbidden_card$ = "|4142|4003|4069|";
  96.  
  97. // current card id range.
  98. setarray .card_id_range,4001,4500;
  99. .shop_npc_name$ = "card_merge_shop";
  100. end;
  101. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement