Jump to content
  • 0
Sign in to follow this  
Hadeszeus

Can't make it work I need help on Refine limit

Question

Sorry I can't figure it out. I need to increase the SAFE limit from 4 to +8.

 

function Refine_Item;		if (.EnrichedRefine) {			mes .n$;			mes "There are 2 types of Refiner";			mes "^ff0000Normal Refiner^000000 can upgrade your items in normal rate.";			mes "While ^ff0000Enriched Refiner^000000 double the chance each upgrade.";			next;			mes "Select an option now.";			next;						if (select(" ~ Normal Refiner: ~ Enriched Refiner") == 2) {				mes .n$;				mes "What do you want to refine?";				next;				Equip_Menu(1);				setarray .@Materials[0],7619,7620,7620,7620,7620;				setarray .@Safe[0],4,7,6,5,4;				set .@WLv, getequipweaponlv(@i);				mes .n$;				mes "Item: +"+getequiprefinerycnt(@i)+" "+getequipname(@i);				next;				if(select(" ~ Refine item (2 * ^0055FF"+getequippercentrefinery(@i)+"^000000% success): ~ ^777777Cancel^000000") == 2)					close;				Refine_Item(1, .@Materials[.@WLv], .RP[.@WLv], .@Safe[.@WLv], 1);				close;			}		}		mes .n$;		mes "What do you want to refine?";		next;		Equip_Menu(1);		setarray .@Materials[0],985,1010,1011,984,984;		setarray .@Safe[0],4,7,6,5,4;		set .@WLv, getequipweaponlv(@i);		set .@SafeCount, .@Safe[.@WLv]-getequiprefinerycnt(@i);		mes .n$;		mes "Item: +"+getequiprefinerycnt(@i)+" "+getequipname(@i);		next;		switch(select(" ~ Refine once (^0055FF"+getequippercentrefinery(@i)+"^000000% success): ~ Refine multiple times (up to "+(10-getequiprefinerycnt(@i))+"): ~ Refine to safe limit ("+((.@SafeCount>0)?.@SafeCount+" refines":"^777777disabled^000000")+"): ~ ^777777Cancel^000000")) {		case 1:			Refine_Item(1, .@Materials[.@WLv], .RP[.@WLv], .@Safe[.@WLv]);			close;		case 2:			input .@Refines;			if (.@Refines+getequiprefinerycnt(@i) > 10 || .@Refines < 1) {				mes .n$;				mes "Invalid number ("+.@Refines+").";			} else				Refine_Item(.@Refines, .@Materials[.@WLv], .RP[.@WLv], .@Safe[.@WLv]);			close;		case 3:			if (.@SafeCount < 1) {				mes .n$;				mes "The item has already reached the safe limit.";			} else				Refine_Item(.@SafeCount, .@Materials[.@WLv], .RP[.@WLv], .@Safe[.@WLv]);			close;		case 4:			close;		}		function Equip_Menu {			setarray .@pos$[1],"Upper Headgear","Armor","Left hand","Right hand","Garment","Footgear","Left Accessory","Right Accessory","Mid Headgear","Lower Headgear";			set .@menu$,"";			for (set .@i,1; .@i <= 10; set .@i,.@i+1) {				if (getequipisequiped(.@i))					set .@menu$, .@menu$+.@pos$[.@i]+" [^0055FF"+getequipname(.@i)+"^000000]";				set .@menu$, .@menu$+":";			}			set @i, select(.@menu$);			if (!getequipisequiped(@i)) {				mes .n$;				mes "Nothing is equipped there!";				close;			}			if (getarg(0)) {				if (!getequipisenableref(@i)) {					mes .n$;					mes getequipname(@i)+" cannot be refined.";					close;				}				if (getequiprefinerycnt(@i) >= 10 ) {					mes .n$;					mes "+"+getequiprefinerycnt(@i)+" "+getequipname(@i)+" cannot be refined any further.";					mes "Talk to my daughter Brenda she can refine items higher than +10.";					close;				}			}			return;		}		function Refine_Item {			mes .n$;			set .@price, getarg(0)*getarg(2);			mes "I'll need "+getarg(0)+"x "+getitemname(getarg(1))+" and "+Cm(.@price)+" Zeny.";			if (countitem(getarg(1)) < getarg(0) || Zeny < .@price) {				mes "Come back when you have the required materials.";				close;			}			if (getequiprefinerycnt(@i)+getarg(0) > getarg(3))				mes "The item will be refined above the safe limit. It may break.";			next;			if(select(" ~ ^0055FFContinue^000000: ~ ^777777Cancel^000000") == 2)				close;			mes .n$;			set .@j, getarg(0);			while(.@j) {				delitem getarg(1),1;				set Zeny, Zeny-getarg(2);				if (getarg(4,0)) {					if (getequippercentrefinery(@i) <= rand(100) && getequippercentrefinery(@i) <= rand(100)) {						mes getequipname(@i)+" broke while refining.";						failedrefitem @i;						close;					}				} else {					if (getequippercentrefinery(@i) <= rand(100)) {						mes getequipname(@i)+" broke while refining.";						failedrefitem @i;						close;					}				}				successrefitem @i;				set .@j, .@j-1;			}			mes "All done!";			close;		}

 

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Yes I'm editing it for an hour or two changing first 4 to 8 only change the limit number of safe refine on menu option. But doesn't solved the problem. Maybe the problem is on this line

 

mes .n$;			set .@j, getarg(0);			while(.@j) {				delitem getarg(1),1;				set Zeny, Zeny-getarg(2);				if (getarg(4,0)) {					if (getequippercentrefinery(@i) <= rand(100) && getequippercentrefinery(@i) <= rand(100)) {						mes getequipname(@i)+" broke while refining.";						failedrefitem @i;						close;					}				} else {					if (getequippercentrefinery(@i) <= rand(100)) {						mes getequipname(@i)+" broke while refining.";						failedrefitem @i;						close;					}				}				successrefitem @i;				set .@j, .@j-1;			}			mes "All done!";

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.