Jump to content
  • 0

Need help with this Npc


ahloi007

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  78
  • Reputation:   1
  • Joined:  10/15/12
  • Last Seen:  

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,{

	.@name$ = strcharinfo(0);			// Char Name
	.@item = 7227;						// Item ID
	.@amount = 1;						// Amount
	.@countitem = countitem( .@item* );	// Countitem
	
	if( .@countitem < 1 ) {
		mes "[ Cash Converter ]";
		mes "You don't have any ^0000FF"+ getitemname(.@item) +"^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(.@item) +"^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: "+ .@countitem +" x "+ getitemname( .@item ) +" to "+ ( .@countitem * .@amount ) +" Cash Point"+ (.@countitem * .@amount > 1 ? "s" : "") +"";
	next;
	if( select("- Convert","- Cancel") == 1 ) {
		progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP;
		delitem .@item,.@countitem;
		#CASHPOINTS = #CASHPOINTS + ( .@countitem * .@amount );
		message .@name$,"You have recieved "+ .@countitem * .@amount +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +" and a of Total: "+ #CASHPOINTS +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +"";
		mes "[ Cash Converter ]";
		mes "You have successfully exchanged.";
	}
	close;
}

 

  • Upvote 1
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

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 .@tcg_amount,6,30000;

 

Link to comment
Share on other sites

  • 1

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   3
  • Joined:  01/22/12
  • Last Seen:  

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,{

	.@name$ = strcharinfo(0);			// Char Name
	.@item = 7227;						// Item ID
	.@amount = 6;						// Item Quantity Required to Receive Cash
	.@cashpaid = 1;						// Cash amount to be paid
	.@countitem = countitem( .@item )/ .@amount;	// Countitem
	
	if( .@countitem < 1) {
		mes "[ Cash Converter ]";
		mes "You don't have any ^0000FF"+ getitemname(.@item) +"^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(.@item) +"^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: "+ .@countitem * .@amount +" x "+ getitemname( .@item ) +" to "+ ( .@countitem * .@cashpaid ) +" Cash Point"+ (.@countitem * .@cashpaid > 1 ? "s" : "") +"";
	next;
	if( select("- Convert","- Cancel") == 1 ) {
		progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP;
		delitem .@item,.@countitem * .@amount;
		#CASHPOINTS = #CASHPOINTS + ( .@countitem * .@cashpaid );
		message .@name$,"You have recieved "+ .@countitem * .@cashpaid +" 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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Try this one if you like, I made it.

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

	.@name$ = "[ CP Converter ]";			// Char Name
	.@item = 7227;					// Item ID
	.@amount = 6;					// Amount
	.@cash_points = 1;				// cash points amount

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

		mes .@name$;
		mes "To confirm this deal you wanted to exchanged (" + .@amount + ") " + getitemname( .@item ) + " into a total of " + ( .@tcg_amount / .@amount ) + " cash points.";
		next;
		if( select("Yes!","No") == 2 ) close;
			mes .@name$;
			mes "The convertion was successful!";
			delitem .@item, .@tcg_amount;
			.@temp_value = .@tcg_amount / .@amount;
			#CASHPOINTS += .@temp_value;
			dispbottom "You gained a total " + ( .@temp_value ) + " cash points.";
			end;
		
}

 

Edited by Radian
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   3
  • Joined:  01/22/12
  • Last Seen:  

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,{

	.@name$ = strcharinfo(0);			// Char Name
	.@item = 7227;						// Item ID
	.@amount = 6;						// Item Quantity Required to Receive Cash
	.@cashpaid = 1;						// Cash amount to be paid
	.@countitem = countitem( .@item )/ .@amount;	// Countitem
	
	if( .@item < .@amount) {
		mes "[ Cash Converter ]";
		mes "You don't have any ^0000FF"+ getitemname(.@item) +"^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(.@item) +"^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: "+ .@countitem +" x "+ getitemname( .@item ) +" to "+ ( .@countitem * .@cashpaid ) +" Cash Point"+ (.@countitem * .@cashpaid > 1 ? "s" : "") +"";
	next;
	if( select("- Convert","- Cancel") == 1 ) {
		progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP;
		delitem .@item,.@countitem * .@amount;
		#CASHPOINTS = #CASHPOINTS + ( .@countitem * .@cashpaid );
		message .@name$,"You have recieved "+ .@countitem * .@cashpaid +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +" and a of Total: "+ #CASHPOINTS +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +"";
		mes "[ Cash Converter ]";
		mes "You have successfully exchanged.";
	}
	close;
}
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  78
  • Reputation:   1
  • Joined:  10/15/12
  • Last Seen:  

On 9/7/2019 at 5:46 AM, 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,{

	.@name$ = strcharinfo(0);			// Char Name
	.@item = 7227;						// Item ID
	.@amount = 6;						// Item Quantity Required to Receive Cash
	.@cashpaid = 1;						// Cash amount to be paid
	.@countitem = countitem( .@item )/ .@amount;	// Countitem
	
	if( .@item < .@amount) {
		mes "[ Cash Converter ]";
		mes "You don't have any ^0000FF"+ getitemname(.@item) +"^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(.@item) +"^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: "+ .@countitem +" x "+ getitemname( .@item ) +" to "+ ( .@countitem * .@cashpaid ) +" Cash Point"+ (.@countitem * .@cashpaid > 1 ? "s" : "") +"";
	next;
	if( select("- Convert","- Cancel") == 1 ) {
		progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP;
		delitem .@item,.@countitem * .@amount;
		#CASHPOINTS = #CASHPOINTS + ( .@countitem * .@cashpaid );
		message .@name$,"You have recieved "+ .@countitem * .@cashpaid +" 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.

 

On 9/7/2019 at 5:12 AM, Radian said:

Try this one if you like, I made it.


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

	.@name$ = "[ CP Converter ]";			// Char Name
	.@item = 7227;					// Item ID
	.@amount = 6;					// Amount
	.@cash_points = 1;				// cash points amount

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

		mes .@name$;
		mes "To confirm this deal you wanted to exchanged (" + .@amount + ") " + getitemname( .@item ) + " into a total of " + ( .@tcg_amount / .@amount ) + " cash points.";
		next;
		if( select("Yes!","No") == 2 ) close;
			mes .@name$;
			mes "The convertion was successful!";
			delitem .@item, .@tcg_amount;
			.@temp_value = .@tcg_amount / .@amount;
			#CASHPOINTS += .@temp_value;
			dispbottom "You gained a total " + ( .@temp_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

Edited by ahloi007
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

your calculation parts are wrong.

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

	.@item = 7227;						// Item ID
	.@amount = 6;						// Amount
	.@countitem = (countitem(.@item) / .@amount);	// Countitem
	
	if( .@countitem < 1 ) {
		mes "[ Cash Converter ]";
		mes "You required at least "+.@amount+" ^0000FF"+ getitemname(.@item) +"^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(.@item) +"^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: "+ .@countitem +" x "+ getitemname( .@item ) +" to "+ ( .@countitem * .@amount ) +" Cash Point"+ (.@countitem * .@amount > 1 ? "s" : "") +"";
	next;
	if( select("- Convert","- Cancel") == 1 ) {
		progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP;
		delitem .@item,(.@countitem * .@amount);
		#CASHPOINTS = #CASHPOINTS + .@countitem;
		message strcharinfo(0),"You have recieved "+ .@countitem * .@amount +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +" and a of Total: "+ #CASHPOINTS +" Cash Point"+ (#CASHPOINTS > 1 ? "s" : "") +"";
		mes "[ Cash Converter ]";
		mes "You have successfully exchanged.";
	}
	close;
}
 

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  78
  • Reputation:   1
  • Joined:  10/15/12
  • Last Seen:  

On 9/7/2019 at 12:42 PM, Radian said:

change this part


input .@tcg_amount,0,30000;

into this


input .@tcg_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,{

	.@name$ = strcharinfo(0);			// Char Name
	.@item = 7227;						// Item ID
	.@amount = 6;						// Item Quantity Required to Receive Cash
	.@cashpaid = 1;						// Cash amount to be paid
	.@countitem = countitem( .@item )/ .@amount;	// Countitem
	
	if( .@countitem < 1) {
		mes "[ Cash Converter ]";
		mes "You don't have any ^0000FF"+ getitemname(.@item) +"^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(.@item) +"^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: "+ .@countitem * .@amount +" x "+ getitemname( .@item ) +" to "+ ( .@countitem * .@cashpaid ) +" Cash Point"+ (.@countitem * .@cashpaid > 1 ? "s" : "") +"";
	next;
	if( select("- Convert","- Cancel") == 1 ) {
		progressbar "0x11CC99",1; specialeffect2 EF_REMOVETRAP;
		delitem .@item,.@countitem * .@amount;
		#CASHPOINTS = #CASHPOINTS + ( .@countitem * .@cashpaid );
		message .@name$,"You have recieved "+ .@countitem * .@cashpaid +" 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!

Link to comment
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.

×
×
  • Create New...