Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- prontera,155,181,5 script Sample 757,{
- function ExchangeCard;
- function DetermineCard;
- // ExchangeCard( "<ItemID | Variable>",<Normal>,<MiniBoss>,<MVP> );
- ExchangeCard( "Zeny",5,500,5000 );
- close;
- function ExchangeCard {
- mes "Exchange Card into ^FF0000"+( ( atoi( getarg(0) ) )?getitemname( atoi( getarg(0) )):getarg(0) )+"^000000";
- mes " Rate : ";
- mes "^0000FFNormal - ^FF0000"+getarg(1)+" "+( ( atoi( getarg(0) ) )?"each":"Points" )+"^000000";
- mes "^0000FFMiniBoss - ^FF0000"+getarg(2)+" "+( ( atoi( getarg(0) ) )?"each":"Points" )+"^000000";
- mes "^0000FFMVP Boss - ^FF0000"+getarg(3)+" "+( ( atoi( getarg(0) ) )?"each":"Points" )+"^000000";
- for( set .@c,4001; .@c <= 4453; set .@c,.@c + 1 )
- if( countitem( .@c ) ){
- set .@CardList[ getarraysize( .@CardList ) ],.@c;
- set .@Menu$,.@Menu$ + getitemname( .@c )+":";
- }
- next;
- if( .@Menu$ == "" || !getarraysize( .@CardList ) ){
- mes "You didnt have any Card to exchange now.";
- }else{
- set .@i,select( .@Menu$ ) - 1;
- mes "^0000FF"+getitemname( .@CardList[.@i] )+" : ^FF0000"+getarg( DetermineCard( .@CardList[.@i] ) )+" "+( ( atoi( getarg(0) ) )?getitemname( atoi( getarg(0) ) ):getarg(0) )+"^000000";
- mes "Available : "+countitem( .@CardList[.@i] );
- input .@Amount,0,countitem( .@CardList[.@i] );
- if( !.@Amount ){
- mes "Deal Cancelled";
- }else{
- set .@Gained,( .@Amount * getarg( DetermineCard( .@CardList[.@i] ) ) );
- mes .@Amount+" "+getitemname( .@CardList[.@i] )+" traded into "+.@Gained+" "+( ( atoi( getarg(0) ) )?getitemname( atoi( getarg(0) ) ):getarg(0) );
- delitem .@CardList[.@i],.@Amount;
- if( atoi( getarg(0) ) )
- getitem atoi( getarg(0) ),.@Gained;
- else
- set getd( getarg(0) ),getd( getarg(0) ) + .@Gained;;
- }
- }
- close;
- }
- // Only Required to Edit MVP / MiniBoss / Restricted Card Array ID ...Max ~128 Card each.
- function DetermineCard {
- // Restricted Card
- setarray .@CardLists,4001,4002,4003,4004;
- for( set .@i,0; .@i < getarraysize( .@CardLists ); set .@i,.@i + 1 )
- if( getarg(0) == .@CardLists[.@i] ){
- mes "This Card is Forbidden.";
- close;
- }
- // MVP Card
- setarray .@CardLists,4342,4359,4357,4361,4363,4365,4367;
- for( set .@i,0; .@i < getarraysize( .@CardLists ); set .@i,.@i + 1 )
- if( getarg(0) == .@CardLists[.@i] )
- return 3;
- // MiniBoss
- setarray .@CardLists,4197,4211,4201,4188,4183,4184;
- for( set .@i,0; .@i < getarraysize( .@CardLists ); set .@i,.@i + 1 )
- if( getarg(0) == .@CardLists[.@i] )
- return 2;
- // Others
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment