• 0
Sign in to follow this  
ahloi007

Need help with this Npc

Question

Hi, can I know how to edit this Cash Converter Npc at below?

I want to make it like 6 TCG card to 1 cash point..

But I have tried several times to edit it but the Cash Point amount give out doesn't get what I want.

Can please point out where should I need to edit in details? Because I'm still new to here.

*lol

prt_in,44,100,3	script	CP Converter	532,{

	[email protected]$ = strcharinfo(0);			// Char Name
	[email protected] = 7227;						// Item ID
	[email protected] = 1;						// Amount
	[email protected] = countitem( [email protected]* );	// Countitem
	
	if( [email protected] < 1 ) {
		mes "[ Cash Converter ]";
		mes "You don't have any ^0000FF"+ getitemname([email protected]) +"^000000 in your Inventory to be exchanged for Cash Points.";
		mes "Please come back to me if you have it already.";
		close;
	}

	mes "[ Cash Converter ]";
	mes rand(2) ? ""+callfunc("F_Hi")+" I'm Cash Converter, of Prontera Rune-Midgard City." 
	: ""+callfunc("F_Hi")+" I can able to exchange your ^0000FF"+ getitemname([email protected]) +"^000000 to Cash Points.";
	mes " ";
	mes "What would you like to do?";
	next;
	mes "[ Cash Converter ]";
	mes "^FF0000Information:^000000";
	mes "^777777 -------------------- ^000000";
	mes "Exchange Rate: "+ [email protected] +" x "+ getitemname( [email protected] ) +" to "+ ( [email protected] * [email protected] ) +" Cash Point"+ ([email protected] * [email protected] > 1 ? "s" : "") +"";
	next;
	if( select("- Convert","- Cancel") == 1 ) {
		progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP;
		delitem [email protected],[email protected];
		#CASHPOINTS = #CASHPOINTS + ( [email protected] * [email protected] );
		message [email protected]$,"You have recieved "+ [email protected] * [email protected] +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +" and a of Total: "+ #CASHPOINTS +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +"";
		mes "[ Cash Converter ]";
		mes "You have successfully exchanged.";
	}
	close;
}

 

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 1
2 hours ago, ahloi007 said:

Sir, this npc function well but can you make it like auto detect the amount of TCG card and straight away convert it into cash point instead of key in the amount? Because just now I have tried it, even I got 1 TCG it still can convert into cash point and obtain 0 cash point but if I key in the amount of 6 TCG card it function well. Or can please change it into cash amount that need to be exchange? I scare later those people got confuse when using this npc xD

change this part

input .@tcg_amount,0,30000;

into this

input [email protected]_amount,6,30000;

 

Share this post


Link to post
Share on other sites
  • 1
16 hours ago, ahloi007 said:

Thanks sir, but the npc function still remain the same 1 TCG =1 cash point not 6 TCG =1 cash point.

But I still like this npc as well because easy for player use.

Sorry for the delay in answering, I was at work ^^

Try this one now:

prt_in,44,100,3	script	CP Converter	532,{

	[email protected]$ = strcharinfo(0);			// Char Name
	[email protected] = 7227;						// Item ID
	[email protected] = 6;						// Item Quantity Required to Receive Cash
	[email protected] = 1;						// Cash amount to be paid
	[email protected] = countitem( [email protected] )/ [email protected];	// Countitem
	
	if( [email protected] < 1) {
		mes "[ Cash Converter ]";
		mes "You don't have any ^0000FF"+ getitemname([email protected]) +"^000000 in your Inventory to be exchanged for Cash Points.";
		mes "Please come back to me if you have it already.";
		close;
	}

	mes "[ Cash Converter ]";
	mes rand(2) ? ""+callfunc("F_Hi")+" I'm Cash Converter, of Prontera Rune-Midgard City." 
	: ""+callfunc("F_Hi")+" I can able to exchange your ^0000FF"+ getitemname([email protected]) +"^000000 to Cash Points.";
	mes " ";
	mes "What would you like to do?";
	next;
	mes "[ Cash Converter ]";
	mes "^FF0000Information:^000000";
	mes "^777777 -------------------- ^000000";
	mes "Exchange Rate: "+ [email protected] * [email protected] +" x "+ getitemname( [email protected] ) +" to "+ ( [email protected] * [email protected] ) +" Cash Point"+ ([email protected] * [email protected] > 1 ? "s" : "") +"";
	next;
	if( select("- Convert","- Cancel") == 1 ) {
		progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP;
		delitem [email protected],[email protected] * [email protected];
		#CASHPOINTS = #CASHPOINTS + ( [email protected] * [email protected] );
		message [email protected]$,"You have recieved "+ [email protected] * [email protected] +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +" and a of Total: "+ #CASHPOINTS +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +"";
		mes "[ Cash Converter ]";
		mes "You have successfully exchanged.";
	}
	close;
}

https://prnt.sc/p34xca

https://prnt.sc/p34xhj

https://prnt.sc/p34xjo

https://prnt.sc/p34xoe

Share this post


Link to post
Share on other sites
  • 0

Try this one if you like, I made it.

prt_in,44,100,3	script	CP Converter	532,{

	[email protected]$ = "[ CP Converter ]";			// Char Name
	[email protected] = 7227;					// Item ID
	[email protected] = 6;					// Amount
	[email protected]_points = 1;				// cash points amount

	mes [email protected]$;
	mes "Would you like to convert your " + getitemname( [email protected] ) + " into cash points?";
	next;
	if( select("Yes Convert","No I dont want to.") == 2 ) close;
		input [email protected]_amount,0,30000;
		if( [email protected]_amount ) end;
		if( countitem([email protected]) < [email protected]_amount ) {
			mes [email protected]$;
			mes "Im sorry but you dont have enough " + getitemname( [email protected] ) + " to exchange.";
			close;
		}

		mes [email protected]$;
		mes "To confirm this deal you wanted to exchanged (" + [email protected] + ") " + getitemname( [email protected] ) + " into a total of " + ( [email protected]_amount / [email protected] ) + " cash points.";
		next;
		if( select("Yes!","No") == 2 ) close;
			mes [email protected]$;
			mes "The convertion was successful!";
			delitem [email protected], [email protected]_amount;
			[email protected]_value = [email protected]_amount / [email protected];
			#CASHPOINTS += [email protected]_value;
			dispbottom "You gained a total " + ( [email protected]_value ) + " cash points.";
			end;
		
}

 

Edited by Radian

Share this post


Link to post
Share on other sites
  • 0

The colleague above already answered, but here is the same npc, with the modification that requested.

prt_in,44,100,3	script	CP Converter	532,{

	[email protected]$ = strcharinfo(0);			// Char Name
	[email protected] = 7227;						// Item ID
	[email protected] = 6;						// Item Quantity Required to Receive Cash
	[email protected] = 1;						// Cash amount to be paid
	[email protected] = countitem( [email protected] )/ [email protected];	// Countitem
	
	if( [email protected] < [email protected]) {
		mes "[ Cash Converter ]";
		mes "You don't have any ^0000FF"+ getitemname([email protected]) +"^000000 in your Inventory to be exchanged for Cash Points.";
		mes "Please come back to me if you have it already.";
		close;
	}

	mes "[ Cash Converter ]";
	mes rand(2) ? ""+callfunc("F_Hi")+" I'm Cash Converter, of Prontera Rune-Midgard City." 
	: ""+callfunc("F_Hi")+" I can able to exchange your ^0000FF"+ getitemname([email protected]) +"^000000 to Cash Points.";
	mes " ";
	mes "What would you like to do?";
	next;
	mes "[ Cash Converter ]";
	mes "^FF0000Information:^000000";
	mes "^777777 -------------------- ^000000";
	mes "Exchange Rate: "+ [email protected] +" x "+ getitemname( [email protected] ) +" to "+ ( [email protected] * [email protected] ) +" Cash Point"+ ([email protected] * [email protected] > 1 ? "s" : "") +"";
	next;
	if( select("- Convert","- Cancel") == 1 ) {
		progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP;
		delitem [email protected],[email protected] * [email protected];
		#CASHPOINTS = #CASHPOINTS + ( [email protected] * [email protected] );
		message [email protected]$,"You have recieved "+ [email protected] * [email protected] +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +" and a of Total: "+ #CASHPOINTS +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +"";
		mes "[ Cash Converter ]";
		mes "You have successfully exchanged.";
	}
	close;
}

Share this post


Link to post
Share on other sites
  • 0
4 hours ago, nomade said:

The colleague above already answered, but here is the same npc, with the modification that requested.

prt_in,44,100,3	script	CP Converter	532,{

	[email protected]$ = strcharinfo(0);			// Char Name
	[email protected] = 7227;						// Item ID
	[email protected] = 6;						// Item Quantity Required to Receive Cash
	[email protected] = 1;						// Cash amount to be paid
	[email protected] = countitem( [email protected] )/ [email protected];	// Countitem
	
	if( [email protected] < [email protected]) {
		mes "[ Cash Converter ]";
		mes "You don't have any ^0000FF"+ getitemname([email protected]) +"^000000 in your Inventory to be exchanged for Cash Points.";
		mes "Please come back to me if you have it already.";
		close;
	}

	mes "[ Cash Converter ]";
	mes rand(2) ? ""+callfunc("F_Hi")+" I'm Cash Converter, of Prontera Rune-Midgard City." 
	: ""+callfunc("F_Hi")+" I can able to exchange your ^0000FF"+ getitemname([email protected]) +"^000000 to Cash Points.";
	mes " ";
	mes "What would you like to do?";
	next;
	mes "[ Cash Converter ]";
	mes "^FF0000Information:^000000";
	mes "^777777 -------------------- ^000000";
	mes "Exchange Rate: "+ [email protected] +" x "+ getitemname( [email protected] ) +" to "+ ( [email protected] * [email protected] ) +" Cash Point"+ ([email protected] * [email protected] > 1 ? "s" : "") +"";
	next;
	if( select("- Convert","- Cancel") == 1 ) {
		progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP;
		delitem [email protected],[email protected] * [email protected];
		#CASHPOINTS = #CASHPOINTS + ( [email protected] * [email protected] );
		message [email protected]$,"You have recieved "+ [email protected] * [email protected] +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +" and a of Total: "+ #CASHPOINTS +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +"";
		mes "[ Cash Converter ]";
		mes "You have successfully exchanged.";
	}
	close;
}

Thanks sir, but the npc function still remain the same 1 TCG =1 cash point not 6 TCG =1 cash point.

But I still like this npc as well because easy for player use.

Edited by ahloi007

Share this post


Link to post
Share on other sites
  • 0
4 hours ago, Radian said:

Try this one if you like, I made it.

prt_in,44,100,3	script	CP Converter	532,{

	[email protected]$ = "[ CP Converter ]";			// Char Name
	[email protected] = 7227;					// Item ID
	[email protected] = 6;					// Amount
	[email protected]_points = 1;				// cash points amount

	mes [email protected]$;
	mes "Would you like to convert your " + getitemname( [email protected] ) + " into cash points?";
	next;
	if( select("Yes Convert","No I dont want to.") == 2 ) close;
		input [email protected]_amount,0,30000;
		if( [email protected]_amount ) end;
		if( countitem([email protected]) < [email protected]_amount ) {
			mes [email protected]$;
			mes "Im sorry but you dont have enough " + getitemname( [email protected] ) + " to exchange.";
			close;
		}

		mes [email protected]$;
		mes "To confirm this deal you wanted to exchanged (" + [email protected] + ") " + getitemname( [email protected] ) + " into a total of " + ( [email protected]_amount / [email protected] ) + " cash points.";
		next;
		if( select("Yes!","No") == 2 ) close;
			mes [email protected]$;
			mes "The convertion was successful!";
			delitem [email protected], [email protected]_amount;
			[email protected]_value = [email protected]_amount / [email protected];
			#CASHPOINTS += [email protected]_value;
			dispbottom "You gained a total " + ( [email protected]_value ) + " cash points.";
			end;
		
}

 

Sir, this npc function well but can you make it like auto detect the amount of TCG card and straight away convert it into cash point instead of key in the amount? Because just now I have tried it, even I got 1 TCG it still can convert into cash point and obtain 0 cash point but if I key in the amount of 6 TCG card it function well. Or can please change it into cash amount that need to be exchange? I scare later those people got confuse when using this npc xD

 

Please let me know if you can't understand what I'm saying, sorry for my bad english

Share this post


Link to post
Share on other sites
  • 0

your calculation parts are wrong.

prt_in,44,100,3	script	CP Converter	532,{

	[email protected] = 7227;						// Item ID
	[email protected] = 6;						// Amount
	[email protected] = (countitem([email protected]) / [email protected]);	// Countitem
	
	if( [email protected] < 1 ) {
		mes "[ Cash Converter ]";
		mes "You required at least "[email protected]+" ^0000FF"+ getitemname([email protected]) +"^000000 in your Inventory to be exchanged for Cash Points.";
		mes "Please come back to me if you have it already.";
		close;
	}

	mes "[ Cash Converter ]";
	mes rand(2) ? ""+callfunc("F_Hi")+" I'm Cash Converter, of Prontera Rune-Midgard City." 
	: ""+callfunc("F_Hi")+" I can able to exchange your ^0000FF"+ getitemname([email protected]) +"^000000 to Cash Points.";
	mes " ";
	mes "What would you like to do?";
	next;
	mes "[ Cash Converter ]";
	mes "^FF0000Information:^000000";
	mes "^777777 -------------------- ^000000";
	mes "Exchange Rate: "+ [email protected] +" x "+ getitemname( [email protected] ) +" to "+ ( [email protected] * [email protected] ) +" Cash Point"+ ([email protected] * [email protected] > 1 ? "s" : "") +"";
	next;
	if( select("- Convert","- Cancel") == 1 ) {
		progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP;
		delitem [email protected],([email protected] * [email protected]);
		#CASHPOINTS = #CASHPOINTS + [email protected];
		message strcharinfo(0),"You have recieved "+ [email protected] * [email protected] +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +" and a of Total: "+ #CASHPOINTS +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +"";
		mes "[ Cash Converter ]";
		mes "You have successfully exchanged.";
	}
	close;
}
 

 

Share this post


Link to post
Share on other sites
  • 0
On 9/7/2019 at 12:42 PM, Radian said:

change this part

input .@tcg_amount,0,30000;

into this

input [email protected]_amount,6,30000;

 

Yes it's work! xD thanks ya!

20 hours ago, nomade said:

Sorry for the delay in answering, I was at work ^^

Try this one now:

prt_in,44,100,3	script	CP Converter	532,{

	[email protected]$ = strcharinfo(0);			// Char Name
	[email protected] = 7227;						// Item ID
	[email protected] = 6;						// Item Quantity Required to Receive Cash
	[email protected] = 1;						// Cash amount to be paid
	[email protected] = countitem( [email protected] )/ [email protected];	// Countitem
	
	if( [email protected] < 1) {
		mes "[ Cash Converter ]";
		mes "You don't have any ^0000FF"+ getitemname([email protected]) +"^000000 in your Inventory to be exchanged for Cash Points.";
		mes "Please come back to me if you have it already.";
		close;
	}

	mes "[ Cash Converter ]";
	mes rand(2) ? ""+callfunc("F_Hi")+" I'm Cash Converter, of Prontera Rune-Midgard City." 
	: ""+callfunc("F_Hi")+" I can able to exchange your ^0000FF"+ getitemname([email protected]) +"^000000 to Cash Points.";
	mes " ";
	mes "What would you like to do?";
	next;
	mes "[ Cash Converter ]";
	mes "^FF0000Information:^000000";
	mes "^777777 -------------------- ^000000";
	mes "Exchange Rate: "+ [email protected] * [email protected] +" x "+ getitemname( [email protected] ) +" to "+ ( [email protected] * [email protected] ) +" Cash Point"+ ([email protected] * [email protected] > 1 ? "s" : "") +"";
	next;
	if( select("- Convert","- Cancel") == 1 ) {
		progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP;
		delitem [email protected],[email protected] * [email protected];
		#CASHPOINTS = #CASHPOINTS + ( [email protected] * [email protected] );
		message [email protected]$,"You have recieved "+ [email protected] * [email protected] +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +" and a of Total: "+ #CASHPOINTS +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +"";
		mes "[ Cash Converter ]";
		mes "You have successfully exchanged.";
	}
	close;
}

https://prnt.sc/p34xca

https://prnt.sc/p34xhj

https://prnt.sc/p34xjo

https://prnt.sc/p34xoe

Wow! Finally it's work! Thanks ya!

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.   Paste as plain text instead

  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