• 0
garro

(NPC) help refiner+10

Question

 

Good morning I have this npc of refiner that I found, I have modified it a bit so that it charges X item and X amount of points but at the time of collecting the points even though I do not have the refina sure, I need help in that part that you copper points to be able to refine insurance, thanks

refin.txt

Share this post


Link to post
Share on other sites

2 answers to this question

  • 0
prontera,151,172,4	script	loco	813,{
	#RRG = 10000;
	getitem Poring_Coin, 1000;
	disable_items;
	mes .npcname$;
	mesf "Hello! ^0000CD%s^000000 I am the best blacksmith in all Zone Zero RO, I can refine without breaking up to +10", strcharinfo(PC_NAME);
	mesf "To use my service you need: %d Hourly Points and %d Poring Coin", .Houly_Points_needed, .Poring_Coin_needed;
	mes "What part of your equipment do you want to refine?";
	next;
	for ( .@i = 1; .@i <= 10; ++.@i )
		.@menu$ += getequipname(.@i) +":";
	.@s = select(.@menu$);
	if ( !getequipisequiped(.@s) ) {
		mes "Please put the equipment first";
		emotion e_swt;
		close;
	}
	if ( !getequipisenableref(.@s) ) {
		mes "This part of equipment cannot be refine";
		close;
	}
	if ( getequiprefinerycnt(.@s) >= .maxrefine ) {
		mes "this item already refined at the maximum level";
		close;
	}
	mes .npcname$;
	mes "Refinement [+10].";
	mesf "1 Refine = %d Hourly Points.", .Houly_Points_needed;
	mesf "You have %d Hourly Points", #RRG;
	mesf "1 Refine = %d Poring Coin", .Poring_Coin_needed;
	mesf "You have %d Poring Coin", countitem(Poring_Coin);
	mes "How much do you want to refine your item?";
	next;
	input .@amount, 0, .maxrefine - getequiprefinerycnt(.@s);
	if ( .@amount <= 0 ) {
		mes "See ya";
		close;
	}
	mes .npcname$;
	mesf "Do you want to refine %d times", .@amount;
	mesf "for %d Hourly Points and %d Poring Coin?", .Houly_Points_needed * .@amount, .Poring_Coin_needed * .@amount;
	next;
	if ( select ("Yes","No") == 2 ) close;
	mes .npcname$;
	if ( #RRG < .Houly_Points_needed * [email protected] ) {
		mes "you don't have enough hourly points";
		close;
	}
	if ( countitem(Poring_Coin) < .Poring_Coin_needed * .@amount ) {
		mes "you don't have enough Poring Coin";
		close;
	}
	if ( getequiprefinerycnt(.@s) + .@amount > .maxrefine ) {
		mes "you can't refine over +10";
		close;
	}
	#RRG -= .Houly_Points_needed * [email protected];
	delitem Poring_Coin, .Poring_Coin_needed * .@amount;
	successrefitem .@s, .@amount;
	npctalk "See you !! Grax.";
	mes "See you !! Grax.";
	close;
OnInit:
	.npcname$ = "[Refiner]";
	.maxrefine = 10;
	.Houly_Points_needed = 5;
	.Poring_Coin_needed = 1;
	end;
}

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now