Card Shredder Edit

Begin

New member
Messages
85
Points
0
Hello Ms. Annie,

If possible, a fixed value for Normal Cards and MVP Cards and an option "Input how many cards you want to shred".

Normal Cards = 1 Poring Coin

MVP Cards = 3 Poring Coins

So we can use the Poring Coins for Item Requirements or other quest.

Thank you, Ms. Annie.

 
Last edited by a moderator:
split topic from http://herc.ws/board/topic/15934-card-shredder/

@Begin

Code:
prontera,155,185,4	script	Card trader	2_VENDING_MACHINE1,{
	mes "[Card trader]";
	mes "Please select the card you wish to trade.";
	getinventorylist;
	for ( .@i = 0; .@i < @inventorylist_count; ++.@i ) {
		if ( getiteminfo( @inventorylist_id[.@i], ITEMINFO_TYPE ) == IT_CARD ) {
			.@menu$ += getitemname( @inventorylist_id[.@i] ) +":";
			.@cardid[.@c++] = @inventorylist_id[.@i];
		}
	}
	.@menu$ += "No Card - Close";
	next;
	.@s = select( .@menu$ ) -1;
	if ( .@s == .@c ) close;
	while ( .@cardid[.@s] != .mvpcardid[.@i] && .@i < .mvpcards ) { ++.@i; }
	if ( .@i < .mvpcards )
		.@rate = 3;
	else
		.@rate = 1;
	mes "[Card trader]";
	dispbottom countitem( .@cardid[.@s] ) +"";
	if ( countitem( .@cardid[.@s] ) > 1 ) {
		mes "Input how many you want to trade ?";
		next;
		input .@amount, 0, countitem( .@cardid[.@s] );
		if ( !.@amount ) close;
		mes "[Card trader]";
		mes "Are you sure you want to trade";
		mes .@amount +"x "+ getitemname( .@cardid[.@s] );
		mes " for "+( .@rate * .@amount )+" Poring Coins ?";
	}
	else {
		.@amount = 1;
		mes "Are you sure you want to trade a "+ getitemname( .@cardid[.@s] ) +" for "+ .@rate +" Poring Coins ?";
	}
	next;	
	if ( select ( "Yes.", "No" ) == 2 ) close;
	delitem .@cardid[.@s], .@amount;
	getitem Poring_Coin, .@rate * .@amount;
	close;
OnInit:
	.mvpcards = query_sql("select item_db.id from item_db right join mob_db on item_db.id = mob_db.dropcardid where mexp > 0 and type = 6 group by name_japanese;", .mvpcardid);
	end;
}
simple script
although I wanted to do page by page ... but when realize MAX_INVENTORY is just 100, while menu string limit is 2047,
means need 20 string length of each card item name to crash the client ... so don't need to do page by page

 
Last edited by a moderator:
Thank you very much, Ms. Annie! I won't forget you. I thought that I'm already requesting for too much but I just read your word "simple" script. I think you can make that in just 5 minutes! Haha

 
Last edited by a moderator:
Back
Top