Jump to content
  • 0

Refine Ticket Custom


Radian

Question


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

Can someone make me this kind refine function?

 

example :

  • Input desired refine.
  • If refine level is beyond +10 it will consume x2 refine ticket ( 11 ~ 20 ) then from ( 21 ~ 31 ) it will consume 5x Refine Ticket.
  • If refine is Denied. Ticket returns to the player. ( ex : player accidentally pick the item that has the maximum refine )
  • Refine ticket usable. ( I use Mithril Coin as Refine Ticket ) 
Link to comment
Share on other sites

11 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Yea. it works like this

 

1 Mithril Coin consumed > Selection of what item will be refined > Cancel > 1 Mithril Coin will be refunded.

 

 

Update :

 

Everytime i refined an item for example i stop at +20 the npc will look like this.

1. http://i.imgur.com/5Y8lu0e.jpg

2. http://i.imgur.com/D3SeiLr.jpg

 

prontera,100,100,5	script	ticket_refine	100,{

	mes .npc$;
	mes "Which item would you like to refine?";
	next;
	while( .@a++ <= .e_len ) {
		.@b = .@a -1;
		if( .eqpl[ .@b ] ) {
			if( getequipid( .@a ) > -1 )
				 .@menu$ = .@menu$ + .eqp$[ .@b ]+" - [^0000FF"+getitemname( getequipid( .@a ) )+"^000000]:";
			else .@menu$ = .@menu$ + "^adb4be"+.eqp$[ .@b ]+" - [Empty]^000000:";
		} else   .@menu$ = .@menu$ + ":";
	}
		
	.@menu = select( .@menu$ );
	.@eq_loc = .eqpl[ .@menu -1 ];
	.@eq_itm = getequipid( .@eq_loc );
	.@eq_ref = getequiprefinerycnt( .@eq_loc );
	if( .@eq_itm <= 0 ) {
		mes .npc$;
		mes "Hmm, I don't think you have anything equipped there.";
		close;
	}
	
	if( !getequipisenableref( .@eq_loc ) && .chk_rf_able ) {
		mes .npc$;
		mes "Hmm, this item doesn't seem to be refine-able.";
		close;
	}
	
	if( .@eq_ref < .ref_cap ) {
		mes .npc$;
		mes "Sorry but I don't refine items that so weak. Come back when it's at least +"+.ref_cap+".";
		close;
	}

	mes .npc$;
	mes "Input desired refine.";
	next;
	switch( input( .@ds_ref, (( .@eq_ref < .min_ref )? .min_ref : .@eq_ref+1 ), .max_ref ) ) {
		case -1:
			mes .npc$;
			if( .@eq_ref < .min_ref )
				mes "I do not refine items lower than "+.min_ref+".";
			else
				mes "This item can not be refined lower than "+(.@eq_ref+1)+".";
			close;
		
		case 1:
			mes .npc$;
			mes "Items can not be refined above "+.max_ref+"!";
			close;
			
			
		default:
	}
	
	.@nw_ref = .@ds_ref - .@eq_ref;
	
	for( .@c = .@eq_ref; .@c < .c_len && .@c < .@ds_ref; .@c++ )
		.@tk_cost = .@tk_cost + .cost[.@c];
			
	mes .npc$;
	mes "This new refine will cost you "+.@tk_cost+" "+getitemname(.tk_id)+"(s). Do you accept?";
	next;
	if( select("Yes:No") == 2 ) {
		mes .npc$; mes "Alright, thanks anyways, goodbye!";
		close;
	}
	
	if( .chk_rf_prct ) {
		mes .npc$;
		mes "There is a chance that this item will break! Do you still accept?";
		next;
		if( select("Yes:No") == 2 ) {
			mes .npc$; mes "Alright, that's probably for the best!";
			close;
		}
	}
	
	if( countitem(.tk_id) < .@tk_cost ) {
		mes .npc$;
		mes "I'm sorry but you don't have enough tickets for that.";
		close;
	}
	
	if( .@eq_itm != getequipid( .@eq_loc ) || .@eq_ref != getequiprefinerycnt( .@eq_loc ) ) {
		mes .npc$;
		mes "Something went wrong! Aborting!";
		close;
	}
	
	if( .chk_rf_gtim ) {
		.@card1 = getequipcardid( .@eq_loc, 0 );
		.@card2 = getequipcardid( .@eq_loc, 1 );
		.@card3 = getequipcardid( .@eq_loc, 2 );
		.@card4 = getequipcardid( .@eq_loc, 3 );
	}
	
	while( (.@tmp_ref = getequiprefinerycnt( .@eq_loc )) < .@ds_ref && .@tmp_ref < .c_len ) {
		if( .chk_rf_prct && getequippercentrefinery(.@eq_loc) <= rand(101) ) {
			failedrefitem( .@eq_loc );
			mes "Ahh! I'm soooo sorry but your item broke!";
			close;
		}
		if( !.@h ) {
			successrefitem( .@eq_loc );
			if( .chk_rf_gtim ) {
				delequip(.@eq_loc);
				getitem2 .@eq_itm, 1, 1, .@ds_ref, 0, .@card1, .@card2, .@card3, .@card4;
				equip(.@eq_itm);
				.@h = 1;
			}
		}
		.@tmp_ref2 = getequiprefinerycnt( .@eq_loc );
		if( .@tmp_ref == .@tmp_ref2 ) break;
		delitem .tk_id, .cost[ .@tmp_ref ];
	}
	
	mes .npc$;
	mes "All done thanks for stopping bye!.";
	close;
		
OnInit:
	.npc$ = "[ Ticket Refiner ]";
	.tk_id = 674;

	setarray .cost, // Ticket cost per level.
		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1~10
		2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 11~20
		5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5; // 21~31
			 
	.ref_cap = 10; // An item must be at least this refine before it can be refined by this npc. 0 disabled.
	.max_ref = 31; // This is the max refine. 0 disabled.
	.min_ref = 10; // This is the min refine. 0 disabled.
	.chk_rf_able = 1; // Check if the item is refine-able? 0 disabled.
	.chk_rf_prct = 0; // Check refine-able percentages? 0 disabled.
	.chk_rf_gtim = 0; // The npc will switch to getitem if the refine cap is too high. 0 disabled.
	
	setarray .eqp$,
		"Upper Headgear", "Armor", "Left Hand", "Right Hand", "Garment",
		"Shoes", "Accessory1", "Accessory2", "Mid Headgear", "Low Headgear";
		
	setarray .eqpl, //Set EQI 0 to disable slot.
		EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT,
		EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW;
		
	.e_len = getarraysize( .eqp$ );
	.c_len = getarraysize( .cost );
}

About the other thing in the item script just do...

doevent "ticket_refine::OnGoNPCEvent"; getitem 674, 1;
Link to comment
Share on other sites


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

Anyone?


@bump

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Try this?

-- moved --
Link to comment
Share on other sites


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

Try this?

 

Hi is it possible to use a Consumable item than the NPC? or make it a function and insert on Mithril coin?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Replace:

prontera,100,100,5	script	ticket_refine	100,{

With:

-	script	ticket_refine	-1,{
	OnGoNPCEvent:

In the itemscript put:

doevent "ticket_refine::OnGoNPCEvent";
Link to comment
Share on other sites


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

 

Replace:

prontera,100,100,5	script	ticket_refine	100,{

With:

-	script	ticket_refine	-1,{
	OnGoNPCEvent:

In the itemscript put:

doevent "ticket_refine::OnGoNPCEvent";

 

Thanks for the response. will try it now..

 

Update :

 

It is working perfectly.. however is it possible that when player cancel the refine. the Mithril coin will return?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

 

Update :

 

It is working perfectly.. however is it possible that when player cancel the refine. the Mithril coin will return?

 

 

You put it on the mithril coin? And made it usable? because the refine doesn't take the mithril coins unless the player accepts.

Link to comment
Share on other sites


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

 

 

Update :

 

It is working perfectly.. however is it possible that when player cancel the refine. the Mithril coin will return?

 

 

You put it on the mithril coin? And made it usable? because the refine doesn't take the mithril coins unless the player accepts.

 

 

Yea. it works like this

 

1 Mithril Coin consumed > Selection of what item will be refined > Cancel > 1 Mithril Coin will be refunded.

 

 

Update :

 

Everytime i refined an item for example i stop at +20 the npc will look like this.

1. http://i.imgur.com/5Y8lu0e.jpg

2. http://i.imgur.com/D3SeiLr.jpg

Link to comment
Share on other sites


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

About the other thing in the item script just do...

doevent "ticket_refine::OnGoNPCEvent"; getitem 674, 1;

 

Update:

  • Card that is on the Wing[1] < Kiel D-01 when refining the card is gone.
  • Hi there! I got 1 question why is it everytime I use a custom item to make it as refine item its not working

I even change this part into a custom ticket that i made.

OnInit:
	.npc$ = "[ Ticket Refiner ]";
	.tk_id = 674;
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Update:

  • Card that is on the Wing[1] < Kiel D-01 when refining the card is gone.
  • Hi there! I got 1 question why is it everytime I use a custom item to make it as refine item its not working

I even change this part into a custom ticket that i made.

OnInit:
	.npc$ = "[ Ticket Refiner ]";
	.tk_id = 674;

 

If you enabled the switch to getitem2 there was a problem with that option.

It's fixed now, but I'm not really sure why custom items aren't working for you.

I don't think it has anything todo with the script.

Link to comment
Share on other sites


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

 

Update:

  • Card that is on the Wing[1] < Kiel D-01 when refining the card is gone.
  • Hi there! I got 1 question why is it everytime I use a custom item to make it as refine item its not working

I even change this part into a custom ticket that i made.

OnInit:
	.npc$ = "[ Ticket Refiner ]";
	.tk_id = 674;

 

If you enabled the switch to getitem2 there was a problem with that option.

It's fixed now, but I'm not really sure why custom items aren't working for you.

I don't think it has anything todo with the script.

 

 

Thanks i forgot to change something on the ticket.!

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...