Jump to content
  • 0
Sign in to follow this  
Begin

Card Shredder Edit

Question

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.

Edited by AnnieRuru
split topic from http://herc.ws/board/topic/15934-card-shredder/

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

split topic from http://herc.ws/board/topic/15934-card-shredder/

 

@Begin

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

Share this post


Link to post
Share on other sites
  • 0

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

Edited by Begin

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.