yuhsing

Untitled

May 18th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1.  
  2. prontera,155,181,5 script Sample 757,{
  3. function ExchangeCard;
  4. function DetermineCard;
  5.  
  6. // ExchangeCard( "<ItemID | Variable>",<Normal>,<MiniBoss>,<MVP> );
  7. ExchangeCard( "Zeny",5,500,5000 );
  8. close;
  9.  
  10. function ExchangeCard {
  11. mes "Exchange Card into ^FF0000"+( ( atoi( getarg(0) ) )?getitemname( atoi( getarg(0) )):getarg(0) )+"^000000";
  12. mes " Rate : ";
  13. mes "^0000FFNormal - ^FF0000"+getarg(1)+" "+( ( atoi( getarg(0) ) )?"each":"Points" )+"^000000";
  14. mes "^0000FFMiniBoss - ^FF0000"+getarg(2)+" "+( ( atoi( getarg(0) ) )?"each":"Points" )+"^000000";
  15. mes "^0000FFMVP Boss - ^FF0000"+getarg(3)+" "+( ( atoi( getarg(0) ) )?"each":"Points" )+"^000000";
  16. for( set .@c,4001; .@c <= 4453; set .@c,.@c + 1 )
  17. if( countitem( .@c ) ){
  18. set .@CardList[ getarraysize( .@CardList ) ],.@c;
  19. set .@Menu$,.@Menu$ + getitemname( .@c )+":";
  20. }
  21. next;
  22. if( .@Menu$ == "" || !getarraysize( .@CardList ) ){
  23. mes "You didnt have any Card to exchange now.";
  24. }else{
  25. set .@i,select( .@Menu$ ) - 1;
  26. mes "^0000FF"+getitemname( .@CardList[.@i] )+" : ^FF0000"+getarg( DetermineCard( .@CardList[.@i] ) )+" "+( ( atoi( getarg(0) ) )?getitemname( atoi( getarg(0) ) ):getarg(0) )+"^000000";
  27. mes "Available : "+countitem( .@CardList[.@i] );
  28. input .@Amount,0,countitem( .@CardList[.@i] );
  29. if( !.@Amount ){
  30. mes "Deal Cancelled";
  31. }else{
  32. set .@Gained,( .@Amount * getarg( DetermineCard( .@CardList[.@i] ) ) );
  33. mes .@Amount+" "+getitemname( .@CardList[.@i] )+" traded into "+.@Gained+" "+( ( atoi( getarg(0) ) )?getitemname( atoi( getarg(0) ) ):getarg(0) );
  34. delitem .@CardList[.@i],.@Amount;
  35. if( atoi( getarg(0) ) )
  36. getitem atoi( getarg(0) ),.@Gained;
  37. else
  38. set getd( getarg(0) ),getd( getarg(0) ) + .@Gained;;
  39. }
  40. }
  41. close;
  42. }
  43.  
  44. // Only Required to Edit MVP / MiniBoss / Restricted Card Array ID ...Max ~128 Card each.
  45. function DetermineCard {
  46. // Restricted Card
  47. setarray .@CardLists,4001,4002,4003,4004;
  48. for( set .@i,0; .@i < getarraysize( .@CardLists ); set .@i,.@i + 1 )
  49. if( getarg(0) == .@CardLists[.@i] ){
  50. mes "This Card is Forbidden.";
  51. close;
  52. }
  53.  
  54. // MVP Card
  55. setarray .@CardLists,4342,4359,4357,4361,4363,4365,4367;
  56. for( set .@i,0; .@i < getarraysize( .@CardLists ); set .@i,.@i + 1 )
  57. if( getarg(0) == .@CardLists[.@i] )
  58. return 3;
  59.  
  60. // MiniBoss
  61. setarray .@CardLists,4197,4211,4201,4188,4183,4184;
  62. for( set .@i,0; .@i < getarraysize( .@CardLists ); set .@i,.@i + 1 )
  63. if( getarg(0) == .@CardLists[.@i] )
  64. return 2;
  65.  
  66. // Others
  67. return 1;
  68. }
  69.  
  70. }
Advertisement
Add Comment
Please, Sign In to add comment