Jump to content
  • 0

Refine Function not working after latest src update


Felten

Question


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  104
  • Reputation:   15
  • Joined:  01/18/16
  • Last Seen:  

I'm using Emistry's Refine Function - https://rathena.org/board/topic/86008-utility-refine-function/ -

After i updated my src last night the script doesn't work anymore, nothing appears on the menu. I know some things related to this got changed but i can't figure out how to solve this.

 

If anyone can give me a hand on this i'll be grateful. Thanks in advance.

 

 

This is the script if it helps:

function	script	RefineFunc	{

disable_items;
if (isequipped(2576)) {
for( set .@i,1; .@i <= 10; set .@i,.@i + 1 )
	set .@Menu$,.@Menu$ + (( getarg(2) & pow( 2,(.@i-1 ) ) && getequiprefinerycnt( .@i ) >= getarg(3) && getequiprefinerycnt( .@i ) < getarg(4) && getequipisequiped( .@i )?"^FF0000+"+getequiprefinerycnt( .@i )+" ^0000FF"+getequipname( .@i)+" "+( getitemslots( getequipid( .@i ) )?"["+getitemslots( getequipid( .@i ) )+"]":"" )+"^000000":"" )+":";
set .@Refine,select( .@Menu$ );
mes "Preciso de^FF0000"+getarg(1)+" x "+getitemname( getarg(0) )+"^000000";
if( getarg(5) == 1 && !getequipisenableref( .@Refine ) )
	mes "Eu não posso refinar esse item.";
else{
	if( select( "^FF0000Refinar^000000:Cancelar" ) == 2 ) close;	
		if( countitem( getarg(0) ) < getarg(1) ) close;
			delitem getarg(0),getarg(1);
		if( rand(100) < getarg(7) ){
			if( getarg(6) ) 
				while( getequiprefinerycnt( .@Refine ) < getarg(4) )
					successrefitem ( .@Refine );
			else
				successrefitem ( .@Refine );
			mes "Você refinou : ";
			mes "^FF0000+"+getequiprefinerycnt( .@Refine )+" ^0000FF"+getequipname( .@Refine )+"^000000";
		}else{
			failedrefitem ( .@Refine );
			mes "Sorry, Failed in Refine and Equipment...Destroyed.";
		}
}
close;
}
else if (isequipped(2589)) {
for( set .@i,1; .@i <= 10; set .@i,.@i + 1 )
	set .@Menu$,.@Menu$ + (( getarg(2) & pow( 2,(.@i-1 ) ) && getequiprefinerycnt( .@i ) >= getarg(3) && getequiprefinerycnt( .@i ) < getarg(4) && getequipisequiped( .@i) )?"^FF0000+"+getequiprefinerycnt( .@i )+" ^0000FF"+getequipname( .@i )+" "+( getitemslots( getequipid( .@i ) )?"["+getitemslots( getequipid( .@i ) )+"]":"" )+"^000000":"" )+":";
set .@Refine,select( .@Menu$ );
mes "Preciso de^FF0000"+getarg(1)+" x "+getitemname( getarg(0) )+"^000000";
if( getarg(5) == 1 && !getequipisenableref( .@Refine ) )
	mes "Eu não posso refinar esse item.";
else{
	if( select( "^FF0000Refinar^000000:Cancelar" ) == 2 ) close;	
		if( countitem( getarg(0) ) < getarg(1) ) close;
			delitem getarg(0),getarg(1);
		if( rand(100) < getarg(7) ){
			if( getarg(6) ) 
				while( getequiprefinerycnt( .@Refine ) < getarg(4) )
					successrefitem ( .@Refine );
			else
				successrefitem ( .@Refine );
			mes "Você refinou : ";
			mes "^FF0000+"+getequiprefinerycnt( .@Refine )+" ^0000FF"+getequipname( .@Refine )+"^000000";
		}else{
			failedrefitem ( .@Refine );
			mes "Sorry, Failed in Refine and Equipment...Destroyed.";
		}
}
close;
}
else {
mes "Você não está com a asa nem/ou a mochila equipada.";
close;
}
enable_items;
}

Edited by cfelten
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  816
  • Reputation:   236
  • Joined:  01/30/13
  • Last Seen:  

It's mostly because scripts should be using the constants rather than using the internal numbers for positions.

 

You can see how Lemongrass fixed the official refine NPC here:

https://github.com/rathena/rathena/commit/7046cf8fc588d4c17047107a98f24547964e6e2e

 

Or Atemo script fixes here:

https://github.com/rathena/rathena/commit/05a1b61beded08b7759b59ef381b4ddbad791abf

https://github.com/rathena/rathena/commit/7d6be7e21ea831130111de846b81700cfc6c6c1e

 

And make sure you have the update on the global function for appropriate usage:

https://github.com/rathena/rathena/commit/1a87f90aa9a9c8f40dec41517b6f2d749c73378e

 

If you have custom scripts you have to adjust them accordingly.

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  104
  • Reputation:   15
  • Joined:  01/18/16
  • Last Seen:  

Oh, i get it now. Thanks for the help!

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