• 0
Sign in to follow this  
Disable

Refiner & Derefiner

Question

Hello, I would like to have a NPC of Save +10 Refine for Item and Derefine for Zeny

Edited by Vegas

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

prontera,155,181,5	script	Sample	4_F_KAFRA1,{
	[email protected] = select(.eqi_menu$);
	mes "it cost "+F_InsertComma(.cost[[email protected]])+" Zeny";
	if (getequipid(.eqi_list[[email protected]]) <= 0) {
		mes "you didnt have any equipment there.";
	}
	else if (Zeny < .cost[[email protected]]) {
	
	}
	else {
		[email protected] = select("refine", "derefine");
		Zeny -= .cost[[email protected]];
		if ([email protected] == 1) {
			successrefitem .eqi_list[[email protected]];
		}
		else {
			downrefitem .eqi_list[[email protected]];
		}
		mes "done.";
	}
	close;
	
	OnInit:
		setarray .cost, 
			10000,	// refine
			100000;	// de-refine
			
		setarray .eqi_list,
			EQI_HEAD_TOP,
			EQI_ARMOR,
			EQI_HAND_L,
			EQI_HAND_R,
			EQI_GARMENT,
			EQI_SHOES;
			
		[email protected] = getarraysize(.eqi_list);
		for ([email protected] = 0; [email protected] < [email protected]; [email protected]++) 
			.eqi_menu$ = .eqi_menu$ + F_getpositionname(.eqi_list[[email protected]]) + ":";
		end;
}

 

Share this post


Link to post
Share on other sites
  • 0

I used the search engine lol... but I have no idea how to adden it...
with zeny and item...

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

who can help me to fix this?

prontera,111,64,5    script    +10 Refiner NPC    813,{
for( set [email protected],1; [email protected] <= 6; set [email protected],[email protected] + 1 )
    if( getequipisequiped( [email protected] ) ){
        if( getequipisenableref( [email protected] ) && getequiprefinerycnt( [email protected] ) <= .max_refine ){
            set [email protected]_count,[email protected]_count + 1;
            set [email protected]$,[email protected]$ + " +"+getequiprefinerycnt( [email protected] )+" "+getequipname( [email protected] ) +":";
        }else{
            set [email protected]$,[email protected]$ +":";
        }
    }else{
        set [email protected]$,[email protected]$ +":";
    }
if( [email protected]_count ){
    mes "You dont have any equipment available for refine.";
    close;
}

set [email protected],select( [email protected]$ );
set [email protected]_equip,getequipid( [email protected] );

do{
    if( getequipid( [email protected] ) != [email protected]_equip ){
        mes "Dont change to other equipments.";
        close;
    }
    
    set [email protected]_level,getequipweaponlv( [email protected] );
    if( [email protected]_level == 1 ) set [email protected]_refine,6;
    else if( [email protected]_level == 2 ) set [email protected]_refine,7;
    else if( [email protected]_level == 3 ) set [email protected]_refine,8;
    else if( [email protected]_level == 4 ) set [email protected]_refine,9;
    else if( [email protected]_level == 5 ) set [email protected]_refine,3;
    else if( [email protected]_level == 6 ) set [email protected]_refine,2;
    else set [email protected]_refine,4;
    
    set [email protected]_count,getequiprefinerycnt( [email protected] );
    
    if( .zeny_cost ){
        mes "Every Refine : ^0055FF"+callfunc( "ValueConvert",.zeny_cost )+" Zeny^000000";
        mes "De-refine : ^FF0000Free^000000";
        mes " ";
        mes "If current refine below +^FF0000"[email protected]_refine+" : ^FF0000Free^000000";
        next;
    }

    set [email protected],select(( [email protected]_count >= .max_refine )?"":"Refine to ^0055FF+"+( [email protected]_count + 1 )+" "+getequipname( [email protected] )+"^000000",
                        ( [email protected]_count < 1 )?"":"De-refine -1" );  // temporary disabled de-refine
    
    if( Zeny < .zeny_cost && [email protected] == 1 ){
        message strcharinfo(0),"Dont have enough zeny.";
        break;
    }
    
    if( [email protected]_count < 1 && [email protected] == 2 ){
        mes "You cant de-refine this anymore.";
        break;
    }else if( [email protected]_count >= .max_refine && [email protected] == 1 ){
        mes "You cant refine this anymore.";
    }else{
        if( [email protected] == 1 && [email protected]_count >= [email protected]_refine )
            set Zeny,Zeny - .zeny_cost;
        switch( [email protected] ){
            Case 1: successrefitem [email protected]; break;
            Case 2: downrefitem [email protected]; break;
            default: break;
        }
    }
    
    if( getequiprefinerycnt( [email protected] ) >= .max_refine ){
        mes "Max Refine Reach...";
        break;
    }
}while( 1 );
close;

OnInit:
OnWhisperGlobal:
set .zeny_cost,0;
set .max_refine,10;

waitingroom "  Refiner / DeRefiner",0;
end;
}

 

Edited by Emistry
Please use codebox

Share this post


Link to post
Share on other sites
  • 0
38 minutes ago, Rizal Shadowx said:

who can help me to fix this?

prontera,111,64,5	script	+10 Refiner NPC	813,{
	for( set [email protected],EQI_SHOES; [email protected] <= EQI_HAND_R; set [email protected],[email protected] + 1 )
		if( getequipisequiped( [email protected] ) ){
			if( getequipisenableref( [email protected] ) && getequiprefinerycnt( [email protected] ) <= .max_refine ){
				set [email protected]_count,[email protected]_count + 1;
				set [email protected]$,[email protected]$ + " +"+getequiprefinerycnt( [email protected] )+" "+getequipname( [email protected] ) +":";
			}else{
				set [email protected]$,[email protected]$ +":";
			}
		}else{
			set [email protected]$,[email protected]$ +":";
		}
	if( [email protected]_count ){
		mes "You dont have any equipment available for refine.";
		close;
	}

	set [email protected],select( [email protected]$ ) + 1;
	set [email protected]_equip,getequipid( [email protected] );

	do{
		if( getequipid( [email protected] ) != [email protected]_equip ){
			mes "Dont change to other equipments.";
			close;
		}
		
		set [email protected]_level,getequipweaponlv( [email protected] );
		if( [email protected]_level == 1 ) set [email protected]_refine,6;
		else if( [email protected]_level == 2 ) set [email protected]_refine,7;
		else if( [email protected]_level == 3 ) set [email protected]_refine,8;
		else if( [email protected]_level == 4 ) set [email protected]_refine,9;
		else if( [email protected]_level == 5 ) set [email protected]_refine,3;
		else if( [email protected]_level == 6 ) set [email protected]_refine,2;
		else set [email protected]_refine,4;
		
		set [email protected]_count,getequiprefinerycnt( [email protected] );
		
		if( .zeny_cost ){
			mes "Every Refine : ^0055FF"+callfunc( "ValueConvert",.zeny_cost )+" Zeny^000000";
			mes "De-refine : ^FF0000Free^000000";
			mes " ";
			mes "If current refine below +^FF0000"[email protected]_refine+" : ^FF0000Free^000000";
			next;
		}

		set [email protected],select(( [email protected]_count >= .max_refine )?"":"Refine to ^0055FF+"+( [email protected]_count + 1 )+" "+getequipname( [email protected] )+"^000000",
							( [email protected]_count < 1 )?"":"De-refine -1" );  // temporary disabled de-refine
		
		if( Zeny < .zeny_cost && [email protected] == 1 ){
			message strcharinfo(0),"Dont have enough zeny.";
			break;
		}
		
		if( [email protected]_count < 1 && [email protected] == 2 ){
			mes "You cant de-refine this anymore.";
			break;
		}else if( [email protected]_count >= .max_refine && [email protected] == 1 ){
			mes "You cant refine this anymore.";
		}else{
			if( [email protected] == 1 && [email protected]_count >= [email protected]_refine )
				set Zeny,Zeny - .zeny_cost;
			switch( [email protected] ){
				Case 1: successrefitem [email protected]; break;
				Case 2: downrefitem [email protected]; break;
				default: break;
			}
		}
		
		if( getequiprefinerycnt( [email protected] ) >= .max_refine ){
			mes "Max Refine Reach...";
			break;
		}
	}while( 1 );
	close;

	OnInit:
		OnWhisperGlobal:
		set .zeny_cost,0;
		set .max_refine,10;

		waitingroom "  Refiner / DeRefiner",0;
		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
Sign in to follow this